change variable names in CR (totally didnt just copy/paste that)
This commit is contained in:
parent
d6104bde39
commit
48f7f611dc
1 changed files with 5 additions and 5 deletions
|
@ -255,13 +255,13 @@ 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_coding_rate(lora32_cfg_t *lora, uint8_t d) {
|
void lora32_set_coding_rate(lora32_cfg_t *lora, uint8_t cr) {
|
||||||
if(d < 5) d = 5;
|
if(cr < 5) cr = 5;
|
||||||
else if(d > 8) d = 8;
|
else if(cr > 8) cr = 8;
|
||||||
|
|
||||||
uint8_t cr = d - 4;
|
cr = cr - 4;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "lora32_set_coding_rate: %d", factor);
|
ESP_LOGI(TAG, "lora32_set_coding_rate: %d", cr + 4);
|
||||||
|
|
||||||
lora32_write_reg(lora, REG_MODEM_CONFIG_1, (lora32_read_reg(lora, REG_MODEM_CONFIG_1) & 0xF1) | (cr << 1));
|
lora32_write_reg(lora, REG_MODEM_CONFIG_1, (lora32_read_reg(lora, REG_MODEM_CONFIG_1) & 0xF1) | (cr << 1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue