renamed idle to standby to better reflect datasheet
lowered some log levels
This commit is contained in:
parent
14cd5df1e3
commit
db9b74ec76
2 changed files with 10 additions and 6 deletions
|
@ -146,5 +146,7 @@ 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);
|
||||
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);
|
||||
|
||||
#endif // _LORA32_H__
|
||||
|
|
|
@ -91,20 +91,20 @@ void lora23_set_implicit_header(lora32_cfg_t *lora) {
|
|||
lora32_write_reg(lora, REG_MODEM_CONFIG_1, lora32_read_reg(lora, REG_MODEM_CONFIG_1) | 0x01);
|
||||
}
|
||||
|
||||
void lora32_idle(lora32_cfg_t *lora) {
|
||||
ESP_LOGD(TAG, "MODE_STANDBY");
|
||||
void lora32_standby(lora32_cfg_t *lora) {
|
||||
ESP_LOGV(TAG, "MODE_STANDBY");
|
||||
|
||||
lora32_write_reg(lora, REG_OP_MODE, MODE_LONG_RANGE_MODE | MODE_STANDBY);
|
||||
}
|
||||
|
||||
void lora32_sleep(lora32_cfg_t *lora) {
|
||||
ESP_LOGD(TAG, "MODE_SLEEP");
|
||||
ESP_LOGV(TAG, "MODE_SLEEP");
|
||||
|
||||
lora32_write_reg(lora, REG_OP_MODE, MODE_LONG_RANGE_MODE | MODE_SLEEP);
|
||||
}
|
||||
|
||||
void lora32_enable_tx(lora32_cfg_t *lora) {
|
||||
lora32_idle(lora);
|
||||
lora32_standby(lora);
|
||||
|
||||
if(lora->implicitHeader)
|
||||
lora23_set_implicit_header(lora);
|
||||
|
@ -265,6 +265,8 @@ void lora32_enable_continuous_rx(lora32_cfg_t *lora) {
|
|||
lora32_write_reg(lora, REG_DIO_MAPPING_1, DIO0_MODE_RXDONE);
|
||||
}
|
||||
|
||||
lora32_standby(lora);
|
||||
|
||||
lora32_write_reg(lora, REG_OP_MODE, MODE_LONG_RANGE_MODE | MODE_RX_CONTINUOUS);
|
||||
}
|
||||
|
||||
|
@ -506,8 +508,8 @@ uint8_t lora32_init(lora32_cfg_t *lora) {
|
|||
lora32_set_tx_power(lora, 17, PA_OUTPUT_PA_BOOST_PIN);
|
||||
ESP_LOGI(TAG, "lora32_set_tx_power");
|
||||
|
||||
lora32_idle(lora);
|
||||
ESP_LOGI(TAG, "lora32_idle");
|
||||
lora32_standby(lora);
|
||||
ESP_LOGI(TAG, "lora32_standby");
|
||||
|
||||
// TODO setup shouldn't be based on just receive callback
|
||||
if(lora->receive != NULL) {
|
||||
|
|
Loading…
Reference in a new issue