Skip to content

Commit

Permalink
Update platform_node.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kadrim committed Jul 10, 2018
1 parent 5a63d02 commit 7cd4bb5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crossbow/platform_node.cpp
Expand Up @@ -20,6 +20,9 @@ void PlatformNode::seed(void) {
EEPROM.write(EEPROM_ADDRESS_BIND_2, random(1, 255)); //Yes, from 1 to 254
EEPROM.write(EEPROM_ADDRESS_BIND_3, random(1, 255)); //Yes, from 1 to 254
EEPROM.write(EEPROM_ADDRESS_BIND_KEY_SEEDED, 0xf1);
#ifdef ARDUINO_SAMD_FEATHER_M0
EEPROM.commit();
#endif
}
}

Expand All @@ -36,6 +39,9 @@ void PlatformNode::saveBindKey(uint8_t key[]) {
EEPROM.write(EEPROM_ADDRESS_BIND_2, key[2]);
EEPROM.write(EEPROM_ADDRESS_BIND_3, key[3]);
EEPROM.write(EEPROM_ADDRESS_BIND_KEY_SEEDED, 0xf1);
#ifdef ARDUINO_SAMD_FEATHER_M0
EEPROM.commit();
#endif
}

int PlatformNode::getRcChannel(uint8_t channel) {
Expand Down Expand Up @@ -75,4 +81,4 @@ void PlatformNode::leaveBindMode(void) {
isBindMode = false;
loadBindKey(bindKey);
radioNode.reset();
}
}

0 comments on commit 7cd4bb5

Please sign in to comment.