Skip to content

Commit

Permalink
feat: complete load value from controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeLayer committed Oct 25, 2024
1 parent 1eb98da commit 4e8d9e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions configurator/lib/globals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class Globals {
return null;
}
keyConfig = serialLoadSavedKeyConfigurationResult.data!;
requestRefreshKeyConfigValueDisplayerWithKey();
return keyConfig;
}

Expand Down
6 changes: 4 additions & 2 deletions configurator/lib/models/key_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ class KeyConfig implements KeyConfigStructure<EachKeyConfig> {
return Function.apply(
KeyConfig.new,
list.map<EachKeyConfig>((each) {
print('keycode: ${ArduinoKeycode.toKey(each)}');
print('keycode: ${each != Keycode.undefined}');
return EachKeyConfig(
keycode: ArduinoKeycode.toKey(each % (1 << 8)),
enabled: (each / (1 << 8) == 0));
keycode: ArduinoKeycode.toKey(each),
enabled: each != Keycode.undefined);
}).toList()) as KeyConfig;
}

Expand Down
3 changes: 2 additions & 1 deletion controller/const.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef CONST
#define CONST

#define undefined (int)-1e8
#define keyconfig_disabled (1 << 7)
#define undefined keyconfig_disabled

#endif

0 comments on commit 4e8d9e3

Please sign in to comment.