change bandwidth enum to typedef

This commit is contained in:
Morgan 'ARR\!' Allen 2020-03-01 07:41:11 -08:00
parent 04da5a472d
commit 2e721f68da
2 changed files with 5 additions and 5 deletions

View file

@ -80,9 +80,9 @@ enum freq {
F433, F866, F915 F433, F866, F915
} lora32_freq; } lora32_freq;
enum bandwidth { typedef enum {
B78, B104, B156, B208, B3125, B417, B625, B125, B250, B500 B78, B104, B156, B208, B3125, B417, B625, B125, B250, B500
}; } bandwidth;
const long long frequencies[3]; const long long frequencies[3];
const long bandwidths[9]; const long bandwidths[9];
@ -103,7 +103,7 @@ typedef struct lora32_cfg_t {
uint8_t fifoIdx; uint8_t fifoIdx;
long frequency; long frequency;
enum bandwidth bandwidth; bandwidth bandwidth;
uint8_t spreadingFactor; uint8_t spreadingFactor;
uint8_t codingRate; 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_continuous_rx(lora32_cfg_t *lora);
void lora32_enable_cad(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_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_coding_rate(lora32_cfg_t *lora, uint8_t cr);
void lora32_set_spreadfactor(lora32_cfg_t *lora, uint8_t factor); void lora32_set_spreadfactor(lora32_cfg_t *lora, uint8_t factor);
void lora32_read_data(lora32_cfg_t *lora, uint8_t *data); void lora32_read_data(lora32_cfg_t *lora, uint8_t *data);

View file

@ -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); 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); uint8_t modem_config_1 = lora32_read_reg(lora, REG_MODEM_CONFIG_1);
ESP_LOGI(TAG, "lora32_set_bandwidth: %d", bw); ESP_LOGI(TAG, "lora32_set_bandwidth: %d", bw);