Comments (4)
I think I know why this happens, but I'm yet to verify it. We have this bit of code:
void SpaceCadetConfig::disableSpaceCadetIfUnconfigured() {
if (Runtime.storage().isSliceUninitialized(settings_base_, sizeof(SpaceCadet::settings_)))
::SpaceCadet.disable();
}
It feels like this doesn't disable SpaceCadet. The function is getting called from the Model100's setup()
, so the only way this can fail is if .isSliceUninitialized()
returns false. Now why would it return false when we didn't touch any SpaceCadet configuration? Why would it return false only sometimes?
I believe the answer for that is sizeof()
. SpaceCadet::settings_
is an uint8_t
and an uint16_t
. That's 3 bytes, but with padding, it's 4. So we end up checking one extra byte, and if that isn't 255, we will not disable SpaceCadet. Now, what comes after SpaceCadetConfig
in the EEPROM layout in the Model 100 firmware? LEDPaletteTheme
. If the first color in the palette is set to any color where the red component isn't 0, then that byte will trip the .isSliceUninitialized()
setting over.
Unfortunately, SpaceCadet::settings_
does not appear in the size-map, so I'll have to check it some other way. But I'm fairly confident this is the case.
from chrysalis-firmware-bundle.
And indeed, sizeof(SpaceCadet::settings_)
is 4... however, that is also the size we requested, so unfortunately this is a dead end.
from chrysalis-firmware-bundle.
Doing a factory reset and reconnecting with Chrysalis does not turn it on. Perhaps this is a remnant of the old corruption bug? If the eeprom is not properly cleared when upgrading from bad firmware to good, there's a very good chance that SpaceCadet would turn on.
from chrysalis-firmware-bundle.
Having looked at a number of cases where SpaceCadet ended up being turned on, I'm very confident that this is not a bug in SpaceCadetConfig
, but a result of either corruption, or incomplete / missing storage layout migration, both of which are outside of the control of the plugin.
Closing.
from chrysalis-firmware-bundle.
Related Issues (20)
- Model01 experimental firmware is currently too big HOT 1
- Add version tag matching firmwares bundled with Chrysalis HOT 1
- Add CI workflow to validate sketch files compile and meet the size constraint of the MCU. HOT 1
- Should use the same tagging conventions as Chrysalis
- Consider dropping a layer on the Keyboardio Atreus, to enable LayerNames HOT 1
- Consider enabling the DefaultLEDModeConfig plugin for the Model100 HOT 1
- Add SpaceCadetConfig to the Model100 sketch
- Add the Steno plugin to the Model100 sketch HOT 2
- M100 firmware version 0.11.1+29 prints "locally built"
- remove AlphaSquareEffect from default sketches HOT 2
- Adjust the Model100 firmware to default to Colormap HOT 4
- Feature request: Distribute firmware updates via fwupd? HOT 4
- SpaceCadet causes shift to work differently HOT 3
- No code_of _conducting or contributing file
- Migrate to using Kaleidoscope as upstream source for sketches
- Model01 experimental firmware has NumPad LED effect active HOT 5
- Atreus - "GET_DESCRIPTOR" calls are timing out with latest firmware (`0.92.1+94`) HOT 8
- Model01 experimental firmware should have FocusLEDCommands enabled
- Model01 experimental firmware should have IdleLEDs included-- enhancement request HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrysalis-firmware-bundle.