change variable names in CR (totally didnt just copy/paste that)

This commit is contained in:
Morgan 'ARR\!' Allen 2020-02-26 07:46:39 -08:00
parent d6104bde39
commit 48f7f611dc

View file

@ -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);
}
void lora32_set_coding_rate(lora32_cfg_t *lora, uint8_t d) {
if(d < 5) d = 5;
else if(d > 8) d = 8;
void lora32_set_coding_rate(lora32_cfg_t *lora, uint8_t cr) {
if(cr < 5) cr = 5;
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));
}