LMIC key storage moved to event handler
This commit is contained in:
1 parent
b786323036
commit
3cbda10f40
3 files changed
+2
-10
No files matched your search
@@ -108,6 +108,8 @@ void lora_setupForNetwork(bool preJoin) {
|
||||
getSfName(updr2rps(LMIC.datarate)),
|
||||
getBwName(updr2rps(LMIC.datarate)),
|
||||
getCrName(updr2rps(LMIC.datarate)));
|
||||
// store LMIC keys and counters in RTC memory
|
||||
LMIC_getSessionKeys(&RTCnetid, &RTCdevaddr, RTCnwkKey, RTCartKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,6 @@ RTC_NOINIT_ATTR runmode_t RTC_runmode;
|
||||
void do_reset(bool warmstart) {
|
||||
if (warmstart) {
|
||||
// store LMIC keys and counters in RTC memory
|
||||
#if (HAS_LORA)
|
||||
LMIC_getSessionKeys(&RTCnetid, &RTCdevaddr, RTCnwkKey, RTCartKey);
|
||||
#endif
|
||||
ESP_LOGI(TAG, "restarting device (warmstart), keeping runmode %d",
|
||||
RTC_runmode);
|
||||
} else {
|
||||
@@ -84,11 +81,6 @@ void enter_deepsleep(const int wakeup_sec, const gpio_num_t wakeup_gpio) {
|
||||
esp_sleep_enable_ext1_wakeup(1ULL << wakeup_gpio, ESP_EXT1_WAKEUP_ALL_LOW);
|
||||
}
|
||||
|
||||
// store LMIC keys and counters in RTC memory
|
||||
#if (HAS_LORA)
|
||||
LMIC_getSessionKeys(&RTCnetid, &RTCdevaddr, RTCnwkKey, RTCartKey);
|
||||
#endif
|
||||
|
||||
// halt interrupts accessing i2c bus
|
||||
mask_user_IRQ();
|
||||
|
||||
|
||||
Reference in new issue
Block a user