From c88fe0ed3370fedfee52e6701c622511281f2dd4 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Fri, 12 Jul 2024 15:15:56 +0100 Subject: [PATCH] Add support for negative TX power values --- RNode_Firmware_CE.ino | 2 +- Utilities.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RNode_Firmware_CE.ino b/RNode_Firmware_CE.ino index 5686ac7..d9e1446 100644 --- a/RNode_Firmware_CE.ino +++ b/RNode_Firmware_CE.ino @@ -708,7 +708,7 @@ void serialCallback(uint8_t sbyte) { if (sbyte == 0xFF) { kiss_indicate_txpower(selected_radio); } else { - int txp = sbyte; + int8_t txp = (int8_t)sbyte; if (op_mode == MODE_HOST) setTXPower(selected_radio, txp); kiss_indicate_txpower(selected_radio); diff --git a/Utilities.h b/Utilities.h index bc8f1eb..462e294 100644 --- a/Utilities.h +++ b/Utilities.h @@ -677,7 +677,7 @@ void kiss_indicate_implicit_length() { } void kiss_indicate_txpower(RadioInterface* radio) { - uint8_t txp = radio->getTxPower(); + int8_t txp = radio->getTxPower(); serial_write(FEND); serial_write(CMD_TXPOWER); serial_write(txp);