diff --git a/include/esp32-lora.h b/include/esp32-lora.h index b219707..69d6767 100644 --- a/include/esp32-lora.h +++ b/include/esp32-lora.h @@ -80,9 +80,9 @@ enum freq { F433, F866, F915 } lora32_freq; -enum bandwidth { +typedef enum { B78, B104, B156, B208, B3125, B417, B625, B125, B250, B500 -}; +} bandwidth; const long long frequencies[3]; const long bandwidths[9]; @@ -103,7 +103,7 @@ typedef struct lora32_cfg_t { uint8_t fifoIdx; long frequency; - enum bandwidth bandwidth; + bandwidth bandwidth; uint8_t spreadingFactor; uint8_t codingRate; @@ -130,7 +130,7 @@ void lora32_dump_regs(lora32_cfg_t *lora); void lora32_enable_continuous_rx(lora32_cfg_t *lora); void lora32_enable_cad(lora32_cfg_t *lora); void lora32_send(lora32_cfg_t *config, uint8_t *data, uint8_t len); -void lora32_set_bandwidth(lora32_cfg_t *lora, enum bandwidth bw); +void lora32_set_bandwidth(lora32_cfg_t *lora, bandwidth bw); void lora32_set_coding_rate(lora32_cfg_t *lora, uint8_t cr); void lora32_set_spreadfactor(lora32_cfg_t *lora, uint8_t factor); void lora32_read_data(lora32_cfg_t *lora, uint8_t *data); diff --git a/main/esp32-lora.c b/main/esp32-lora.c index 393d420..41391f0 100644 --- a/main/esp32-lora.c +++ b/main/esp32-lora.c @@ -262,7 +262,7 @@ void lora32_enable_cad(lora32_cfg_t *lora) { lora32_write_reg(lora, REG_OP_MODE, MODE_LONG_RANGE_MODE | MODE_CAD_DETECT); } -void lora32_set_bandwidth(lora32_cfg_t *lora, enum bandwidth bw) { +void lora32_set_bandwidth(lora32_cfg_t *lora, bandwidth bw) { uint8_t modem_config_1 = lora32_read_reg(lora, REG_MODEM_CONFIG_1); ESP_LOGI(TAG, "lora32_set_bandwidth: %d", bw);