add FHSS IRQ handling
This commit is contained in:
parent
6ad9cba796
commit
a347f418c8
1 changed files with 15 additions and 0 deletions
|
@ -417,6 +417,21 @@ static void IRAM_ATTR lora32_dio_task(void *arg) {
|
|||
// these *should* fire at the same time, defaults to false
|
||||
if(lora->cad_done != NULL) lora->cad_done(lora, cad_detected);
|
||||
}
|
||||
|
||||
if((irqs & IRQ_FHSS_CHANGE) == IRQ_FHSS_CHANGE) {
|
||||
ESP_LOGI(TAG, "switching channel %d: %d", lora->channel, lora->channels[lora->channel]);
|
||||
|
||||
if(lora->channel == 0 && lora->channels[lora->channel] == 0) continue;
|
||||
|
||||
if(lora->channels[lora->channel] == 0) {
|
||||
ESP_LOGI(TAG, "reseting to channel 0");
|
||||
lora->channel = 0;
|
||||
}
|
||||
|
||||
lora32_set_frequency(lora, lora->frequency + (lora->channels[lora->channel] * bandwidths[lora->bandwidth]));
|
||||
|
||||
lora->channel++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue