From 28b26264be76010bba068cfc6ec61134c851e54e Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Sat, 8 Feb 2025 03:13:35 +0100 Subject: [PATCH] Save 40 bytes --- radio.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/radio.c b/radio.c index 170083e..d4c16b9 100644 --- a/radio.c +++ b/radio.c @@ -572,6 +572,7 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo) } */ + /* for(uint8_t p = 0; p < 3; p++) { switch (currentPower) @@ -599,6 +600,21 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo) break; } } + */ + + static const uint8_t dividers[6] = { 25, 19, 13, 10, 7, 4}; + + for (uint8_t p = 0; p < 3; p++) + { + if (currentPower < 6) + { + Txp[p] = (Txp[p] * (currentPower == 5 ? 3 : 4)) / dividers[currentPower]; + } + else // case 6 + { + Txp[p] += 30; + } + } #else #ifdef ENABLE_REDUCE_LOW_MID_TX_POWER // make low and mid even lower