-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues on M0 #66
Comments
Hi, Unfortunately, EEPROM or some way to store configuration is currently required. I do not have M0 so if noone will find a solution on M0, I will have to drop support for it |
I have some M0 lying around - i will fiddle around with them and try to provide a solution, i.e. using Flash-Memory |
Yes, that would be the best |
I created a pull request for this issue: #67 Best regards |
Resolved |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
i tried your code on adafruit m0 and it needs adjustmends, because the M0 does not have an EEPROM.
In platform_node.h:
#ifdef ARDUINO_AVR_FEATHER32U4 #include <EEPROM.h> #endif
In platform_node.cpp:
`
void PlatformNode::seed(void) {
uint8_t val;
#ifdef ARDUINO_AVR_FEATHER32U4
val = EEPROM.read(EEPROM_ADDRESS_BIND_KEY_SEEDED);
#endif
}
void PlatformNode::loadBindKey(uint8_t key[]) {
#ifdef ARDUINO_AVR_FEATHER32U4
key[0] = EEPROM.read(EEPROM_ADDRESS_BIND_0);
key[1] = EEPROM.read(EEPROM_ADDRESS_BIND_1);
key[2] = EEPROM.read(EEPROM_ADDRESS_BIND_2);
key[3] = EEPROM.read(EEPROM_ADDRESS_BIND_3);
#endif
}
void PlatformNode::saveBindKey(uint8_t key[]) {
#ifdef ARDUINO_AVR_FEATHER32U4
EEPROM.write(EEPROM_ADDRESS_BIND_0, key[0]);
EEPROM.write(EEPROM_ADDRESS_BIND_1, key[1]);
EEPROM.write(EEPROM_ADDRESS_BIND_2, key[2]);
EEPROM.write(EEPROM_ADDRESS_BIND_3, key[3]);
EEPROM.write(EEPROM_ADDRESS_BIND_KEY_SEEDED, 0xf1);
#endif
}
`
Best regards,
David
The text was updated successfully, but these errors were encountered: