set spreading factor on init

This commit is contained in:
Morgan 'ARR\!' Allen 2020-02-29 16:09:00 -08:00
parent 795dabfd06
commit 50269c878f

View file

@ -419,6 +419,9 @@ uint8_t lora32_init(lora32_cfg_t *lora) {
lora32_set_coding_rate(lora, lora->codingRate); lora32_set_coding_rate(lora, lora->codingRate);
ESP_LOGI(TAG, "lora32_set_codingRate: %d", lora->codingRate); ESP_LOGI(TAG, "lora32_set_codingRate: %d", lora->codingRate);
lora32_set_spreadfactor(lora, lora->spreadingFactor);
ESP_LOGI(TAG, "lora32_set_spreadingFactor: %d", lora->spreadingFactor);
lora32_write_reg(lora, REG_FIFO_TX_BASE_ADDR, 0x00); lora32_write_reg(lora, REG_FIFO_TX_BASE_ADDR, 0x00);
lora32_write_reg(lora, REG_FIFO_RX_BASE_ADDR, 0x00); lora32_write_reg(lora, REG_FIFO_RX_BASE_ADDR, 0x00);
ESP_LOGI(TAG, "clear rx/tx fifos"); ESP_LOGI(TAG, "clear rx/tx fifos");