diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..80906c1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "gopls": { + "build.buildFlags": ["xdr"] + } +} \ No newline at end of file diff --git a/devices/devices_json.go b/devices/devices_json.go index b2925aa..337bdc6 100644 --- a/devices/devices_json.go +++ b/devices/devices_json.go @@ -31,6 +31,7 @@ func LoadKeymap(file io.ReadCloser, dev *DeviceDef) *KeyMap { mapped.Keymap = make([]uint16, dev.NumKeys) binary.Read(file, binary.LittleEndian, mapped.Keymap) binary.Read(file, binary.LittleEndian, mapped.Color) + file.Close() return mapped } diff --git a/devices/devices_xdr.go b/devices/devices_xdr.go index 761f6b2..de3cf8c 100644 --- a/devices/devices_xdr.go +++ b/devices/devices_xdr.go @@ -29,10 +29,11 @@ func init() { func LoadKeymap(file io.ReadCloser, dev *DeviceDef) *KeyMap { mapped := new(KeyMap) xdr.Unmarshal(file, mapped) + file.Close() return mapped } -//SavePKMKeymap saves an orb after edit +//SaveKeymap Save Orbmap KM struction func SaveKeymap(file io.WriteCloser, mapped interface{}) { xdr.Marshal(file, mapped) file.Close() diff --git a/devices/xdr/orbweaver.bin b/devices/xdr/orbweaver.bin index 7347435..fe77bfa 100644 Binary files a/devices/xdr/orbweaver.bin and b/devices/xdr/orbweaver.bin differ diff --git a/go.mod b/go.mod index 6aa821c..189c1d6 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/OrbTools/OrbCommon go 1.16 -require github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892 // indirect +require github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892 diff --git a/hid/generated.bin b/hid/generated.bin index 0465c2c..d06eb33 100644 Binary files a/hid/generated.bin and b/hid/generated.bin differ