Compare commits

...

2 commits

2 changed files with 5 additions and 3 deletions

View file

@ -103,7 +103,6 @@ typedef struct {
} lora32_handle_t;
typedef struct lora32_cfg_t {
char *name;
uint8_t nss;
uint8_t cipo;
uint8_t copi;
@ -157,6 +156,7 @@ void lora32_send(lora32_cfg_t *config, uint8_t *data, uint8_t len);
void lora32_set_bandwidth(lora32_cfg_t *lora, uint8_t bw);
void lora32_set_coding_rate(lora32_cfg_t *lora, uint8_t cr);
void lora32_set_spreadfactor(lora32_cfg_t *lora, uint8_t factor);
uint8_t lora32_get_spreadfactor(lora32_cfg_t *lora);
void lora32_read_data(lora32_cfg_t *lora, uint8_t *data);
void lora32_sleep(lora32_cfg_t *lora);
void lora32_standby(lora32_cfg_t *lora);

View file

@ -240,7 +240,7 @@ void lora32_toggle_reset(lora32_cfg_t *config) {
vTaskDelay(100 / portTICK_PERIOD_MS); // 5ms before available
}
uint8_t lora32_get_spreadingfactor(lora32_cfg_t *lora) {
uint8_t lora32_get_spreadfactor(lora32_cfg_t *lora) {
return (lora32_read_reg(lora, REG_MODEM_CONFIG_2) >> 4);
}
@ -260,6 +260,8 @@ void lora32_set_spreadfactor(lora32_cfg_t *lora, uint8_t factor) {
ESP_LOGI(TAG, "lora32_set_spreadfactor: %d", factor);
lora32_write_reg(lora, REG_MODEM_CONFIG_2, (lora32_read_reg(lora, REG_MODEM_CONFIG_2) & 0x0F) | ((factor << 4) & 0xF0));
lora->spreadingFactor = factor;
}
void lora32_enable_single_rx(lora32_cfg_t *lora) {
@ -320,7 +322,7 @@ long lora32_get_bandwidth(lora32_cfg_t *lora) {
}
void lora32_set_ldo_flag(lora32_cfg_t *lora) {
long symbolDuration = 1000 / (lora32_get_bandwidth(lora) / (1L << lora32_get_spreadingfactor(lora)));
long symbolDuration = 1000 / (lora32_get_bandwidth(lora) / (1L << lora32_get_spreadfactor(lora)));
ESP_LOGI(TAG, "symbolDuration: %ld", symbolDuration);