Browse Source

generations: update

vscode: settings.json
devices: close file with function
main
mini 4 months ago
parent
commit
ce853a74ab
6 changed files with 9 additions and 2 deletions
  1. +5
    -0
      .vscode/settings.json
  2. +1
    -0
      devices/devices_json.go
  3. +2
    -1
      devices/devices_xdr.go
  4. BIN
     
  5. +1
    -1
      go.mod
  6. BIN
     

+ 5
- 0
.vscode/settings.json View File

@ -0,0 +1,5 @@
{
"gopls": {
"build.buildFlags": ["xdr"]
}
}

+ 1
- 0
devices/devices_json.go View File

@ -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
}

+ 2
- 1
devices/devices_xdr.go View File

@ -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()

BIN
View File


+ 1
- 1
go.mod View File

@ -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

BIN
View File


Loading…
Cancel
Save