Compare commits
No commits in common. "main" and "v0.9.0" have entirely different histories.
@ -19,7 +19,7 @@ Copyright: © 2023 Brian S. Stephan <bss@incorporeal.org>
|
|||||||
License: GPL-3.0-or-later
|
License: GPL-3.0-or-later
|
||||||
|
|
||||||
# Test data (GP2040-CE-derived)
|
# Test data (GP2040-CE-derived)
|
||||||
Files: tests/test-files/proto-files/*
|
Files: tests/test-files/pb2-files/* tests/test-files/proto-files/*
|
||||||
Copyright: (c) 2024 OpenStickCommunity (gp2040-ce.info)
|
Copyright: (c) 2024 OpenStickCommunity (gp2040-ce.info)
|
||||||
License: MIT
|
License: MIT
|
||||||
|
|
||||||
|
40
CHANGELOG.md
40
CHANGELOG.md
@ -3,46 +3,6 @@
|
|||||||
Included is a summary of changes to the project. For full details, especially on behind-the-scenes code changes and
|
Included is a summary of changes to the project. For full details, especially on behind-the-scenes code changes and
|
||||||
development tools, see the commit history.
|
development tools, see the commit history.
|
||||||
|
|
||||||
## v0.11.1
|
|
||||||
|
|
||||||
### Miscellaneous
|
|
||||||
|
|
||||||
* The storage size and subsequent tests have been updated to expect a 32 KB config section (rather than the previous 16
|
|
||||||
KB).
|
|
||||||
|
|
||||||
## v0.11.0
|
|
||||||
|
|
||||||
### Improvements
|
|
||||||
|
|
||||||
* The usage of provided GP2040-CE config Protobuf files must be explicitly specified via the `-S` flag. This is in order
|
|
||||||
to not accidentally fall back to them and be confused by the results. The net effect is that in most situations, users
|
|
||||||
will have to provide either `-P PATH` or `-S`.
|
|
||||||
* The testing of the above fallbacks covers the options far better than before now.
|
|
||||||
|
|
||||||
### Miscellaneous
|
|
||||||
|
|
||||||
* Version bumps, which brought about a couple updates to the tests.
|
|
||||||
|
|
||||||
## v0.10.0
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* The board dump can now be made in UF2 format.
|
|
||||||
* Kind of a retrograde feature --- precompiled Python files are no longer shipped with the project, as that is not
|
|
||||||
recommended by upstream protobuf. The version bumps have potentially fixed the Windows issues that led to the
|
|
||||||
precompiled Python files (rather than just the protobuf snapshots) being shipped in the first place, so we'll stop
|
|
||||||
shipping them for now.
|
|
||||||
|
|
||||||
### Improvements
|
|
||||||
|
|
||||||
* The protobuf snapshot files have been updated for GP2040-CE v0.7.10.
|
|
||||||
|
|
||||||
### Miscellaneous
|
|
||||||
|
|
||||||
* The TUI "Save As" test was checking old vs. new outputs, which wouldn't make any sense once the latest output fills in
|
|
||||||
new defaults, etc. not present in the origin file, which is pretty normal, so the test was simplified.
|
|
||||||
* twine was added in the dev dependencies, and version bumps done for both requirements files.
|
|
||||||
|
|
||||||
## v0.9.0
|
## v0.9.0
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
12
README.md
12
README.md
@ -13,9 +13,9 @@ over USB.
|
|||||||
|
|
||||||
All tools take `-P PATH` flag(s) in order to import Protobuf files (either precompiled Python files or raw .proto files)
|
All tools take `-P PATH` flag(s) in order to import Protobuf files (either precompiled Python files or raw .proto files)
|
||||||
if you have them locally, in order to work with the latest (or development) version of the configuration. That said,
|
if you have them locally, in order to work with the latest (or development) version of the configuration. That said,
|
||||||
this tool also includes a copy of the config files if you cannot supply these files, and will attempt to compile those
|
this tool also includes a precompiled fallback version of the config structure if you cannot supply these files. Be
|
||||||
as a fallback. Be aware, however, that they are a point in time snapshot, and may lag the real format in undesirable
|
aware, however, that they are a point in time snapshot, and may lag the real format in undesirable ways. Supply the
|
||||||
ways. Supply the latest Protobuf files if you can.
|
latest Protobuf files if you can.
|
||||||
|
|
||||||
An example of this invocation is:
|
An example of this invocation is:
|
||||||
|
|
||||||
@ -232,11 +232,11 @@ The latest update of the configuration snapshot is from **v0.7.8**.
|
|||||||
### Dumping the GP2040-CE board with picotool
|
### Dumping the GP2040-CE board with picotool
|
||||||
|
|
||||||
Some of these tools require a dump of your GP2040-CE board, either the storage section or the whole board, depending on
|
Some of these tools require a dump of your GP2040-CE board, either the storage section or the whole board, depending on
|
||||||
the context. The user config storage section of a GP2040-CE board is a reserved 32 KB starting at `0x101F8000`. To dump
|
the context. The storage section of a GP2040-CE board is a reserved 16 KB starting at `0x101FC000`. To dump your board's
|
||||||
your board's storage with picotool:
|
storage with picotool:
|
||||||
|
|
||||||
```
|
```
|
||||||
% picotool save -r 101F8000 10200000 memory.bin
|
% picotool save -r 101FC000 10200000 memory.bin
|
||||||
```
|
```
|
||||||
|
|
||||||
And to dump your whole board:
|
And to dump your whole board:
|
||||||
|
@ -40,8 +40,6 @@ core_parser.add_argument('-d', '--debug', action='store_true', help="enable debu
|
|||||||
core_parser.add_argument('-P', '--proto-files-path', type=pathlib.Path, default=list(), action='append',
|
core_parser.add_argument('-P', '--proto-files-path', type=pathlib.Path, default=list(), action='append',
|
||||||
help="path to .proto files to read, including dependencies; you will likely need "
|
help="path to .proto files to read, including dependencies; you will likely need "
|
||||||
"to supply this twice, once for GP2040-CE's .proto files and once for nanopb's")
|
"to supply this twice, once for GP2040-CE's .proto files and once for nanopb's")
|
||||||
core_parser.add_argument('-S', '--use-shipped-fallback', action='store_true',
|
|
||||||
help="utilize shipped (potentially stale) .proto files because you can't supply your own")
|
|
||||||
args, _ = core_parser.parse_known_args()
|
args, _ = core_parser.parse_known_args()
|
||||||
for path in args.proto_files_path:
|
for path in args.proto_files_path:
|
||||||
sys.path.append(os.path.abspath(os.path.expanduser(path)))
|
sys.path.append(os.path.abspath(os.path.expanduser(path)))
|
||||||
@ -52,27 +50,20 @@ else:
|
|||||||
handler.setLevel(logging.WARNING)
|
handler.setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
|
||||||
def get_config_pb2(with_fallback: bool = args.use_shipped_fallback):
|
def get_config_pb2():
|
||||||
"""Retrieve prebuilt _pb2 file or attempt to compile it live."""
|
"""Retrieve prebuilt _pb2 file or attempt to compile it live."""
|
||||||
# try to just import a precompiled module if we have been given it in our path
|
# try to just import a precompiled module if we have been given it in our path
|
||||||
# (perhaps someone already compiled it for us for whatever reason)
|
# (perhaps someone already compiled it for us for whatever reason)
|
||||||
try:
|
try:
|
||||||
logger.debug("Trying precompiled protobuf modules...")
|
|
||||||
return importlib.import_module('config_pb2')
|
return importlib.import_module('config_pb2')
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
# no found precompiled config, try to compile the proto files in realtime
|
# no found precompiled config, try to compile the proto files in realtime
|
||||||
# because it's possible someone put them on the path
|
# because it's possible someone put them on the path
|
||||||
try:
|
try:
|
||||||
logger.debug("No precompiled protobuf modules found, invoking gRPC tool to compile config.proto...")
|
logger.info("Invoking gRPC tool to compile config.proto...")
|
||||||
return grpc.protos('config.proto')
|
return grpc.protos('config.proto')
|
||||||
except (ModuleNotFoundError, TypeError):
|
except (ModuleNotFoundError, TypeError):
|
||||||
# (TypeError could be the windows bug https://github.com/protocolbuffers/protobuf/issues/14345)
|
# (TypeError could be the windows bug https://github.com/protocolbuffers/protobuf/issues/14345)
|
||||||
if not with_fallback:
|
# that failed, import a precompiled snapshot (may be lagging what's in GP2040-CE)
|
||||||
logger.exception("no viable set of protobuf modules could be found, please use -P or -S!")
|
|
||||||
raise RuntimeError("no viable set of protobuf modules could be found, please use -P or -S!")
|
|
||||||
|
|
||||||
# that failed, import the snapshot (may be lagging what's in GP2040-CE)
|
|
||||||
logger.warning("using the fallback .proto files! please supply your files with -P if you can!")
|
|
||||||
sys.path.append(os.path.join(pathlib.Path(__file__).parent.resolve(), 'proto_snapshot'))
|
sys.path.append(os.path.join(pathlib.Path(__file__).parent.resolve(), 'proto_snapshot'))
|
||||||
logger.debug("Invoking gRPC tool again to compile shipped config.proto...")
|
return importlib.import_module('config_pb2')
|
||||||
return grpc.protos('config.proto')
|
|
||||||
|
@ -338,10 +338,6 @@ def dump_gp2040ce():
|
|||||||
args, _ = parser.parse_known_args()
|
args, _ = parser.parse_known_args()
|
||||||
content, _, _ = get_gp2040ce_from_usb()
|
content, _, _ = get_gp2040ce_from_usb()
|
||||||
with open(args.binary_filename, 'wb') as out_file:
|
with open(args.binary_filename, 'wb') as out_file:
|
||||||
if args.binary_filename[-4:] == '.uf2':
|
|
||||||
# we must pad to storage start in order for the UF2 write addresses to make sense
|
|
||||||
out_file.write(storage.convert_binary_to_uf2([(0, content)]))
|
|
||||||
else:
|
|
||||||
out_file.write(content)
|
out_file.write(content)
|
||||||
|
|
||||||
|
|
||||||
|
9
gp2040ce_bintools/proto_snapshot/__init__.py
Normal file
9
gp2040ce_bintools/proto_snapshot/__init__.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
"""COPIED OUTPUT OF `protoc foo.proto --python_out .`.
|
||||||
|
|
||||||
|
The .proto files here have been copied from https://github.com/OpenStickCommunity/GP2040-CE and
|
||||||
|
are a point in time import of the GP2040-CE firmware's configuration structure. THEY MAY BE OUT
|
||||||
|
OF DATE. If you are a developer, you should really use the `-P` flags to import your local copy
|
||||||
|
of the .proto files.
|
||||||
|
"""
|
||||||
|
|
||||||
|
GP2040CE_SNAPSHOT_VERSION = 'v0.7.7'
|
@ -28,7 +28,6 @@ message GamepadOptions
|
|||||||
optional InputModeAuthType ps4AuthType = 21;
|
optional InputModeAuthType ps4AuthType = 21;
|
||||||
optional InputModeAuthType ps5AuthType = 22;
|
optional InputModeAuthType ps5AuthType = 22;
|
||||||
optional InputModeAuthType xinputAuthType = 23;
|
optional InputModeAuthType xinputAuthType = 23;
|
||||||
optional PS4ControllerIDMode ps4ControllerIDMode = 24;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message KeyboardMapping
|
message KeyboardMapping
|
||||||
@ -51,21 +50,6 @@ message KeyboardMapping
|
|||||||
optional uint32 keyButtonR3 = 16;
|
optional uint32 keyButtonR3 = 16;
|
||||||
optional uint32 keyButtonA1 = 17;
|
optional uint32 keyButtonA1 = 17;
|
||||||
optional uint32 keyButtonA2 = 18;
|
optional uint32 keyButtonA2 = 18;
|
||||||
optional uint32 keyButtonA3 = 19;
|
|
||||||
optional uint32 keyButtonA4 = 20;
|
|
||||||
optional uint32 keyButtonE1 = 21;
|
|
||||||
optional uint32 keyButtonE2 = 22;
|
|
||||||
optional uint32 keyButtonE3 = 23;
|
|
||||||
optional uint32 keyButtonE4 = 24;
|
|
||||||
optional uint32 keyButtonE5 = 25;
|
|
||||||
optional uint32 keyButtonE6 = 26;
|
|
||||||
optional uint32 keyButtonE7 = 27;
|
|
||||||
optional uint32 keyButtonE8 = 28;
|
|
||||||
optional uint32 keyButtonE9 = 29;
|
|
||||||
optional uint32 keyButtonE10 = 30;
|
|
||||||
optional uint32 keyButtonE11 = 31;
|
|
||||||
optional uint32 keyButtonE12 = 32;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message HotkeyEntry
|
message HotkeyEntry
|
||||||
@ -184,16 +168,11 @@ message PinMappings
|
|||||||
message GpioMappingInfo
|
message GpioMappingInfo
|
||||||
{
|
{
|
||||||
optional GpioAction action = 1;
|
optional GpioAction action = 1;
|
||||||
optional GpioDirection direction = 2;
|
|
||||||
optional uint32 customDpadMask = 3;
|
|
||||||
optional uint32 customButtonMask = 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message GpioMappings
|
message GpioMappings
|
||||||
{
|
{
|
||||||
repeated GpioMappingInfo pins = 1 [(nanopb).max_count = 30];
|
repeated GpioMappingInfo pins = 1 [(nanopb).max_count = 30];
|
||||||
optional string profileLabel = 2 [(nanopb).max_length = 16];
|
|
||||||
optional bool enabled = 3 [default = false];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -224,10 +203,10 @@ message DisplayOptions
|
|||||||
{
|
{
|
||||||
optional bool enabled = 1;
|
optional bool enabled = 1;
|
||||||
|
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
optional int32 i2cBlock = 2;
|
||||||
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
||||||
optional int32 deprecatedI2cAddress = 5 [deprecated = true];
|
optional int32 i2cAddress = 5;
|
||||||
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
||||||
|
|
||||||
optional ButtonLayout buttonLayout = 7;
|
optional ButtonLayout buttonLayout = 7;
|
||||||
@ -360,7 +339,7 @@ message AnalogOptions
|
|||||||
optional int32 analogAdc1PinX = 2;
|
optional int32 analogAdc1PinX = 2;
|
||||||
optional int32 analogAdc1PinY = 3;
|
optional int32 analogAdc1PinY = 3;
|
||||||
optional bool forced_circularity = 4;
|
optional bool forced_circularity = 4;
|
||||||
optional uint32 inner_deadzone = 5;
|
optional uint32 analog_deadzone = 5;
|
||||||
optional int32 analogAdc2PinX = 6;
|
optional int32 analogAdc2PinX = 6;
|
||||||
optional int32 analogAdc2PinY = 7;
|
optional int32 analogAdc2PinY = 7;
|
||||||
optional DpadMode analogAdc1Mode = 8;
|
optional DpadMode analogAdc1Mode = 8;
|
||||||
@ -368,10 +347,6 @@ message AnalogOptions
|
|||||||
optional InvertMode analogAdc1Invert = 10;
|
optional InvertMode analogAdc1Invert = 10;
|
||||||
optional InvertMode analogAdc2Invert = 11;
|
optional InvertMode analogAdc2Invert = 11;
|
||||||
optional bool auto_calibrate = 12;
|
optional bool auto_calibrate = 12;
|
||||||
optional uint32 outer_deadzone = 13;
|
|
||||||
optional bool analog_smoothing = 14;
|
|
||||||
optional float smoothing_factor = 15;
|
|
||||||
optional uint32 analog_error = 16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message TurboOptions
|
message TurboOptions
|
||||||
@ -407,7 +382,7 @@ message SliderOptions
|
|||||||
optional int32 deprecatedPinSliderTwo = 3 [deprecated = true];
|
optional int32 deprecatedPinSliderTwo = 3 [deprecated = true];
|
||||||
optional DpadMode deprecatedModeOne = 4 [deprecated = true];
|
optional DpadMode deprecatedModeOne = 4 [deprecated = true];
|
||||||
optional DpadMode deprecatedModeTwo = 5 [deprecated = true];
|
optional DpadMode deprecatedModeTwo = 5 [deprecated = true];
|
||||||
optional DpadMode deprecatedModeDefault = 6;
|
optional DpadMode modeDefault = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SOCDSliderOptions
|
message SOCDSliderOptions
|
||||||
@ -439,10 +414,10 @@ message AnalogADS1219Options
|
|||||||
{
|
{
|
||||||
optional bool enabled = 1;
|
optional bool enabled = 1;
|
||||||
|
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
optional int32 i2cBlock = 2;
|
||||||
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
||||||
optional int32 deprecatedI2cAddress = 5 [deprecated = true];
|
optional int32 i2cAddress = 5;
|
||||||
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,7 +636,7 @@ message WiiOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
optional bool enabled = 1;
|
optional bool enabled = 1;
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
optional int32 i2cBlock = 2;
|
||||||
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSpeed = 5 [deprecated = true];
|
optional int32 deprecatedI2cSpeed = 5 [deprecated = true];
|
||||||
@ -683,9 +658,6 @@ message KeyboardHostOptions
|
|||||||
optional int32 deprecatedPinDplus = 2 [deprecated = true];
|
optional int32 deprecatedPinDplus = 2 [deprecated = true];
|
||||||
optional KeyboardMapping mapping = 3;
|
optional KeyboardMapping mapping = 3;
|
||||||
optional int32 deprecatedPin5V = 4 [deprecated = true];
|
optional int32 deprecatedPin5V = 4 [deprecated = true];
|
||||||
optional uint32 mouseLeft = 5;
|
|
||||||
optional uint32 mouseMiddle = 6;
|
|
||||||
optional uint32 mouseRight = 7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message FocusModeOptions
|
message FocusModeOptions
|
||||||
@ -755,46 +727,13 @@ message RotaryOptions
|
|||||||
optional RotaryPinOptions encoderTwo = 3;
|
optional RotaryPinOptions encoderTwo = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PCF8575Options
|
|
||||||
{
|
|
||||||
optional bool enabled = 1;
|
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
|
||||||
repeated GpioMappingInfo pins = 3 [(nanopb).max_count = 16];
|
|
||||||
}
|
|
||||||
|
|
||||||
message DRV8833RumbleOptions
|
|
||||||
{
|
|
||||||
optional bool enabled = 1;
|
|
||||||
|
|
||||||
optional int32 leftMotorPin = 2;
|
|
||||||
optional int32 rightMotorPin = 3;
|
|
||||||
optional int32 motorSleepPin = 4;
|
|
||||||
optional uint32 pwmFrequency = 5;
|
|
||||||
optional float dutyMin = 6;
|
|
||||||
optional float dutyMax = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReactiveLEDInfo
|
|
||||||
{
|
|
||||||
optional int32 pin = 1;
|
|
||||||
optional GpioAction action = 2;
|
|
||||||
optional ReactiveLEDMode modeDown = 3;
|
|
||||||
optional ReactiveLEDMode modeUp = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReactiveLEDOptions
|
|
||||||
{
|
|
||||||
optional bool enabled = 1;
|
|
||||||
repeated ReactiveLEDInfo leds = 2 [(nanopb).max_count = 10];
|
|
||||||
}
|
|
||||||
|
|
||||||
message AddonOptions
|
message AddonOptions
|
||||||
{
|
{
|
||||||
optional BootselButtonOptions bootselButtonOptions = 1;
|
optional BootselButtonOptions bootselButtonOptions = 1;
|
||||||
optional OnBoardLedOptions onBoardLedOptions = 2;
|
optional OnBoardLedOptions onBoardLedOptions = 2;
|
||||||
optional AnalogOptions analogOptions = 3;
|
optional AnalogOptions analogOptions = 3;
|
||||||
optional TurboOptions turboOptions = 4;
|
optional TurboOptions turboOptions = 4;
|
||||||
optional SliderOptions deprecatedSliderOptions = 5;
|
optional SliderOptions sliderOptions = 5;
|
||||||
optional ReverseOptions reverseOptions = 6;
|
optional ReverseOptions reverseOptions = 6;
|
||||||
optional AnalogADS1219Options analogADS1219Options = 7;
|
optional AnalogADS1219Options analogADS1219Options = 7;
|
||||||
optional DualDirectionalOptions dualDirectionalOptions = 8;
|
optional DualDirectionalOptions dualDirectionalOptions = 8;
|
||||||
@ -814,9 +753,6 @@ message AddonOptions
|
|||||||
optional XBOnePassthroughOptions xbonePassthroughOptions = 22 [deprecated = true];
|
optional XBOnePassthroughOptions xbonePassthroughOptions = 22 [deprecated = true];
|
||||||
optional AnalogADS1256Options analogADS1256Options = 23;
|
optional AnalogADS1256Options analogADS1256Options = 23;
|
||||||
optional RotaryOptions rotaryOptions = 24;
|
optional RotaryOptions rotaryOptions = 24;
|
||||||
optional PCF8575Options pcf8575Options = 25;
|
|
||||||
optional DRV8833RumbleOptions drv8833RumbleOptions = 26;
|
|
||||||
optional ReactiveLEDOptions reactiveLEDOptions = 27;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message MigrationHistory
|
message MigrationHistory
|
||||||
@ -824,7 +760,6 @@ message MigrationHistory
|
|||||||
optional bool hotkeysMigrated = 1 [default = false];
|
optional bool hotkeysMigrated = 1 [default = false];
|
||||||
optional bool gpioMappingsMigrated = 2 [default = false];
|
optional bool gpioMappingsMigrated = 2 [default = false];
|
||||||
optional bool buttonProfilesMigrated = 3 [default = false];
|
optional bool buttonProfilesMigrated = 3 [default = false];
|
||||||
optional bool profileEnabledFlagsMigrated = 4 [default = false];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message Config
|
message Config
|
||||||
|
259
gp2040ce_bintools/proto_snapshot/config_pb2.py
Normal file
259
gp2040ce_bintools/proto_snapshot/config_pb2.py
Normal file
File diff suppressed because one or more lines are too long
@ -39,7 +39,6 @@ enum ButtonLayout
|
|||||||
BUTTON_LAYOUT_6GAWD_A = 30;
|
BUTTON_LAYOUT_6GAWD_A = 30;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTON_A = 31;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTON_A = 31;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_A = 32;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_A = 32;
|
||||||
BUTTON_LAYOUT_STICKLESS_R16 = 33;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ButtonLayoutRight
|
enum ButtonLayoutRight
|
||||||
@ -83,7 +82,6 @@ enum ButtonLayoutRight
|
|||||||
BUTTON_LAYOUT_6GAWD_B = 34;
|
BUTTON_LAYOUT_6GAWD_B = 34;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTON_B = 35;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTON_B = 35;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_B = 36;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_B = 36;
|
||||||
BUTTON_LAYOUT_STICKLESS_R16B = 37;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SplashMode
|
enum SplashMode
|
||||||
@ -124,7 +122,7 @@ enum InputMode
|
|||||||
|
|
||||||
INPUT_MODE_XINPUT = 0;
|
INPUT_MODE_XINPUT = 0;
|
||||||
INPUT_MODE_SWITCH = 1;
|
INPUT_MODE_SWITCH = 1;
|
||||||
INPUT_MODE_PS3 = 2;
|
INPUT_MODE_HID = 2;
|
||||||
INPUT_MODE_KEYBOARD = 3;
|
INPUT_MODE_KEYBOARD = 3;
|
||||||
INPUT_MODE_PS4 = 4;
|
INPUT_MODE_PS4 = 4;
|
||||||
INPUT_MODE_XBONE = 5;
|
INPUT_MODE_XBONE = 5;
|
||||||
@ -136,7 +134,6 @@ enum InputMode
|
|||||||
INPUT_MODE_PSCLASSIC = 11;
|
INPUT_MODE_PSCLASSIC = 11;
|
||||||
INPUT_MODE_XBOXORIGINAL = 12;
|
INPUT_MODE_XBOXORIGINAL = 12;
|
||||||
INPUT_MODE_PS5 = 13;
|
INPUT_MODE_PS5 = 13;
|
||||||
INPUT_MODE_GENERIC = 14;
|
|
||||||
INPUT_MODE_CONFIG = 255;
|
INPUT_MODE_CONFIG = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,29 +225,6 @@ enum GpioAction
|
|||||||
BUTTON_PRESS_MACRO_4 = 37;
|
BUTTON_PRESS_MACRO_4 = 37;
|
||||||
BUTTON_PRESS_MACRO_5 = 38;
|
BUTTON_PRESS_MACRO_5 = 38;
|
||||||
BUTTON_PRESS_MACRO_6 = 39;
|
BUTTON_PRESS_MACRO_6 = 39;
|
||||||
CUSTOM_BUTTON_COMBO = 40;
|
|
||||||
BUTTON_PRESS_A3 = 41;
|
|
||||||
BUTTON_PRESS_A4 = 42;
|
|
||||||
BUTTON_PRESS_E1 = 43;
|
|
||||||
BUTTON_PRESS_E2 = 44;
|
|
||||||
BUTTON_PRESS_E3 = 45;
|
|
||||||
BUTTON_PRESS_E4 = 46;
|
|
||||||
BUTTON_PRESS_E5 = 47;
|
|
||||||
BUTTON_PRESS_E6 = 48;
|
|
||||||
BUTTON_PRESS_E7 = 49;
|
|
||||||
BUTTON_PRESS_E8 = 50;
|
|
||||||
BUTTON_PRESS_E9 = 51;
|
|
||||||
BUTTON_PRESS_E10 = 52;
|
|
||||||
BUTTON_PRESS_E11 = 53;
|
|
||||||
BUTTON_PRESS_E12 = 54;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum GpioDirection
|
|
||||||
{
|
|
||||||
option (nanopb_enumopt).long_names = false;
|
|
||||||
|
|
||||||
GPIO_DIRECTION_INPUT = 0;
|
|
||||||
GPIO_DIRECTION_OUTPUT = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum GamepadHotkey
|
enum GamepadHotkey
|
||||||
@ -292,14 +266,6 @@ enum GamepadHotkey
|
|||||||
HOTKEY_S2_BUTTON = 32;
|
HOTKEY_S2_BUTTON = 32;
|
||||||
HOTKEY_A1_BUTTON = 33;
|
HOTKEY_A1_BUTTON = 33;
|
||||||
HOTKEY_A2_BUTTON = 34;
|
HOTKEY_A2_BUTTON = 34;
|
||||||
HOTKEY_NEXT_PROFILE = 35;
|
|
||||||
HOTKEY_A3_BUTTON = 36;
|
|
||||||
HOTKEY_A4_BUTTON = 37;
|
|
||||||
HOTKEY_DPAD_UP = 38;
|
|
||||||
HOTKEY_DPAD_DOWN = 39;
|
|
||||||
HOTKEY_DPAD_LEFT = 40;
|
|
||||||
HOTKEY_DPAD_RIGHT = 41;
|
|
||||||
HOTKEY_PREVIOUS_PROFILE = 42;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This has to be kept in sync with LEDFormat in NeoPico.hpp
|
// This has to be kept in sync with LEDFormat in NeoPico.hpp
|
||||||
@ -405,21 +371,3 @@ enum RotaryEncoderPinMode
|
|||||||
ENCODER_MODE_DPAD_X = 7;
|
ENCODER_MODE_DPAD_X = 7;
|
||||||
ENCODER_MODE_DPAD_Y = 8;
|
ENCODER_MODE_DPAD_Y = 8;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ReactiveLEDMode
|
|
||||||
{
|
|
||||||
option (nanopb_enumopt).long_names = false;
|
|
||||||
|
|
||||||
REACTIVE_LED_STATIC_OFF = 0;
|
|
||||||
REACTIVE_LED_STATIC_ON = 1;
|
|
||||||
REACTIVE_LED_FADE_IN = 2;
|
|
||||||
REACTIVE_LED_FADE_OUT = 3;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum PS4ControllerIDMode
|
|
||||||
{
|
|
||||||
option (nanopb_enumopt).long_names = false;
|
|
||||||
|
|
||||||
PS4_ID_CONSOLE = 0;
|
|
||||||
PS4_ID_EMULATION = 1;
|
|
||||||
};
|
|
||||||
|
110
gp2040ce_bintools/proto_snapshot/enums_pb2.py
Normal file
110
gp2040ce_bintools/proto_snapshot/enums_pb2.py
Normal file
File diff suppressed because one or more lines are too long
39
gp2040ce_bintools/proto_snapshot/nanopb_pb2.py
Normal file
39
gp2040ce_bintools/proto_snapshot/nanopb_pb2.py
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
# source: nanopb.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
|
from google.protobuf.internal import builder as _builder
|
||||||
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
|
# @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
|
_sym_db = _symbol_database.Default()
|
||||||
|
|
||||||
|
|
||||||
|
from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
|
||||||
|
|
||||||
|
|
||||||
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cnanopb.proto\x1a google/protobuf/descriptor.proto\"\xc4\x07\n\rNanoPBOptions\x12\x10\n\x08max_size\x18\x01 \x01(\x05\x12\x12\n\nmax_length\x18\x0e \x01(\x05\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12&\n\x08int_size\x18\x07 \x01(\x0e\x32\x08.IntSize:\nIS_DEFAULT\x12$\n\x04type\x18\x03 \x01(\x0e\x32\n.FieldType:\nFT_DEFAULT\x12\x18\n\nlong_names\x18\x04 \x01(\x08:\x04true\x12\x1c\n\rpacked_struct\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0bpacked_enum\x18\n \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0cskip_message\x18\x06 \x01(\x08:\x05\x66\x61lse\x12\x18\n\tno_unions\x18\x08 \x01(\x08:\x05\x66\x61lse\x12\r\n\x05msgid\x18\t \x01(\r\x12\x1e\n\x0f\x61nonymous_oneof\x18\x0b \x01(\x08:\x05\x66\x61lse\x12\x15\n\x06proto3\x18\x0c \x01(\x08:\x05\x66\x61lse\x12#\n\x14proto3_singular_msgs\x18\x15 \x01(\x08:\x05\x66\x61lse\x12\x1d\n\x0e\x65num_to_string\x18\r \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0c\x66ixed_length\x18\x0f \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0b\x66ixed_count\x18\x10 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x0fsubmsg_callback\x18\x16 \x01(\x08:\x05\x66\x61lse\x12/\n\x0cmangle_names\x18\x11 \x01(\x0e\x32\x11.TypenameMangling:\x06M_NONE\x12(\n\x11\x63\x61llback_datatype\x18\x12 \x01(\t:\rpb_callback_t\x12\x34\n\x11\x63\x61llback_function\x18\x13 \x01(\t:\x19pb_default_field_callback\x12\x30\n\x0e\x64\x65scriptorsize\x18\x14 \x01(\x0e\x32\x0f.DescriptorSize:\x07\x44S_AUTO\x12\x1a\n\x0b\x64\x65\x66\x61ult_has\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x0f\n\x07include\x18\x18 \x03(\t\x12\x0f\n\x07\x65xclude\x18\x1a \x03(\t\x12\x0f\n\x07package\x18\x19 \x01(\t\x12\x41\n\rtype_override\x18\x1b \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x19\n\x0bsort_by_tag\x18\x1c \x01(\x08:\x04true\x12.\n\rfallback_type\x18\x1d \x01(\x0e\x32\n.FieldType:\x0b\x46T_CALLBACK\x12\x1e\n\x0f\x64isallow_export\x18\x1e \x01(\x08:\x05\x66\x61lse*i\n\tFieldType\x12\x0e\n\nFT_DEFAULT\x10\x00\x12\x0f\n\x0b\x46T_CALLBACK\x10\x01\x12\x0e\n\nFT_POINTER\x10\x04\x12\r\n\tFT_STATIC\x10\x02\x12\r\n\tFT_IGNORE\x10\x03\x12\r\n\tFT_INLINE\x10\x05*D\n\x07IntSize\x12\x0e\n\nIS_DEFAULT\x10\x00\x12\x08\n\x04IS_8\x10\x08\x12\t\n\x05IS_16\x10\x10\x12\t\n\x05IS_32\x10 \x12\t\n\x05IS_64\x10@*Z\n\x10TypenameMangling\x12\n\n\x06M_NONE\x10\x00\x12\x13\n\x0fM_STRIP_PACKAGE\x10\x01\x12\r\n\tM_FLATTEN\x10\x02\x12\x16\n\x12M_PACKAGE_INITIALS\x10\x03*E\n\x0e\x44\x65scriptorSize\x12\x0b\n\x07\x44S_AUTO\x10\x00\x12\x08\n\x04\x44S_1\x10\x01\x12\x08\n\x04\x44S_2\x10\x02\x12\x08\n\x04\x44S_4\x10\x04\x12\x08\n\x04\x44S_8\x10\x08:E\n\x0enanopb_fileopt\x12\x1c.google.protobuf.FileOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:G\n\rnanopb_msgopt\x12\x1f.google.protobuf.MessageOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:E\n\x0enanopb_enumopt\x12\x1c.google.protobuf.EnumOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:>\n\x06nanopb\x12\x1d.google.protobuf.FieldOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptionsB\x1a\n\x18\x66i.kapsi.koti.jpa.nanopb')
|
||||||
|
|
||||||
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||||
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'nanopb_pb2', globals())
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(nanopb_fileopt)
|
||||||
|
google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(nanopb_msgopt)
|
||||||
|
google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(nanopb_enumopt)
|
||||||
|
google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(nanopb)
|
||||||
|
|
||||||
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\030fi.kapsi.koti.jpa.nanopb'
|
||||||
|
_FIELDTYPE._serialized_start=1017
|
||||||
|
_FIELDTYPE._serialized_end=1122
|
||||||
|
_INTSIZE._serialized_start=1124
|
||||||
|
_INTSIZE._serialized_end=1192
|
||||||
|
_TYPENAMEMANGLING._serialized_start=1194
|
||||||
|
_TYPENAMEMANGLING._serialized_end=1284
|
||||||
|
_DESCRIPTORSIZE._serialized_start=1286
|
||||||
|
_DESCRIPTORSIZE._serialized_end=1355
|
||||||
|
_NANOPBOPTIONS._serialized_start=51
|
||||||
|
_NANOPBOPTIONS._serialized_end=1015
|
||||||
|
# @@protoc_insertion_point(module_scope)
|
@ -17,11 +17,10 @@ from gp2040ce_bintools.rp2040 import get_bootsel_endpoints, read
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
STORAGE_SIZE = 32768
|
BOARD_CONFIG_BINARY_LOCATION = 0x1F8000
|
||||||
|
|
||||||
BOARD_CONFIG_BINARY_LOCATION = (2 * 1024 * 1024) - (STORAGE_SIZE * 2) # 0x1F0000
|
|
||||||
BOARD_CONFIG_BOOTSEL_ADDRESS = 0x10000000 + BOARD_CONFIG_BINARY_LOCATION
|
BOARD_CONFIG_BOOTSEL_ADDRESS = 0x10000000 + BOARD_CONFIG_BINARY_LOCATION
|
||||||
USER_CONFIG_BINARY_LOCATION = (2 * 1024 * 1024) - STORAGE_SIZE # 0x1F8000
|
STORAGE_SIZE = 16384
|
||||||
|
USER_CONFIG_BINARY_LOCATION = 0x1FC000
|
||||||
USER_CONFIG_BOOTSEL_ADDRESS = 0x10000000 + USER_CONFIG_BINARY_LOCATION
|
USER_CONFIG_BOOTSEL_ADDRESS = 0x10000000 + USER_CONFIG_BINARY_LOCATION
|
||||||
|
|
||||||
FOOTER_SIZE = 12
|
FOOTER_SIZE = 12
|
||||||
@ -426,7 +425,7 @@ def visualize():
|
|||||||
group.add_argument('--usb', action='store_true', help="retrieve the config from a RP2040 board connected over USB "
|
group.add_argument('--usb', action='store_true', help="retrieve the config from a RP2040 board connected over USB "
|
||||||
"and in BOOTSEL mode")
|
"and in BOOTSEL mode")
|
||||||
group.add_argument('--filename', help=".bin file of a GP2040-CE board's storage section, bytes "
|
group.add_argument('--filename', help=".bin file of a GP2040-CE board's storage section, bytes "
|
||||||
"101F8000-10200000, or of a GP2040-CE's whole board dump "
|
"101FC000-10200000, or of a GP2040-CE's whole board dump "
|
||||||
"if --whole-board is specified")
|
"if --whole-board is specified")
|
||||||
args, _ = parser.parse_known_args()
|
args, _ = parser.parse_known_args()
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ classifiers = [
|
|||||||
dev = ["bandit", "decorator", "flake8", "flake8-blind-except", "flake8-builtins", "flake8-docstrings",
|
dev = ["bandit", "decorator", "flake8", "flake8-blind-except", "flake8-builtins", "flake8-docstrings",
|
||||||
"flake8-executable", "flake8-fixme", "flake8-isort", "flake8-logging-format", "flake8-mutable",
|
"flake8-executable", "flake8-fixme", "flake8-isort", "flake8-logging-format", "flake8-mutable",
|
||||||
"flake8-pyproject", "mypy", "pip-tools", "pytest", "pytest-asyncio", "pytest-cov", "reuse",
|
"flake8-pyproject", "mypy", "pip-tools", "pytest", "pytest-asyncio", "pytest-cov", "reuse",
|
||||||
"setuptools-scm", "textual-dev", "tox", "twine"]
|
"setuptools-scm", "textual-dev", "tox"]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
concatenate = "gp2040ce_bintools.builder:concatenate"
|
concatenate = "gp2040ce_bintools.builder:concatenate"
|
||||||
@ -74,10 +74,6 @@ ignore_errors = true
|
|||||||
[tool.pytest]
|
[tool.pytest]
|
||||||
python_files = ["*_tests.py", "tests.py", "test_*.py"]
|
python_files = ["*_tests.py", "tests.py", "test_*.py"]
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
|
||||||
log_cli = 0
|
|
||||||
log_cli_level = "WARNING"
|
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
packages = [
|
packages = [
|
||||||
"gp2040ce_bintools",
|
"gp2040ce_bintools",
|
||||||
|
@ -4,22 +4,13 @@
|
|||||||
#
|
#
|
||||||
# pip-compile --extra=dev --output-file=requirements/requirements-dev.txt
|
# pip-compile --extra=dev --output-file=requirements/requirements-dev.txt
|
||||||
#
|
#
|
||||||
aiohappyeyeballs==2.4.4
|
aiohttp==3.9.5
|
||||||
|
# via textual-dev
|
||||||
|
aiosignal==1.3.1
|
||||||
# via aiohttp
|
# via aiohttp
|
||||||
aiohttp==3.11.10
|
attrs==23.2.0
|
||||||
# via
|
|
||||||
# aiohttp-jinja2
|
|
||||||
# textual-dev
|
|
||||||
# textual-serve
|
|
||||||
aiohttp-jinja2==1.6
|
|
||||||
# via textual-serve
|
|
||||||
aiosignal==1.3.2
|
|
||||||
# via aiohttp
|
# via aiohttp
|
||||||
attrs==24.3.0
|
bandit==1.7.8
|
||||||
# via
|
|
||||||
# aiohttp
|
|
||||||
# reuse
|
|
||||||
bandit==1.8.0
|
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
binaryornot==0.4.4
|
binaryornot==0.4.4
|
||||||
# via reuse
|
# via reuse
|
||||||
@ -27,43 +18,32 @@ boolean-py==4.0
|
|||||||
# via
|
# via
|
||||||
# license-expression
|
# license-expression
|
||||||
# reuse
|
# reuse
|
||||||
build==1.2.2.post1
|
build==1.2.1
|
||||||
# via pip-tools
|
# via pip-tools
|
||||||
cachetools==5.5.0
|
cachetools==5.3.3
|
||||||
# via tox
|
# via tox
|
||||||
certifi==2024.12.14
|
|
||||||
# via requests
|
|
||||||
cffi==1.17.1
|
|
||||||
# via cryptography
|
|
||||||
chardet==5.2.0
|
chardet==5.2.0
|
||||||
# via
|
# via
|
||||||
# binaryornot
|
# binaryornot
|
||||||
# python-debian
|
# python-debian
|
||||||
# tox
|
# tox
|
||||||
charset-normalizer==3.4.0
|
|
||||||
# via requests
|
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
# via
|
# via
|
||||||
# pip-tools
|
# pip-tools
|
||||||
# reuse
|
|
||||||
# textual-dev
|
# textual-dev
|
||||||
colorama==0.4.6
|
colorama==0.4.6
|
||||||
# via tox
|
# via tox
|
||||||
coverage[toml]==7.6.9
|
coverage[toml]==7.5.1
|
||||||
# via pytest-cov
|
# via pytest-cov
|
||||||
cryptography==44.0.0
|
|
||||||
# via secretstorage
|
|
||||||
decorator==5.1.1
|
decorator==5.1.1
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
distlib==0.3.9
|
distlib==0.3.8
|
||||||
# via virtualenv
|
# via virtualenv
|
||||||
docutils==0.21.2
|
filelock==3.14.0
|
||||||
# via readme-renderer
|
|
||||||
filelock==3.16.1
|
|
||||||
# via
|
# via
|
||||||
# tox
|
# tox
|
||||||
# virtualenv
|
# virtualenv
|
||||||
flake8==7.1.1
|
flake8==7.0.0
|
||||||
# via
|
# via
|
||||||
# flake8-builtins
|
# flake8-builtins
|
||||||
# flake8-docstrings
|
# flake8-docstrings
|
||||||
@ -84,46 +64,29 @@ flake8-fixme==1.1.1
|
|||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
flake8-isort==6.1.1
|
flake8-isort==6.1.1
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
flake8-logging-format==2024.24.12
|
flake8-logging-format==0.9.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
flake8-mutable==1.2.0
|
flake8-mutable==1.2.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
flake8-pyproject==1.2.3
|
flake8-pyproject==1.2.3
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
frozenlist==1.5.0
|
frozenlist==1.4.1
|
||||||
# via
|
# via
|
||||||
# aiohttp
|
# aiohttp
|
||||||
# aiosignal
|
# aiosignal
|
||||||
grpcio==1.68.1
|
grpcio==1.64.0
|
||||||
# via grpcio-tools
|
# via grpcio-tools
|
||||||
grpcio-tools==1.68.1
|
grpcio-tools==1.64.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
idna==3.10
|
idna==3.7
|
||||||
# via
|
# via yarl
|
||||||
# requests
|
|
||||||
# yarl
|
|
||||||
iniconfig==2.0.0
|
iniconfig==2.0.0
|
||||||
# via pytest
|
# via pytest
|
||||||
isort==5.13.2
|
isort==5.13.2
|
||||||
# via flake8-isort
|
# via flake8-isort
|
||||||
jaraco-classes==3.4.0
|
|
||||||
# via keyring
|
|
||||||
jaraco-context==6.0.1
|
|
||||||
# via keyring
|
|
||||||
jaraco-functools==4.1.0
|
|
||||||
# via keyring
|
|
||||||
jeepney==0.8.0
|
|
||||||
# via
|
|
||||||
# keyring
|
|
||||||
# secretstorage
|
|
||||||
jinja2==3.1.4
|
jinja2==3.1.4
|
||||||
# via
|
# via reuse
|
||||||
# aiohttp-jinja2
|
license-expression==30.3.0
|
||||||
# reuse
|
|
||||||
# textual-serve
|
|
||||||
keyring==25.5.0
|
|
||||||
# via twine
|
|
||||||
license-expression==30.4.0
|
|
||||||
# via reuse
|
# via reuse
|
||||||
linkify-it-py==2.0.3
|
linkify-it-py==2.0.3
|
||||||
# via markdown-it-py
|
# via markdown-it-py
|
||||||
@ -132,149 +95,106 @@ markdown-it-py[linkify,plugins]==3.0.0
|
|||||||
# mdit-py-plugins
|
# mdit-py-plugins
|
||||||
# rich
|
# rich
|
||||||
# textual
|
# textual
|
||||||
markupsafe==3.0.2
|
markupsafe==2.1.5
|
||||||
# via jinja2
|
# via jinja2
|
||||||
mccabe==0.7.0
|
mccabe==0.7.0
|
||||||
# via flake8
|
# via flake8
|
||||||
mdit-py-plugins==0.4.2
|
mdit-py-plugins==0.4.1
|
||||||
# via markdown-it-py
|
# via markdown-it-py
|
||||||
mdurl==0.1.2
|
mdurl==0.1.2
|
||||||
# via markdown-it-py
|
# via markdown-it-py
|
||||||
more-itertools==10.5.0
|
msgpack==1.0.8
|
||||||
# via
|
|
||||||
# jaraco-classes
|
|
||||||
# jaraco-functools
|
|
||||||
msgpack==1.1.0
|
|
||||||
# via textual-dev
|
# via textual-dev
|
||||||
multidict==6.1.0
|
multidict==6.0.5
|
||||||
# via
|
# via
|
||||||
# aiohttp
|
# aiohttp
|
||||||
# yarl
|
# yarl
|
||||||
mypy==1.13.0
|
mypy==1.10.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
mypy-extensions==1.0.0
|
mypy-extensions==1.0.0
|
||||||
# via mypy
|
# via mypy
|
||||||
nh3==0.2.20
|
packaging==24.0
|
||||||
# via readme-renderer
|
|
||||||
packaging==24.2
|
|
||||||
# via
|
# via
|
||||||
# build
|
# build
|
||||||
# pyproject-api
|
# pyproject-api
|
||||||
# pytest
|
# pytest
|
||||||
# setuptools-scm
|
# setuptools-scm
|
||||||
# tox
|
# tox
|
||||||
# twine
|
pbr==6.0.0
|
||||||
pbr==6.1.0
|
|
||||||
# via stevedore
|
# via stevedore
|
||||||
pip-tools==7.4.1
|
pip-tools==7.4.1
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
pkginfo==1.12.0
|
platformdirs==4.2.2
|
||||||
# via twine
|
|
||||||
platformdirs==4.3.6
|
|
||||||
# via
|
# via
|
||||||
# textual
|
|
||||||
# tox
|
# tox
|
||||||
# virtualenv
|
# virtualenv
|
||||||
pluggy==1.5.0
|
pluggy==1.5.0
|
||||||
# via
|
# via
|
||||||
# pytest
|
# pytest
|
||||||
# tox
|
# tox
|
||||||
propcache==0.2.1
|
protobuf==5.26.1
|
||||||
# via
|
|
||||||
# aiohttp
|
|
||||||
# yarl
|
|
||||||
protobuf==5.29.1
|
|
||||||
# via grpcio-tools
|
# via grpcio-tools
|
||||||
pycodestyle==2.12.1
|
pycodestyle==2.11.1
|
||||||
# via flake8
|
# via flake8
|
||||||
pycparser==2.22
|
|
||||||
# via cffi
|
|
||||||
pydocstyle==6.3.0
|
pydocstyle==6.3.0
|
||||||
# via flake8-docstrings
|
# via flake8-docstrings
|
||||||
pyflakes==3.2.0
|
pyflakes==3.2.0
|
||||||
# via flake8
|
# via flake8
|
||||||
pygments==2.18.0
|
pygments==2.18.0
|
||||||
# via
|
# via rich
|
||||||
# readme-renderer
|
pyproject-api==1.6.1
|
||||||
# rich
|
|
||||||
pyproject-api==1.8.0
|
|
||||||
# via tox
|
# via tox
|
||||||
pyproject-hooks==1.2.0
|
pyproject-hooks==1.1.0
|
||||||
# via
|
# via
|
||||||
# build
|
# build
|
||||||
# pip-tools
|
# pip-tools
|
||||||
pytest==8.3.4
|
pytest==8.2.1
|
||||||
# via
|
# via
|
||||||
# gp2040ce-binary-tools (pyproject.toml)
|
# gp2040ce-binary-tools (pyproject.toml)
|
||||||
# pytest-asyncio
|
# pytest-asyncio
|
||||||
# pytest-cov
|
# pytest-cov
|
||||||
pytest-asyncio==0.25.0
|
pytest-asyncio==0.23.7
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
pytest-cov==6.0.0
|
pytest-cov==5.0.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
python-debian==0.1.49
|
python-debian==0.1.49
|
||||||
# via reuse
|
# via reuse
|
||||||
pyusb==1.2.1
|
pyusb==1.2.1
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
pyyaml==6.0.2
|
pyyaml==6.0.1
|
||||||
# via bandit
|
# via bandit
|
||||||
readme-renderer==44.0
|
reuse==3.0.2
|
||||||
# via twine
|
|
||||||
requests==2.32.3
|
|
||||||
# via
|
|
||||||
# requests-toolbelt
|
|
||||||
# twine
|
|
||||||
requests-toolbelt==1.0.0
|
|
||||||
# via twine
|
|
||||||
reuse==5.0.2
|
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
rfc3986==2.0.0
|
rich==13.7.1
|
||||||
# via twine
|
|
||||||
rich==13.9.4
|
|
||||||
# via
|
# via
|
||||||
# bandit
|
# bandit
|
||||||
# textual
|
# textual
|
||||||
# textual-serve
|
|
||||||
# twine
|
|
||||||
secretstorage==3.3.3
|
|
||||||
# via keyring
|
|
||||||
setuptools-scm==8.1.0
|
setuptools-scm==8.1.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
snowballstemmer==2.2.0
|
snowballstemmer==2.2.0
|
||||||
# via pydocstyle
|
# via pydocstyle
|
||||||
stevedore==5.4.0
|
stevedore==5.2.0
|
||||||
# via bandit
|
# via bandit
|
||||||
textual==1.0.0
|
textual==0.62.0
|
||||||
# via
|
# via
|
||||||
# gp2040ce-binary-tools (pyproject.toml)
|
# gp2040ce-binary-tools (pyproject.toml)
|
||||||
# textual-dev
|
# textual-dev
|
||||||
# textual-serve
|
textual-dev==1.5.1
|
||||||
textual-dev==1.7.0
|
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
textual-serve==1.1.1
|
tox==4.15.0
|
||||||
# via textual-dev
|
|
||||||
tomlkit==0.13.2
|
|
||||||
# via reuse
|
|
||||||
tox==4.23.2
|
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
twine==6.0.1
|
typing-extensions==4.11.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
|
||||||
typing-extensions==4.12.2
|
|
||||||
# via
|
# via
|
||||||
# mypy
|
# mypy
|
||||||
# textual
|
# textual
|
||||||
# textual-dev
|
# textual-dev
|
||||||
uc-micro-py==1.0.3
|
uc-micro-py==1.0.3
|
||||||
# via linkify-it-py
|
# via linkify-it-py
|
||||||
urllib3==2.2.3
|
virtualenv==20.26.2
|
||||||
# via
|
|
||||||
# requests
|
|
||||||
# twine
|
|
||||||
virtualenv==20.28.0
|
|
||||||
# via tox
|
# via tox
|
||||||
wheel==0.45.1
|
wheel==0.43.0
|
||||||
# via pip-tools
|
# via pip-tools
|
||||||
yarl==1.18.3
|
yarl==1.9.4
|
||||||
# via aiohttp
|
# via aiohttp
|
||||||
|
|
||||||
# The following packages are considered to be unsafe in a requirements file:
|
# The following packages are considered to be unsafe in a requirements file:
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
#
|
#
|
||||||
# pip-compile --output-file=requirements/requirements.txt
|
# pip-compile --output-file=requirements/requirements.txt
|
||||||
#
|
#
|
||||||
grpcio==1.68.1
|
grpcio==1.64.0
|
||||||
# via grpcio-tools
|
# via grpcio-tools
|
||||||
grpcio-tools==1.68.1
|
grpcio-tools==1.64.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
linkify-it-py==2.0.3
|
linkify-it-py==2.0.3
|
||||||
# via markdown-it-py
|
# via markdown-it-py
|
||||||
@ -15,23 +15,21 @@ markdown-it-py[linkify,plugins]==3.0.0
|
|||||||
# mdit-py-plugins
|
# mdit-py-plugins
|
||||||
# rich
|
# rich
|
||||||
# textual
|
# textual
|
||||||
mdit-py-plugins==0.4.2
|
mdit-py-plugins==0.4.1
|
||||||
# via markdown-it-py
|
# via markdown-it-py
|
||||||
mdurl==0.1.2
|
mdurl==0.1.2
|
||||||
# via markdown-it-py
|
# via markdown-it-py
|
||||||
platformdirs==4.3.6
|
protobuf==5.26.1
|
||||||
# via textual
|
|
||||||
protobuf==5.29.1
|
|
||||||
# via grpcio-tools
|
# via grpcio-tools
|
||||||
pygments==2.18.0
|
pygments==2.18.0
|
||||||
# via rich
|
# via rich
|
||||||
pyusb==1.2.1
|
pyusb==1.2.1
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
rich==13.9.4
|
rich==13.7.1
|
||||||
# via textual
|
# via textual
|
||||||
textual==1.0.0
|
textual==0.62.0
|
||||||
# via gp2040ce-binary-tools (pyproject.toml)
|
# via gp2040ce-binary-tools (pyproject.toml)
|
||||||
typing-extensions==4.12.2
|
typing-extensions==4.11.0
|
||||||
# via textual
|
# via textual
|
||||||
uc-micro-py==1.0.3
|
uc-micro-py==1.0.3
|
||||||
# via linkify-it-py
|
# via linkify-it-py
|
||||||
|
@ -42,7 +42,7 @@ def firmware_binary():
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def storage_dump():
|
def storage_dump():
|
||||||
"""Read in a test storage dump file (101F8000-10200000) of a GP2040-CE board."""
|
"""Read in a test storage dump file (101FC000-10200000) of a GP2040-CE board."""
|
||||||
filename = os.path.join(HERE, 'test-files', 'test-storage-area.bin')
|
filename = os.path.join(HERE, 'test-files', 'test-storage-area.bin')
|
||||||
with open(filename, 'rb') as file:
|
with open(filename, 'rb') as file:
|
||||||
content = file.read()
|
content = file.read()
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,22 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# NO CHECKED-IN PROTOBUF GENCODE
|
|
||||||
# source: nanopb.proto
|
# source: nanopb.proto
|
||||||
# Protobuf Python Version: 5.27.2
|
|
||||||
"""Generated protocol buffer code."""
|
"""Generated protocol buffer code."""
|
||||||
|
from google.protobuf.internal import builder as _builder
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import runtime_version as _runtime_version
|
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
from google.protobuf.internal import builder as _builder
|
|
||||||
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
||||||
_runtime_version.Domain.PUBLIC,
|
|
||||||
5,
|
|
||||||
27,
|
|
||||||
2,
|
|
||||||
'',
|
|
||||||
'nanopb.proto'
|
|
||||||
)
|
|
||||||
# @@protoc_insertion_point(imports)
|
# @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
_sym_db = _symbol_database.Default()
|
_sym_db = _symbol_database.Default()
|
||||||
@ -27,20 +16,24 @@ from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor
|
|||||||
|
|
||||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cnanopb.proto\x1a google/protobuf/descriptor.proto\"\xc4\x07\n\rNanoPBOptions\x12\x10\n\x08max_size\x18\x01 \x01(\x05\x12\x12\n\nmax_length\x18\x0e \x01(\x05\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12&\n\x08int_size\x18\x07 \x01(\x0e\x32\x08.IntSize:\nIS_DEFAULT\x12$\n\x04type\x18\x03 \x01(\x0e\x32\n.FieldType:\nFT_DEFAULT\x12\x18\n\nlong_names\x18\x04 \x01(\x08:\x04true\x12\x1c\n\rpacked_struct\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0bpacked_enum\x18\n \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0cskip_message\x18\x06 \x01(\x08:\x05\x66\x61lse\x12\x18\n\tno_unions\x18\x08 \x01(\x08:\x05\x66\x61lse\x12\r\n\x05msgid\x18\t \x01(\r\x12\x1e\n\x0f\x61nonymous_oneof\x18\x0b \x01(\x08:\x05\x66\x61lse\x12\x15\n\x06proto3\x18\x0c \x01(\x08:\x05\x66\x61lse\x12#\n\x14proto3_singular_msgs\x18\x15 \x01(\x08:\x05\x66\x61lse\x12\x1d\n\x0e\x65num_to_string\x18\r \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0c\x66ixed_length\x18\x0f \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0b\x66ixed_count\x18\x10 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x0fsubmsg_callback\x18\x16 \x01(\x08:\x05\x66\x61lse\x12/\n\x0cmangle_names\x18\x11 \x01(\x0e\x32\x11.TypenameMangling:\x06M_NONE\x12(\n\x11\x63\x61llback_datatype\x18\x12 \x01(\t:\rpb_callback_t\x12\x34\n\x11\x63\x61llback_function\x18\x13 \x01(\t:\x19pb_default_field_callback\x12\x30\n\x0e\x64\x65scriptorsize\x18\x14 \x01(\x0e\x32\x0f.DescriptorSize:\x07\x44S_AUTO\x12\x1a\n\x0b\x64\x65\x66\x61ult_has\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x0f\n\x07include\x18\x18 \x03(\t\x12\x0f\n\x07\x65xclude\x18\x1a \x03(\t\x12\x0f\n\x07package\x18\x19 \x01(\t\x12\x41\n\rtype_override\x18\x1b \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x19\n\x0bsort_by_tag\x18\x1c \x01(\x08:\x04true\x12.\n\rfallback_type\x18\x1d \x01(\x0e\x32\n.FieldType:\x0b\x46T_CALLBACK\x12\x1e\n\x0f\x64isallow_export\x18\x1e \x01(\x08:\x05\x66\x61lse*i\n\tFieldType\x12\x0e\n\nFT_DEFAULT\x10\x00\x12\x0f\n\x0b\x46T_CALLBACK\x10\x01\x12\x0e\n\nFT_POINTER\x10\x04\x12\r\n\tFT_STATIC\x10\x02\x12\r\n\tFT_IGNORE\x10\x03\x12\r\n\tFT_INLINE\x10\x05*D\n\x07IntSize\x12\x0e\n\nIS_DEFAULT\x10\x00\x12\x08\n\x04IS_8\x10\x08\x12\t\n\x05IS_16\x10\x10\x12\t\n\x05IS_32\x10 \x12\t\n\x05IS_64\x10@*Z\n\x10TypenameMangling\x12\n\n\x06M_NONE\x10\x00\x12\x13\n\x0fM_STRIP_PACKAGE\x10\x01\x12\r\n\tM_FLATTEN\x10\x02\x12\x16\n\x12M_PACKAGE_INITIALS\x10\x03*E\n\x0e\x44\x65scriptorSize\x12\x0b\n\x07\x44S_AUTO\x10\x00\x12\x08\n\x04\x44S_1\x10\x01\x12\x08\n\x04\x44S_2\x10\x02\x12\x08\n\x04\x44S_4\x10\x04\x12\x08\n\x04\x44S_8\x10\x08:E\n\x0enanopb_fileopt\x12\x1c.google.protobuf.FileOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:G\n\rnanopb_msgopt\x12\x1f.google.protobuf.MessageOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:E\n\x0enanopb_enumopt\x12\x1c.google.protobuf.EnumOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:>\n\x06nanopb\x12\x1d.google.protobuf.FieldOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptionsB\x1a\n\x18\x66i.kapsi.koti.jpa.nanopb')
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cnanopb.proto\x1a google/protobuf/descriptor.proto\"\xc4\x07\n\rNanoPBOptions\x12\x10\n\x08max_size\x18\x01 \x01(\x05\x12\x12\n\nmax_length\x18\x0e \x01(\x05\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12&\n\x08int_size\x18\x07 \x01(\x0e\x32\x08.IntSize:\nIS_DEFAULT\x12$\n\x04type\x18\x03 \x01(\x0e\x32\n.FieldType:\nFT_DEFAULT\x12\x18\n\nlong_names\x18\x04 \x01(\x08:\x04true\x12\x1c\n\rpacked_struct\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0bpacked_enum\x18\n \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0cskip_message\x18\x06 \x01(\x08:\x05\x66\x61lse\x12\x18\n\tno_unions\x18\x08 \x01(\x08:\x05\x66\x61lse\x12\r\n\x05msgid\x18\t \x01(\r\x12\x1e\n\x0f\x61nonymous_oneof\x18\x0b \x01(\x08:\x05\x66\x61lse\x12\x15\n\x06proto3\x18\x0c \x01(\x08:\x05\x66\x61lse\x12#\n\x14proto3_singular_msgs\x18\x15 \x01(\x08:\x05\x66\x61lse\x12\x1d\n\x0e\x65num_to_string\x18\r \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0c\x66ixed_length\x18\x0f \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0b\x66ixed_count\x18\x10 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x0fsubmsg_callback\x18\x16 \x01(\x08:\x05\x66\x61lse\x12/\n\x0cmangle_names\x18\x11 \x01(\x0e\x32\x11.TypenameMangling:\x06M_NONE\x12(\n\x11\x63\x61llback_datatype\x18\x12 \x01(\t:\rpb_callback_t\x12\x34\n\x11\x63\x61llback_function\x18\x13 \x01(\t:\x19pb_default_field_callback\x12\x30\n\x0e\x64\x65scriptorsize\x18\x14 \x01(\x0e\x32\x0f.DescriptorSize:\x07\x44S_AUTO\x12\x1a\n\x0b\x64\x65\x66\x61ult_has\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x0f\n\x07include\x18\x18 \x03(\t\x12\x0f\n\x07\x65xclude\x18\x1a \x03(\t\x12\x0f\n\x07package\x18\x19 \x01(\t\x12\x41\n\rtype_override\x18\x1b \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x19\n\x0bsort_by_tag\x18\x1c \x01(\x08:\x04true\x12.\n\rfallback_type\x18\x1d \x01(\x0e\x32\n.FieldType:\x0b\x46T_CALLBACK\x12\x1e\n\x0f\x64isallow_export\x18\x1e \x01(\x08:\x05\x66\x61lse*i\n\tFieldType\x12\x0e\n\nFT_DEFAULT\x10\x00\x12\x0f\n\x0b\x46T_CALLBACK\x10\x01\x12\x0e\n\nFT_POINTER\x10\x04\x12\r\n\tFT_STATIC\x10\x02\x12\r\n\tFT_IGNORE\x10\x03\x12\r\n\tFT_INLINE\x10\x05*D\n\x07IntSize\x12\x0e\n\nIS_DEFAULT\x10\x00\x12\x08\n\x04IS_8\x10\x08\x12\t\n\x05IS_16\x10\x10\x12\t\n\x05IS_32\x10 \x12\t\n\x05IS_64\x10@*Z\n\x10TypenameMangling\x12\n\n\x06M_NONE\x10\x00\x12\x13\n\x0fM_STRIP_PACKAGE\x10\x01\x12\r\n\tM_FLATTEN\x10\x02\x12\x16\n\x12M_PACKAGE_INITIALS\x10\x03*E\n\x0e\x44\x65scriptorSize\x12\x0b\n\x07\x44S_AUTO\x10\x00\x12\x08\n\x04\x44S_1\x10\x01\x12\x08\n\x04\x44S_2\x10\x02\x12\x08\n\x04\x44S_4\x10\x04\x12\x08\n\x04\x44S_8\x10\x08:E\n\x0enanopb_fileopt\x12\x1c.google.protobuf.FileOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:G\n\rnanopb_msgopt\x12\x1f.google.protobuf.MessageOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:E\n\x0enanopb_enumopt\x12\x1c.google.protobuf.EnumOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:>\n\x06nanopb\x12\x1d.google.protobuf.FieldOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptionsB\x1a\n\x18\x66i.kapsi.koti.jpa.nanopb')
|
||||||
|
|
||||||
_globals = globals()
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'nanopb_pb2', globals())
|
||||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'nanopb_pb2', _globals)
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
if not _descriptor._USE_C_DESCRIPTORS:
|
google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(nanopb_fileopt)
|
||||||
_globals['DESCRIPTOR']._loaded_options = None
|
google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(nanopb_msgopt)
|
||||||
_globals['DESCRIPTOR']._serialized_options = b'\n\030fi.kapsi.koti.jpa.nanopb'
|
google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(nanopb_enumopt)
|
||||||
_globals['_FIELDTYPE']._serialized_start=1017
|
google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(nanopb)
|
||||||
_globals['_FIELDTYPE']._serialized_end=1122
|
|
||||||
_globals['_INTSIZE']._serialized_start=1124
|
DESCRIPTOR._options = None
|
||||||
_globals['_INTSIZE']._serialized_end=1192
|
DESCRIPTOR._serialized_options = b'\n\030fi.kapsi.koti.jpa.nanopb'
|
||||||
_globals['_TYPENAMEMANGLING']._serialized_start=1194
|
_FIELDTYPE._serialized_start=1017
|
||||||
_globals['_TYPENAMEMANGLING']._serialized_end=1284
|
_FIELDTYPE._serialized_end=1122
|
||||||
_globals['_DESCRIPTORSIZE']._serialized_start=1286
|
_INTSIZE._serialized_start=1124
|
||||||
_globals['_DESCRIPTORSIZE']._serialized_end=1355
|
_INTSIZE._serialized_end=1192
|
||||||
_globals['_NANOPBOPTIONS']._serialized_start=51
|
_TYPENAMEMANGLING._serialized_start=1194
|
||||||
_globals['_NANOPBOPTIONS']._serialized_end=1015
|
_TYPENAMEMANGLING._serialized_end=1284
|
||||||
|
_DESCRIPTORSIZE._serialized_start=1286
|
||||||
|
_DESCRIPTORSIZE._serialized_end=1355
|
||||||
|
_NANOPBOPTIONS._serialized_start=51
|
||||||
|
_NANOPBOPTIONS._serialized_end=1015
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
@ -28,7 +28,6 @@ message GamepadOptions
|
|||||||
optional InputModeAuthType ps4AuthType = 21;
|
optional InputModeAuthType ps4AuthType = 21;
|
||||||
optional InputModeAuthType ps5AuthType = 22;
|
optional InputModeAuthType ps5AuthType = 22;
|
||||||
optional InputModeAuthType xinputAuthType = 23;
|
optional InputModeAuthType xinputAuthType = 23;
|
||||||
optional PS4ControllerIDMode ps4ControllerIDMode = 24;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message KeyboardMapping
|
message KeyboardMapping
|
||||||
@ -51,21 +50,6 @@ message KeyboardMapping
|
|||||||
optional uint32 keyButtonR3 = 16;
|
optional uint32 keyButtonR3 = 16;
|
||||||
optional uint32 keyButtonA1 = 17;
|
optional uint32 keyButtonA1 = 17;
|
||||||
optional uint32 keyButtonA2 = 18;
|
optional uint32 keyButtonA2 = 18;
|
||||||
optional uint32 keyButtonA3 = 19;
|
|
||||||
optional uint32 keyButtonA4 = 20;
|
|
||||||
optional uint32 keyButtonE1 = 21;
|
|
||||||
optional uint32 keyButtonE2 = 22;
|
|
||||||
optional uint32 keyButtonE3 = 23;
|
|
||||||
optional uint32 keyButtonE4 = 24;
|
|
||||||
optional uint32 keyButtonE5 = 25;
|
|
||||||
optional uint32 keyButtonE6 = 26;
|
|
||||||
optional uint32 keyButtonE7 = 27;
|
|
||||||
optional uint32 keyButtonE8 = 28;
|
|
||||||
optional uint32 keyButtonE9 = 29;
|
|
||||||
optional uint32 keyButtonE10 = 30;
|
|
||||||
optional uint32 keyButtonE11 = 31;
|
|
||||||
optional uint32 keyButtonE12 = 32;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message HotkeyEntry
|
message HotkeyEntry
|
||||||
@ -184,16 +168,11 @@ message PinMappings
|
|||||||
message GpioMappingInfo
|
message GpioMappingInfo
|
||||||
{
|
{
|
||||||
optional GpioAction action = 1;
|
optional GpioAction action = 1;
|
||||||
optional GpioDirection direction = 2;
|
|
||||||
optional uint32 customDpadMask = 3;
|
|
||||||
optional uint32 customButtonMask = 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message GpioMappings
|
message GpioMappings
|
||||||
{
|
{
|
||||||
repeated GpioMappingInfo pins = 1 [(nanopb).max_count = 30];
|
repeated GpioMappingInfo pins = 1 [(nanopb).max_count = 30];
|
||||||
optional string profileLabel = 2 [(nanopb).max_length = 16];
|
|
||||||
optional bool enabled = 3 [default = false];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -224,10 +203,10 @@ message DisplayOptions
|
|||||||
{
|
{
|
||||||
optional bool enabled = 1;
|
optional bool enabled = 1;
|
||||||
|
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
optional int32 i2cBlock = 2;
|
||||||
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
||||||
optional int32 deprecatedI2cAddress = 5 [deprecated = true];
|
optional int32 i2cAddress = 5;
|
||||||
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
||||||
|
|
||||||
optional ButtonLayout buttonLayout = 7;
|
optional ButtonLayout buttonLayout = 7;
|
||||||
@ -360,7 +339,7 @@ message AnalogOptions
|
|||||||
optional int32 analogAdc1PinX = 2;
|
optional int32 analogAdc1PinX = 2;
|
||||||
optional int32 analogAdc1PinY = 3;
|
optional int32 analogAdc1PinY = 3;
|
||||||
optional bool forced_circularity = 4;
|
optional bool forced_circularity = 4;
|
||||||
optional uint32 inner_deadzone = 5;
|
optional uint32 analog_deadzone = 5;
|
||||||
optional int32 analogAdc2PinX = 6;
|
optional int32 analogAdc2PinX = 6;
|
||||||
optional int32 analogAdc2PinY = 7;
|
optional int32 analogAdc2PinY = 7;
|
||||||
optional DpadMode analogAdc1Mode = 8;
|
optional DpadMode analogAdc1Mode = 8;
|
||||||
@ -368,10 +347,6 @@ message AnalogOptions
|
|||||||
optional InvertMode analogAdc1Invert = 10;
|
optional InvertMode analogAdc1Invert = 10;
|
||||||
optional InvertMode analogAdc2Invert = 11;
|
optional InvertMode analogAdc2Invert = 11;
|
||||||
optional bool auto_calibrate = 12;
|
optional bool auto_calibrate = 12;
|
||||||
optional uint32 outer_deadzone = 13;
|
|
||||||
optional bool analog_smoothing = 14;
|
|
||||||
optional float smoothing_factor = 15;
|
|
||||||
optional uint32 analog_error = 16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message TurboOptions
|
message TurboOptions
|
||||||
@ -407,7 +382,7 @@ message SliderOptions
|
|||||||
optional int32 deprecatedPinSliderTwo = 3 [deprecated = true];
|
optional int32 deprecatedPinSliderTwo = 3 [deprecated = true];
|
||||||
optional DpadMode deprecatedModeOne = 4 [deprecated = true];
|
optional DpadMode deprecatedModeOne = 4 [deprecated = true];
|
||||||
optional DpadMode deprecatedModeTwo = 5 [deprecated = true];
|
optional DpadMode deprecatedModeTwo = 5 [deprecated = true];
|
||||||
optional DpadMode deprecatedModeDefault = 6;
|
optional DpadMode modeDefault = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SOCDSliderOptions
|
message SOCDSliderOptions
|
||||||
@ -439,10 +414,10 @@ message AnalogADS1219Options
|
|||||||
{
|
{
|
||||||
optional bool enabled = 1;
|
optional bool enabled = 1;
|
||||||
|
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
optional int32 i2cBlock = 2;
|
||||||
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
||||||
optional int32 deprecatedI2cAddress = 5 [deprecated = true];
|
optional int32 i2cAddress = 5;
|
||||||
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
optional int32 deprecatedI2cSpeed = 6 [deprecated = true];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,7 +636,7 @@ message WiiOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
optional bool enabled = 1;
|
optional bool enabled = 1;
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
optional int32 i2cBlock = 2;
|
||||||
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
|
||||||
optional int32 deprecatedI2cSpeed = 5 [deprecated = true];
|
optional int32 deprecatedI2cSpeed = 5 [deprecated = true];
|
||||||
@ -683,9 +658,6 @@ message KeyboardHostOptions
|
|||||||
optional int32 deprecatedPinDplus = 2 [deprecated = true];
|
optional int32 deprecatedPinDplus = 2 [deprecated = true];
|
||||||
optional KeyboardMapping mapping = 3;
|
optional KeyboardMapping mapping = 3;
|
||||||
optional int32 deprecatedPin5V = 4 [deprecated = true];
|
optional int32 deprecatedPin5V = 4 [deprecated = true];
|
||||||
optional uint32 mouseLeft = 5;
|
|
||||||
optional uint32 mouseMiddle = 6;
|
|
||||||
optional uint32 mouseRight = 7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message FocusModeOptions
|
message FocusModeOptions
|
||||||
@ -755,46 +727,13 @@ message RotaryOptions
|
|||||||
optional RotaryPinOptions encoderTwo = 3;
|
optional RotaryPinOptions encoderTwo = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PCF8575Options
|
|
||||||
{
|
|
||||||
optional bool enabled = 1;
|
|
||||||
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
|
|
||||||
repeated GpioMappingInfo pins = 3 [(nanopb).max_count = 16];
|
|
||||||
}
|
|
||||||
|
|
||||||
message DRV8833RumbleOptions
|
|
||||||
{
|
|
||||||
optional bool enabled = 1;
|
|
||||||
|
|
||||||
optional int32 leftMotorPin = 2;
|
|
||||||
optional int32 rightMotorPin = 3;
|
|
||||||
optional int32 motorSleepPin = 4;
|
|
||||||
optional uint32 pwmFrequency = 5;
|
|
||||||
optional float dutyMin = 6;
|
|
||||||
optional float dutyMax = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReactiveLEDInfo
|
|
||||||
{
|
|
||||||
optional int32 pin = 1;
|
|
||||||
optional GpioAction action = 2;
|
|
||||||
optional ReactiveLEDMode modeDown = 3;
|
|
||||||
optional ReactiveLEDMode modeUp = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ReactiveLEDOptions
|
|
||||||
{
|
|
||||||
optional bool enabled = 1;
|
|
||||||
repeated ReactiveLEDInfo leds = 2 [(nanopb).max_count = 10];
|
|
||||||
}
|
|
||||||
|
|
||||||
message AddonOptions
|
message AddonOptions
|
||||||
{
|
{
|
||||||
optional BootselButtonOptions bootselButtonOptions = 1;
|
optional BootselButtonOptions bootselButtonOptions = 1;
|
||||||
optional OnBoardLedOptions onBoardLedOptions = 2;
|
optional OnBoardLedOptions onBoardLedOptions = 2;
|
||||||
optional AnalogOptions analogOptions = 3;
|
optional AnalogOptions analogOptions = 3;
|
||||||
optional TurboOptions turboOptions = 4;
|
optional TurboOptions turboOptions = 4;
|
||||||
optional SliderOptions deprecatedSliderOptions = 5;
|
optional SliderOptions sliderOptions = 5;
|
||||||
optional ReverseOptions reverseOptions = 6;
|
optional ReverseOptions reverseOptions = 6;
|
||||||
optional AnalogADS1219Options analogADS1219Options = 7;
|
optional AnalogADS1219Options analogADS1219Options = 7;
|
||||||
optional DualDirectionalOptions dualDirectionalOptions = 8;
|
optional DualDirectionalOptions dualDirectionalOptions = 8;
|
||||||
@ -814,9 +753,6 @@ message AddonOptions
|
|||||||
optional XBOnePassthroughOptions xbonePassthroughOptions = 22 [deprecated = true];
|
optional XBOnePassthroughOptions xbonePassthroughOptions = 22 [deprecated = true];
|
||||||
optional AnalogADS1256Options analogADS1256Options = 23;
|
optional AnalogADS1256Options analogADS1256Options = 23;
|
||||||
optional RotaryOptions rotaryOptions = 24;
|
optional RotaryOptions rotaryOptions = 24;
|
||||||
optional PCF8575Options pcf8575Options = 25;
|
|
||||||
optional DRV8833RumbleOptions drv8833RumbleOptions = 26;
|
|
||||||
optional ReactiveLEDOptions reactiveLEDOptions = 27;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message MigrationHistory
|
message MigrationHistory
|
||||||
@ -824,7 +760,6 @@ message MigrationHistory
|
|||||||
optional bool hotkeysMigrated = 1 [default = false];
|
optional bool hotkeysMigrated = 1 [default = false];
|
||||||
optional bool gpioMappingsMigrated = 2 [default = false];
|
optional bool gpioMappingsMigrated = 2 [default = false];
|
||||||
optional bool buttonProfilesMigrated = 3 [default = false];
|
optional bool buttonProfilesMigrated = 3 [default = false];
|
||||||
optional bool profileEnabledFlagsMigrated = 4 [default = false];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message Config
|
message Config
|
||||||
|
@ -39,7 +39,6 @@ enum ButtonLayout
|
|||||||
BUTTON_LAYOUT_6GAWD_A = 30;
|
BUTTON_LAYOUT_6GAWD_A = 30;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTON_A = 31;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTON_A = 31;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_A = 32;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_A = 32;
|
||||||
BUTTON_LAYOUT_STICKLESS_R16 = 33;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ButtonLayoutRight
|
enum ButtonLayoutRight
|
||||||
@ -83,7 +82,6 @@ enum ButtonLayoutRight
|
|||||||
BUTTON_LAYOUT_6GAWD_B = 34;
|
BUTTON_LAYOUT_6GAWD_B = 34;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTON_B = 35;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTON_B = 35;
|
||||||
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_B = 36;
|
BUTTON_LAYOUT_6GAWD_ALLBUTTONPLUS_B = 36;
|
||||||
BUTTON_LAYOUT_STICKLESS_R16B = 37;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SplashMode
|
enum SplashMode
|
||||||
@ -124,7 +122,7 @@ enum InputMode
|
|||||||
|
|
||||||
INPUT_MODE_XINPUT = 0;
|
INPUT_MODE_XINPUT = 0;
|
||||||
INPUT_MODE_SWITCH = 1;
|
INPUT_MODE_SWITCH = 1;
|
||||||
INPUT_MODE_PS3 = 2;
|
INPUT_MODE_HID = 2;
|
||||||
INPUT_MODE_KEYBOARD = 3;
|
INPUT_MODE_KEYBOARD = 3;
|
||||||
INPUT_MODE_PS4 = 4;
|
INPUT_MODE_PS4 = 4;
|
||||||
INPUT_MODE_XBONE = 5;
|
INPUT_MODE_XBONE = 5;
|
||||||
@ -136,7 +134,6 @@ enum InputMode
|
|||||||
INPUT_MODE_PSCLASSIC = 11;
|
INPUT_MODE_PSCLASSIC = 11;
|
||||||
INPUT_MODE_XBOXORIGINAL = 12;
|
INPUT_MODE_XBOXORIGINAL = 12;
|
||||||
INPUT_MODE_PS5 = 13;
|
INPUT_MODE_PS5 = 13;
|
||||||
INPUT_MODE_GENERIC = 14;
|
|
||||||
INPUT_MODE_CONFIG = 255;
|
INPUT_MODE_CONFIG = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,29 +225,6 @@ enum GpioAction
|
|||||||
BUTTON_PRESS_MACRO_4 = 37;
|
BUTTON_PRESS_MACRO_4 = 37;
|
||||||
BUTTON_PRESS_MACRO_5 = 38;
|
BUTTON_PRESS_MACRO_5 = 38;
|
||||||
BUTTON_PRESS_MACRO_6 = 39;
|
BUTTON_PRESS_MACRO_6 = 39;
|
||||||
CUSTOM_BUTTON_COMBO = 40;
|
|
||||||
BUTTON_PRESS_A3 = 41;
|
|
||||||
BUTTON_PRESS_A4 = 42;
|
|
||||||
BUTTON_PRESS_E1 = 43;
|
|
||||||
BUTTON_PRESS_E2 = 44;
|
|
||||||
BUTTON_PRESS_E3 = 45;
|
|
||||||
BUTTON_PRESS_E4 = 46;
|
|
||||||
BUTTON_PRESS_E5 = 47;
|
|
||||||
BUTTON_PRESS_E6 = 48;
|
|
||||||
BUTTON_PRESS_E7 = 49;
|
|
||||||
BUTTON_PRESS_E8 = 50;
|
|
||||||
BUTTON_PRESS_E9 = 51;
|
|
||||||
BUTTON_PRESS_E10 = 52;
|
|
||||||
BUTTON_PRESS_E11 = 53;
|
|
||||||
BUTTON_PRESS_E12 = 54;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum GpioDirection
|
|
||||||
{
|
|
||||||
option (nanopb_enumopt).long_names = false;
|
|
||||||
|
|
||||||
GPIO_DIRECTION_INPUT = 0;
|
|
||||||
GPIO_DIRECTION_OUTPUT = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum GamepadHotkey
|
enum GamepadHotkey
|
||||||
@ -292,14 +266,6 @@ enum GamepadHotkey
|
|||||||
HOTKEY_S2_BUTTON = 32;
|
HOTKEY_S2_BUTTON = 32;
|
||||||
HOTKEY_A1_BUTTON = 33;
|
HOTKEY_A1_BUTTON = 33;
|
||||||
HOTKEY_A2_BUTTON = 34;
|
HOTKEY_A2_BUTTON = 34;
|
||||||
HOTKEY_NEXT_PROFILE = 35;
|
|
||||||
HOTKEY_A3_BUTTON = 36;
|
|
||||||
HOTKEY_A4_BUTTON = 37;
|
|
||||||
HOTKEY_DPAD_UP = 38;
|
|
||||||
HOTKEY_DPAD_DOWN = 39;
|
|
||||||
HOTKEY_DPAD_LEFT = 40;
|
|
||||||
HOTKEY_DPAD_RIGHT = 41;
|
|
||||||
HOTKEY_PREVIOUS_PROFILE = 42;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This has to be kept in sync with LEDFormat in NeoPico.hpp
|
// This has to be kept in sync with LEDFormat in NeoPico.hpp
|
||||||
@ -405,21 +371,3 @@ enum RotaryEncoderPinMode
|
|||||||
ENCODER_MODE_DPAD_X = 7;
|
ENCODER_MODE_DPAD_X = 7;
|
||||||
ENCODER_MODE_DPAD_Y = 8;
|
ENCODER_MODE_DPAD_Y = 8;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ReactiveLEDMode
|
|
||||||
{
|
|
||||||
option (nanopb_enumopt).long_names = false;
|
|
||||||
|
|
||||||
REACTIVE_LED_STATIC_OFF = 0;
|
|
||||||
REACTIVE_LED_STATIC_ON = 1;
|
|
||||||
REACTIVE_LED_FADE_IN = 2;
|
|
||||||
REACTIVE_LED_FADE_OUT = 3;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum PS4ControllerIDMode
|
|
||||||
{
|
|
||||||
option (nanopb_enumopt).long_names = false;
|
|
||||||
|
|
||||||
PS4_ID_CONSOLE = 0;
|
|
||||||
PS4_ID_EMULATION = 1;
|
|
||||||
};
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"boardVersion": "v0.7.6-15-g71f4512",
|
"boardVersion": "v0.7.6-15-g71f4512",
|
||||||
"gamepadOptions": {
|
"gamepadOptions": {
|
||||||
"inputMode": "INPUT_MODE_PS3",
|
"inputMode": "INPUT_MODE_HID",
|
||||||
"dpadMode": "DPAD_MODE_DIGITAL",
|
"dpadMode": "DPAD_MODE_DIGITAL",
|
||||||
"socdMode": "SOCD_MODE_SECOND_INPUT_PRIORITY",
|
"socdMode": "SOCD_MODE_SECOND_INPUT_PRIORITY",
|
||||||
"invertXAxis": false,
|
"invertXAxis": false,
|
||||||
@ -163,10 +163,10 @@
|
|||||||
},
|
},
|
||||||
"displayOptions": {
|
"displayOptions": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"deprecatedI2cBlock": 0,
|
"i2cBlock": 0,
|
||||||
"deprecatedI2cSDAPin": 0,
|
"deprecatedI2cSDAPin": 0,
|
||||||
"deprecatedI2cSCLPin": 1,
|
"deprecatedI2cSCLPin": 1,
|
||||||
"deprecatedI2cAddress": 60,
|
"i2cAddress": 60,
|
||||||
"deprecatedI2cSpeed": 400000,
|
"deprecatedI2cSpeed": 400000,
|
||||||
"buttonLayout": "BUTTON_LAYOUT_STICK",
|
"buttonLayout": "BUTTON_LAYOUT_STICK",
|
||||||
"buttonLayoutRight": "BUTTON_LAYOUT_VEWLIX",
|
"buttonLayoutRight": "BUTTON_LAYOUT_VEWLIX",
|
||||||
@ -297,7 +297,7 @@
|
|||||||
"analogAdc1PinX": -1,
|
"analogAdc1PinX": -1,
|
||||||
"analogAdc1PinY": -1,
|
"analogAdc1PinY": -1,
|
||||||
"forcedCircularity": false,
|
"forcedCircularity": false,
|
||||||
"innerDeadzone": 5,
|
"analogDeadzone": 5,
|
||||||
"analogAdc2PinX": -1,
|
"analogAdc2PinX": -1,
|
||||||
"analogAdc2PinY": -1,
|
"analogAdc2PinY": -1,
|
||||||
"analogAdc1Mode": "DPAD_MODE_LEFT_ANALOG",
|
"analogAdc1Mode": "DPAD_MODE_LEFT_ANALOG",
|
||||||
@ -327,13 +327,13 @@
|
|||||||
"shmupBtnMask4": 0,
|
"shmupBtnMask4": 0,
|
||||||
"shmupMixMode": "SHMUP_MIX_MODE_TURBO_PRIORITY"
|
"shmupMixMode": "SHMUP_MIX_MODE_TURBO_PRIORITY"
|
||||||
},
|
},
|
||||||
"deprecatedSliderOptions": {
|
"sliderOptions": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"deprecatedPinSliderOne": 0,
|
"deprecatedPinSliderOne": 0,
|
||||||
"deprecatedPinSliderTwo": 0,
|
"deprecatedPinSliderTwo": 0,
|
||||||
"deprecatedModeOne": "DPAD_MODE_DIGITAL",
|
"deprecatedModeOne": "DPAD_MODE_DIGITAL",
|
||||||
"deprecatedModeTwo": "DPAD_MODE_DIGITAL",
|
"deprecatedModeTwo": "DPAD_MODE_DIGITAL",
|
||||||
"deprecatedModeDefault": "DPAD_MODE_DIGITAL"
|
"modeDefault": "DPAD_MODE_DIGITAL"
|
||||||
},
|
},
|
||||||
"reverseOptions": {
|
"reverseOptions": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
@ -346,10 +346,10 @@
|
|||||||
},
|
},
|
||||||
"analogADS1219Options": {
|
"analogADS1219Options": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"deprecatedI2cBlock": 0,
|
"i2cBlock": 0,
|
||||||
"deprecatedI2cSDAPin": -1,
|
"deprecatedI2cSDAPin": -1,
|
||||||
"deprecatedI2cSCLPin": -1,
|
"deprecatedI2cSCLPin": -1,
|
||||||
"deprecatedI2cAddress": 64,
|
"i2cAddress": 64,
|
||||||
"deprecatedI2cSpeed": 400000
|
"deprecatedI2cSpeed": 400000
|
||||||
},
|
},
|
||||||
"dualDirectionalOptions": {
|
"dualDirectionalOptions": {
|
||||||
@ -392,7 +392,7 @@
|
|||||||
},
|
},
|
||||||
"wiiOptions": {
|
"wiiOptions": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"deprecatedI2cBlock": 0,
|
"i2cBlock": 0,
|
||||||
"deprecatedI2cSDAPin": -1,
|
"deprecatedI2cSDAPin": -1,
|
||||||
"deprecatedI2cSCLPin": -1,
|
"deprecatedI2cSCLPin": -1,
|
||||||
"deprecatedI2cSpeed": 400000,
|
"deprecatedI2cSpeed": 400000,
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -32,8 +32,6 @@ def with_pb2s(test, *args, **kwargs):
|
|||||||
|
|
||||||
sys.path.pop()
|
sys.path.pop()
|
||||||
del sys.modules['config_pb2']
|
del sys.modules['config_pb2']
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
def test_concatenate_to_file(tmp_path):
|
def test_concatenate_to_file(tmp_path):
|
||||||
@ -57,7 +55,7 @@ def test_concatenate_board_config_to_file(tmp_path):
|
|||||||
combined_filename=tmp_file)
|
combined_filename=tmp_file)
|
||||||
with open(tmp_file, 'rb') as file:
|
with open(tmp_file, 'rb') as file:
|
||||||
content = file.read()
|
content = file.read()
|
||||||
assert len(content) == (2 * 1024 * 1024) - (32 * 1024)
|
assert len(content) == (2 * 1024 * 1024) - (16 * 1024)
|
||||||
|
|
||||||
|
|
||||||
def test_concatenate_both_configs_to_file(tmp_path):
|
def test_concatenate_both_configs_to_file(tmp_path):
|
||||||
@ -180,19 +178,19 @@ def test_dont_always_find_version_string(firmware_binary):
|
|||||||
def test_padding_firmware(firmware_binary):
|
def test_padding_firmware(firmware_binary):
|
||||||
"""Test that firmware is padded to the expected size."""
|
"""Test that firmware is padded to the expected size."""
|
||||||
padded = builder.pad_binary_up_to_user_config(firmware_binary)
|
padded = builder.pad_binary_up_to_user_config(firmware_binary)
|
||||||
assert len(padded) == 2064384
|
assert len(padded) == 2080768
|
||||||
|
|
||||||
|
|
||||||
def test_padding_firmware_can_truncate():
|
def test_padding_firmware_can_truncate():
|
||||||
"""Test that firmware is padded to the expected size."""
|
"""Test that firmware is padded to the expected size."""
|
||||||
padded = builder.pad_binary_up_to_user_config(bytearray(b'\x00' * 4 * 1024 * 1024), or_truncate=True)
|
padded = builder.pad_binary_up_to_user_config(bytearray(b'\x00' * 4 * 1024 * 1024), or_truncate=True)
|
||||||
assert len(padded) == 2064384
|
assert len(padded) == 2080768
|
||||||
|
|
||||||
|
|
||||||
def test_padding_firmware_to_board(firmware_binary):
|
def test_padding_firmware_to_board(firmware_binary):
|
||||||
"""Test that firmware is padded to the expected size."""
|
"""Test that firmware is padded to the expected size."""
|
||||||
padded = builder.pad_binary_up_to_board_config(firmware_binary)
|
padded = builder.pad_binary_up_to_board_config(firmware_binary)
|
||||||
assert len(padded) == 2064384 - (32 * 1024)
|
assert len(padded) == 2080768 - (16 * 1024)
|
||||||
|
|
||||||
|
|
||||||
def test_firmware_plus_storage_section(firmware_binary, storage_dump):
|
def test_firmware_plus_storage_section(firmware_binary, storage_dump):
|
||||||
@ -226,7 +224,7 @@ def test_chunky_firmware_plus_user_config_binary(config_binary):
|
|||||||
def test_firmware_plus_board_config_binary(firmware_binary, config_binary):
|
def test_firmware_plus_board_config_binary(firmware_binary, config_binary):
|
||||||
"""Test that combining firmware and board config produces a valid combined binary."""
|
"""Test that combining firmware and board config produces a valid combined binary."""
|
||||||
almost_whole_board = builder.combine_firmware_and_config(firmware_binary, config_binary, None)
|
almost_whole_board = builder.combine_firmware_and_config(firmware_binary, config_binary, None)
|
||||||
assert len(almost_whole_board) == (2 * 1024 * 1024) - (32 * 1024)
|
assert len(almost_whole_board) == (2 * 1024 * 1024) - (16 * 1024)
|
||||||
# if this is valid, we should be able to find the storage and footer again
|
# if this is valid, we should be able to find the storage and footer again
|
||||||
storage = get_board_storage_section(almost_whole_board)
|
storage = get_board_storage_section(almost_whole_board)
|
||||||
footer_size, _, _ = get_config_footer(storage)
|
footer_size, _, _ = get_config_footer(storage)
|
||||||
|
@ -25,8 +25,6 @@ def with_pb2s(test, *args, **kwargs):
|
|||||||
|
|
||||||
sys.path.pop()
|
sys.path.pop()
|
||||||
del sys.modules['config_pb2']
|
del sys.modules['config_pb2']
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
def test_version_flag():
|
def test_version_flag():
|
||||||
@ -51,7 +49,7 @@ def test_concatenate_invocation(tmpdir):
|
|||||||
with open(out_filename, 'rb') as out_file, open('tests/test-files/test-storage-area.bin', 'rb') as storage_file:
|
with open(out_filename, 'rb') as out_file, open('tests/test-files/test-storage-area.bin', 'rb') as storage_file:
|
||||||
out = out_file.read()
|
out = out_file.read()
|
||||||
storage = storage_file.read()
|
storage = storage_file.read()
|
||||||
assert out[2064384:2097152] == storage
|
assert out[2080768:2097152] == storage
|
||||||
|
|
||||||
|
|
||||||
def test_concatenate_invocation_json(tmpdir):
|
def test_concatenate_invocation_json(tmpdir):
|
||||||
@ -88,7 +86,7 @@ def test_debug_storage_dump_invocation():
|
|||||||
'--filename', 'tests/test-files/test-storage-area.bin'],
|
'--filename', 'tests/test-files/test-storage-area.bin'],
|
||||||
capture_output=True, encoding='utf8')
|
capture_output=True, encoding='utf8')
|
||||||
assert 'boardVersion: "v0.7.5"' in result.stdout
|
assert 'boardVersion: "v0.7.5"' in result.stdout
|
||||||
assert 'length of content to look for footer in: 32768' in result.stderr
|
assert 'length of content to look for footer in: 16384' in result.stderr
|
||||||
|
|
||||||
|
|
||||||
def test_storage_dump_json_invocation():
|
def test_storage_dump_json_invocation():
|
||||||
|
@ -28,8 +28,6 @@ async def with_pb2s(test, *args, **kwargs):
|
|||||||
|
|
||||||
sys.path.pop()
|
sys.path.pop()
|
||||||
del sys.modules['config_pb2']
|
del sys.modules['config_pb2']
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
@ -111,7 +109,7 @@ async def test_simple_edit_via_input_field():
|
|||||||
async with app.run_test() as pilot:
|
async with app.run_test() as pilot:
|
||||||
tree = pilot.app.query_one(Tree)
|
tree = pilot.app.query_one(Tree)
|
||||||
display_node = tree.root.children[5]
|
display_node = tree.root.children[5]
|
||||||
i2cspeed_node = display_node.children[6]
|
i2cspeed_node = display_node.children[4]
|
||||||
assert pilot.app.config.displayOptions.deprecatedI2cSpeed == 400000
|
assert pilot.app.config.displayOptions.deprecatedI2cSpeed == 400000
|
||||||
|
|
||||||
tree.root.expand_all()
|
tree.root.expand_all()
|
||||||
@ -121,7 +119,7 @@ async def test_simple_edit_via_input_field():
|
|||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.click('Input#field-input')
|
await pilot.click('Input#field-input')
|
||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.press('end', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
|
await pilot.press('backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
|
||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.click('Button#confirm-button')
|
await pilot.click('Button#confirm-button')
|
||||||
assert pilot.app.config.displayOptions.deprecatedI2cSpeed == 5
|
assert pilot.app.config.displayOptions.deprecatedI2cSpeed == 5
|
||||||
@ -201,7 +199,7 @@ async def test_simple_edit_via_input_field_string():
|
|||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.click('Input#field-input')
|
await pilot.click('Input#field-input')
|
||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.press('end', 'backspace', '-', 'h', 'i')
|
await pilot.press('backspace', '-', 'h', 'i')
|
||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.click('Button#confirm-button')
|
await pilot.click('Button#confirm-button')
|
||||||
assert pilot.app.config.boardVersion == 'v0.7.-hi'
|
assert pilot.app.config.boardVersion == 'v0.7.-hi'
|
||||||
@ -231,7 +229,7 @@ async def test_add_node_to_repeated():
|
|||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.click('Input#field-input')
|
await pilot.click('Input#field-input')
|
||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.press('end', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
|
await pilot.press('backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
|
||||||
await pilot.wait_for_scheduled_animations()
|
await pilot.wait_for_scheduled_animations()
|
||||||
await pilot.click('Button#confirm-button')
|
await pilot.click('Button#confirm-button')
|
||||||
|
|
||||||
@ -277,4 +275,4 @@ async def test_save_as(config_binary, tmp_path):
|
|||||||
with open('/tmp/gptest', 'rb') as new_file:
|
with open('/tmp/gptest', 'rb') as new_file:
|
||||||
test_config_binary = new_file.read()
|
test_config_binary = new_file.read()
|
||||||
test_config = get_config(test_config_binary)
|
test_config = get_config(test_config_binary)
|
||||||
assert original_config.boardVersion == test_config.boardVersion
|
assert original_config == test_config
|
||||||
|
@ -6,69 +6,43 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import pytest
|
|
||||||
from decorator import decorator
|
|
||||||
|
|
||||||
from gp2040ce_bintools import get_config_pb2
|
from gp2040ce_bintools import get_config_pb2
|
||||||
|
|
||||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
|
||||||
@decorator
|
def test_get_config_pb2_compile():
|
||||||
def with_pb2s(test, *args, **kwargs):
|
"""Without any precompiled files on the path, test we can read proto files and compile them."""
|
||||||
"""Wrap a test with precompiled pb2 files on the path."""
|
# append to path as -P would
|
||||||
proto_path = os.path.join(HERE, 'test-files', 'pb2-files')
|
|
||||||
sys.path.append(proto_path)
|
|
||||||
|
|
||||||
test(*args, **kwargs)
|
|
||||||
|
|
||||||
sys.path.pop()
|
|
||||||
del sys.modules['config_pb2']
|
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
@decorator
|
|
||||||
def with_protos(test, *args, **kwargs):
|
|
||||||
"""Wrap a test with .proto files on the path."""
|
|
||||||
proto_path = os.path.join(HERE, 'test-files', 'proto-files')
|
proto_path = os.path.join(HERE, 'test-files', 'proto-files')
|
||||||
sys.path.append(proto_path)
|
sys.path.append(proto_path)
|
||||||
|
|
||||||
test(*args, **kwargs)
|
|
||||||
|
|
||||||
sys.path.pop()
|
|
||||||
del sys.modules['config_pb2']
|
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
@with_pb2s
|
|
||||||
def test_get_config_pb2_precompiled():
|
|
||||||
"""With precompiled files on the path, test we can read and use them."""
|
|
||||||
# get the module from the provided files
|
|
||||||
config_pb2 = get_config_pb2()
|
|
||||||
_ = config_pb2.Config()
|
|
||||||
|
|
||||||
|
|
||||||
def test_get_config_pb2_exception():
|
|
||||||
"""Test that we fail if no config .proto files are available."""
|
|
||||||
with pytest.raises(RuntimeError):
|
|
||||||
_ = get_config_pb2()
|
|
||||||
|
|
||||||
|
|
||||||
def test_get_config_pb2_shipped_config_files():
|
|
||||||
"""Without any precompiled files or proto files on the path, test we DO NOT raise an exception."""
|
|
||||||
# use the shipped .proto files to generate the config
|
|
||||||
config_pb2 = get_config_pb2(with_fallback=True)
|
|
||||||
_ = config_pb2.Config()
|
|
||||||
del sys.modules['config_pb2']
|
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
@with_protos
|
|
||||||
def test_get_config_pb2_compile():
|
|
||||||
"""Without any precompiled files on the path, test we can read proto files and compile them."""
|
|
||||||
# let grpc tools compile the proto files on demand and give us the module
|
# let grpc tools compile the proto files on demand and give us the module
|
||||||
config_pb2 = get_config_pb2()
|
config_pb2 = get_config_pb2()
|
||||||
_ = config_pb2.Config()
|
_ = config_pb2.Config()
|
||||||
|
|
||||||
|
# clean up the path and unload config_pb2
|
||||||
|
sys.path.pop()
|
||||||
|
sys.path.pop()
|
||||||
|
del sys.modules['config_pb2']
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_config_pb2_exception():
|
||||||
|
"""Without any precompiled files or proto files on the path, test we DO NOT raise an exception."""
|
||||||
|
# this used to raise ModuleNotFoundError, but with our snapshot included now,
|
||||||
|
# we should always have a config to import
|
||||||
|
_ = get_config_pb2()
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_config_pb2_precompile():
|
||||||
|
"""Test we can import precompiled protobuf files."""
|
||||||
|
proto_path = os.path.join(HERE, 'test-files', 'pb2-files')
|
||||||
|
sys.path.append(proto_path)
|
||||||
|
|
||||||
|
# let grpc tools import the proto files normally
|
||||||
|
config_pb2 = get_config_pb2()
|
||||||
|
_ = config_pb2.Config()
|
||||||
|
|
||||||
|
# clean up the path and unload config_pb2
|
||||||
|
sys.path.pop()
|
||||||
|
del sys.modules['config_pb2']
|
||||||
|
@ -27,8 +27,6 @@ def with_pb2s(test, *args, **kwargs):
|
|||||||
|
|
||||||
sys.path.pop()
|
sys.path.pop()
|
||||||
del sys.modules['config_pb2']
|
del sys.modules['config_pb2']
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
def test_get_bootsel_endpoints():
|
def test_get_bootsel_endpoints():
|
||||||
|
@ -27,8 +27,6 @@ def with_pb2s(test, *args, **kwargs):
|
|||||||
|
|
||||||
sys.path.pop()
|
sys.path.pop()
|
||||||
del sys.modules['config_pb2']
|
del sys.modules['config_pb2']
|
||||||
del sys.modules['enums_pb2']
|
|
||||||
del sys.modules['nanopb_pb2']
|
|
||||||
|
|
||||||
|
|
||||||
def test_config_footer(storage_dump):
|
def test_config_footer(storage_dump):
|
||||||
@ -97,7 +95,7 @@ def test_get_board_config_from_file_whole_board_dump():
|
|||||||
"""Test that we can open a storage dump file and find its config."""
|
"""Test that we can open a storage dump file and find its config."""
|
||||||
filename = os.path.join(HERE, 'test-files', 'test-whole-board-with-board-config.bin')
|
filename = os.path.join(HERE, 'test-files', 'test-whole-board-with-board-config.bin')
|
||||||
config = storage.get_config_from_file(filename, whole_board=True, board_config=True)
|
config = storage.get_config_from_file(filename, whole_board=True, board_config=True)
|
||||||
assert config.boardVersion == 'v0.7.8'
|
assert config.boardVersion == 'v0.7.6-15-g71f4512'
|
||||||
assert config.addonOptions.bootselButtonOptions.enabled is False
|
assert config.addonOptions.bootselButtonOptions.enabled is False
|
||||||
|
|
||||||
|
|
||||||
@ -167,7 +165,7 @@ def test_convert_binary_to_uf2_with_offsets(whole_board_with_board_config_dump):
|
|||||||
assert len(uf2) == 4194304 # binary is 8192 256 byte chunks, UF2 is 512 b per chunk
|
assert len(uf2) == 4194304 # binary is 8192 256 byte chunks, UF2 is 512 b per chunk
|
||||||
assert uf2[0:4] == b'\x55\x46\x32\x0a' == b'UF2\n' # proper magic
|
assert uf2[0:4] == b'\x55\x46\x32\x0a' == b'UF2\n' # proper magic
|
||||||
assert uf2[8:12] == bytearray(b'\x00\x20\x00\x00') # family ID set
|
assert uf2[8:12] == bytearray(b'\x00\x20\x00\x00') # family ID set
|
||||||
assert uf2[524:528] == bytearray(b'\x00\x81\x1f\x10') # address to write the second chunk
|
assert uf2[524:528] == bytearray(b'\x00\xc1\x1f\x10') # address to write the second chunk
|
||||||
|
|
||||||
|
|
||||||
def test_convert_binary_to_uf2_to_binary(whole_board_with_board_config_dump):
|
def test_convert_binary_to_uf2_to_binary(whole_board_with_board_config_dump):
|
||||||
@ -215,7 +213,7 @@ def test_read_created_uf2(tmp_path, firmware_binary, config_binary):
|
|||||||
binary = storage.convert_uf2_to_binary(content)
|
binary = storage.convert_uf2_to_binary(content)
|
||||||
# the converted binary should be aligned properly and of the right size
|
# the converted binary should be aligned properly and of the right size
|
||||||
assert len(binary) == 2 * 1024 * 1024
|
assert len(binary) == 2 * 1024 * 1024
|
||||||
assert binary[-32768-4:-32768] == storage.FOOTER_MAGIC
|
assert binary[-16384-4:-16384] == storage.FOOTER_MAGIC
|
||||||
assert binary[-4:] == storage.FOOTER_MAGIC
|
assert binary[-4:] == storage.FOOTER_MAGIC
|
||||||
user_storage = storage.get_user_storage_section(binary)
|
user_storage = storage.get_user_storage_section(binary)
|
||||||
footer_size, _, _ = storage.get_config_footer(user_storage)
|
footer_size, _, _ = storage.get_config_footer(user_storage)
|
||||||
@ -257,13 +255,13 @@ def test_serialize_modified_config_with_footer(storage_dump):
|
|||||||
def test_pad_config_to_storage(config_binary):
|
def test_pad_config_to_storage(config_binary):
|
||||||
"""Test that we can properly pad a config section to the correct storage section size."""
|
"""Test that we can properly pad a config section to the correct storage section size."""
|
||||||
storage_section = storage.pad_config_to_storage_size(config_binary)
|
storage_section = storage.pad_config_to_storage_size(config_binary)
|
||||||
assert len(storage_section) == 32768
|
assert len(storage_section) == 16384
|
||||||
|
|
||||||
|
|
||||||
def test_pad_config_to_storage_raises(config_binary):
|
def test_pad_config_to_storage_raises(config_binary):
|
||||||
"""Test that we raise an exception if the config is bigger than the storage section."""
|
"""Test that we raise an exception if the config is bigger than the storage section."""
|
||||||
with pytest.raises(storage.ConfigLengthError):
|
with pytest.raises(storage.ConfigLengthError):
|
||||||
_ = storage.pad_config_to_storage_size(config_binary * 10)
|
_ = storage.pad_config_to_storage_size(config_binary * 5)
|
||||||
|
|
||||||
|
|
||||||
@with_pb2s
|
@with_pb2s
|
||||||
@ -280,7 +278,7 @@ def test_get_board_config_from_usb(config_binary):
|
|||||||
config, _, _ = storage.get_board_config_from_usb()
|
config, _, _ = storage.get_board_config_from_usb()
|
||||||
|
|
||||||
mock_get.assert_called_once()
|
mock_get.assert_called_once()
|
||||||
mock_read.assert_called_with(mock_out, mock_in, 0x101F0000, 32768)
|
mock_read.assert_called_with(mock_out, mock_in, 0x101F8000, 16384)
|
||||||
assert config == storage.get_config(config_binary)
|
assert config == storage.get_config(config_binary)
|
||||||
|
|
||||||
|
|
||||||
@ -298,7 +296,7 @@ def test_get_user_config_from_usb(config_binary):
|
|||||||
config, _, _ = storage.get_user_config_from_usb()
|
config, _, _ = storage.get_user_config_from_usb()
|
||||||
|
|
||||||
mock_get.assert_called_once()
|
mock_get.assert_called_once()
|
||||||
mock_read.assert_called_with(mock_out, mock_in, 0x101F8000, 32768)
|
mock_read.assert_called_with(mock_out, mock_in, 0x101FC000, 16384)
|
||||||
assert config == storage.get_config(config_binary)
|
assert config == storage.get_config(config_binary)
|
||||||
|
|
||||||
|
|
||||||
|
7
tox.ini
7
tox.ini
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
isolated_build = true
|
isolated_build = true
|
||||||
envlist = begin,py39,py310,py311,py312,coverage,bandit,lint,reuse
|
envlist = begin,py39,py310,py311,coverage,bandit,lint,reuse
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
allow_externals = pytest, coverage
|
allow_externals = pytest, coverage
|
||||||
@ -33,11 +33,6 @@ commands =
|
|||||||
commands =
|
commands =
|
||||||
pytest --cov-append --cov={envsitepackagesdir}/gp2040ce_bintools/ --cov-branch
|
pytest --cov-append --cov={envsitepackagesdir}/gp2040ce_bintools/ --cov-branch
|
||||||
|
|
||||||
[testenv:py312]
|
|
||||||
# run pytest with coverage
|
|
||||||
commands =
|
|
||||||
pytest --cov-append --cov={envsitepackagesdir}/gp2040ce_bintools/ --cov-branch
|
|
||||||
|
|
||||||
[testenv:coverage]
|
[testenv:coverage]
|
||||||
# report on coverage runs from above
|
# report on coverage runs from above
|
||||||
skip_install = true
|
skip_install = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user