Add power fixed or unfixed flag

This commit is contained in:
Armel FAUVEAU
2024-03-31 17:16:55 +02:00
parent 43ce99d62e
commit 9cbff0390e
4 changed files with 102 additions and 92 deletions

View File

@@ -41,6 +41,7 @@ ENABLE_BYP_RAW_DEMODULATORS ?= 0
ENABLE_BLMIN_TMP_OFF ?= 0
ENABLE_SCAN_RANGES ?= 1
ENABLE_FEAT_F4HWN ?= 1
ENABLE_FEAT_F4HWN_FIXED_PWR ?= 0
# ---- DEBUGGING ----
ENABLE_AM_FIX_SHOW_DATA ?= 0
@@ -399,6 +400,9 @@ ifeq ($(ENABLE_FEAT_F4HWN),1)
CFLAGS += -DAUTHOR_STRING_1=\"$(AUTHOR_STRING_1)\" -DVERSION_STRING_1=\"$(VERSION_STRING_1)\"
CFLAGS += -DAUTHOR_STRING_2=\"$(AUTHOR_STRING_2)\" -DVERSION_STRING_2=\"$(VERSION_STRING_2)\"
endif
ifeq ($(ENABLE_FEAT_F4HWN_FIXED_PWR),1)
CFLAGS += -DENABLE_FEAT_F4HWN_FIXED_PWR
endif
LDFLAGS =
LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections

Binary file not shown.

Binary file not shown.

94
radio.c
View File

@@ -473,6 +473,7 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
EEPROM_ReadBuffer(0x1ED0 + (Band * 16) + (pInfo->OUTPUT_POWER * 3), Txp, 3);
#ifdef ENABLE_FEAT_F4HWN
#ifdef ENABLE_FEAT_F4HWN_FIXED_PWR
// make low and mid even lower
// and fix values
// because of toxic fucking closed firmwares
@@ -524,54 +525,59 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
Txp[1] = 165 + shift[6];
Txp[2] = 165 + shift[6];
}
#else
// make low and mid even lower
// and use calibration values
// be aware with toxic fucking closed firmwares
// uint8_t shift[] = {0, 0, 0, 0, 0};
uint8_t shift[] = {0, 0, 0, 0, 0};
// /*
// if(Band == 5)
// {
// shift[0] = 3;
// shift[1] = 3;
// shift[2] = 4;
// shift[3] = 7;
// shift[4] = 8;
// }
// */
/*
if(Band == 5) // UHF
{
shift[0] = 0;
shift[1] = 0;
shift[2] = 0;
shift[3] = 0;
shift[4] = 0;
}
*/
// if (pInfo->OUTPUT_POWER == OUTPUT_POWER_LOW) {
// for(uint8_t p = 0; p < 3; p++ )
// {
// switch (gSetting_set_low) {
// case 0:
// Txp[p] = (Txp[p] * 4) / 25 + shift[gSetting_set_low];
// break;
// case 1:
// Txp[p] = (Txp[p] * 4) / 19 + shift[gSetting_set_low];
// break;
// case 2:
// Txp[p] = (Txp[p] * 4) / 13 + shift[gSetting_set_low];
// break;
// case 3:
// Txp[p] = (Txp[p] * 4) / 10 + shift[gSetting_set_low];
// break;
// case 4:
// Txp[p] = (Txp[p] * 4) / 7 + shift[gSetting_set_low];
// break;
// }
if (pInfo->OUTPUT_POWER == OUTPUT_POWER_LOW) {
for(uint8_t p = 0; p < 3; p++ )
{
switch (gSetting_set_low) {
case 0:
Txp[p] = (Txp[p] * 4) / 25 + shift[gSetting_set_low];
break;
case 1:
Txp[p] = (Txp[p] * 4) / 19 + shift[gSetting_set_low];
break;
case 2:
Txp[p] = (Txp[p] * 4) / 13 + shift[gSetting_set_low];
break;
case 3:
Txp[p] = (Txp[p] * 4) / 10 + shift[gSetting_set_low];
break;
case 4:
Txp[p] = (Txp[p] * 4) / 7 + shift[gSetting_set_low];
break;
}
// }
// }
// else if (pInfo->OUTPUT_POWER == OUTPUT_POWER_MID){
// Txp[0] = (Txp[0] * 3) / 4;
// Txp[1] = (Txp[1] * 3) / 4;
// Txp[2] = (Txp[2] * 3) / 4;
// }
// // increase high
// else if (pInfo->OUTPUT_POWER == OUTPUT_POWER_HIGH){
// Txp[0] = Txp[0] + 30;
// Txp[1] = Txp[1] + 30;
// Txp[2] = Txp[2] + 30;
// }
}
}
else if (pInfo->OUTPUT_POWER == OUTPUT_POWER_MID){
Txp[0] = (Txp[0] * 3) / 4;
Txp[1] = (Txp[1] * 3) / 4;
Txp[2] = (Txp[2] * 3) / 4;
}
// increase high
else if (pInfo->OUTPUT_POWER == OUTPUT_POWER_HIGH){
Txp[0] = Txp[0] + 30;
Txp[1] = Txp[1] + 30;
Txp[2] = Txp[2] + 30;
}
#endif
#else
#ifdef ENABLE_REDUCE_LOW_MID_TX_POWER
// make low and mid even lower