Skip to content

Commit

Permalink
M fix revert - for now
Browse files Browse the repository at this point in the history
  • Loading branch information
OneOfEleven committed Sep 23, 2023
1 parent 6fbcbef commit 9626dbb
Show file tree
Hide file tree
Showing 12 changed files with 303 additions and 169 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ENABLE_SHOW_CHARGE_LEVEL := 0
ENABLE_REVERSE_BAT_SYMBOL := 1
ENABLE_AM_FIX := 1
ENABLE_AM_FIX_SHOW_DATA := 1
ENABLE_AM_FIX_TEST1 := 0
ENABLE_SQUELCH1_LOWER := 0
ENABLE_AUDIO_BAR := 0
#ENABLE_SINGLE_VFO_CHAN := 1
Expand Down Expand Up @@ -208,6 +209,9 @@ endif
ifeq ($(ENABLE_AM_FIX_SHOW_DATA),1)
CFLAGS += -DENABLE_AM_FIX_SHOW_DATA
endif
ifeq ($(ENABLE_AM_FIX_TEST1),1)
CFLAGS += -DENABLE_AM_FIX_TEST1
endif
ifeq ($(ENABLE_SQUELCH1_LOWER),1)
CFLAGS += -DENABLE_SQUELCH1_LOWER
endif
Expand Down
374 changes: 239 additions & 135 deletions am_fix.c

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions am_fix.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,6 @@ extern const uint8_t orig_mixer;
extern const uint8_t orig_pga;

#ifdef ENABLE_AM_FIX
extern const int8_t lna_short_dB[4];
extern const int8_t lna_dB[8];
extern const int8_t mixer_dB[4];
extern const int8_t pga_dB[8];

typedef struct
{
#if 1
// bitfields take less flash bytes
uint8_t lna_short:2; // 0 ~ 3
uint8_t lna:3; // 0 ~ 7
uint8_t mixer:2; // 0 ~ 3
uint8_t pga:3; // 0 ~ 7
#else
uint8_t lna_short; // 0 ~ 3
uint8_t lna; // 0 ~ 7
uint8_t mixer; // 0 ~ 3
uint8_t pga; // 0 ~ 7
#endif
} t_am_fix_gain_table;
// } __attribute__((packed)) t_am_fix_gain_table;

extern int16_t rssi_db_gain_diff;

void AM_fix_reset(void);
Expand Down
33 changes: 27 additions & 6 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,21 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)

#ifdef ENABLE_COMPANDER
case MENU_COMPAND:
*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_Compand) - 1;
break;
*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_Compand) - 1;
break;
#endif

#ifdef ENABLE_AM_FIX_TEST1
case MENU_AM_FIX_TEST1:
*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_AM_fix_test1) - 1;
break;
#endif

#ifdef ENABLE_AM_FIX
case MENU_AM_FIX:
#endif
#ifdef ENABLE_AUDIO_BAR
case MENU_MIC_BAR:
#endif
Expand All @@ -186,9 +196,6 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
case MENU_D_DCD:
case MENU_D_LIVE_DEC:
case MENU_AM:
#ifdef ENABLE_AM_FIX
case MENU_AM_FIX:
#endif
#ifdef ENABLE_NOAA
case MENU_NOAA_S:
#endif
Expand Down Expand Up @@ -617,6 +624,14 @@ void MENU_AcceptSetting(void)
break;
#endif

#ifdef ENABLE_AM_FIX_TEST1
case MENU_AM_FIX_TEST1:
gSetting_AM_fix_test1 = gSubMenuSelection;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
gFlagResetVfos = true;
break;
#endif

#ifdef ENABLE_NOAA
case MENU_NOAA_S:
gEeprom.NOAA_AUTO_SCAN = gSubMenuSelection;
Expand Down Expand Up @@ -993,6 +1008,12 @@ void MENU_ShowCurrentSetting(void)
break;
#endif

#ifdef ENABLE_AM_FIX_TEST1
case MENU_AM_FIX_TEST1:
gSubMenuSelection = gSetting_AM_fix_test1;
break;
#endif

#ifdef ENABLE_NOAA
case MENU_NOAA_S:
gSubMenuSelection = gEeprom.NOAA_AUTO_SCAN;
Expand Down
Binary file modified firmware
Binary file not shown.
Binary file modified firmware.bin
Binary file not shown.
Binary file modified firmware.packed.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ bool gSetting_ScrambleEnable;
#ifdef ENABLE_AM_FIX
bool gSetting_AM_fix;
#endif
#ifdef ENABLE_AM_FIX_TEST1
uint8_t gSetting_AM_fix_test1 = 0;
#endif
#ifdef ENABLE_AUDIO_BAR
bool gSetting_mic_bar;
#endif
Expand Down
3 changes: 3 additions & 0 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ extern bool gSetting_ScrambleEnable;
#ifdef ENABLE_AM_FIX
extern bool gSetting_AM_fix;
#endif
#ifdef ENABLE_AM_FIX_TEST1
extern uint8_t gSetting_AM_fix_test1;
#endif
#ifdef ENABLE_AUDIO_BAR
extern bool gSetting_mic_bar;
#endif
Expand Down
8 changes: 2 additions & 6 deletions ui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,8 @@ void UI_DisplayMain(void)
case FUNCTION_RECEIVE:
case FUNCTION_MONITOR:
case FUNCTION_INCOMING:
// if (gScanState == SCAN_OFF && gScreenToDisplay != DISPLAY_SCANNER)
// if (gScreenToDisplay != DISPLAY_SCANNER)
{
AM_fix_print_data(String);
UI_PrintStringSmall(String, 2, 0, 3);
}
AM_fix_print_data(String);
UI_PrintStringSmall(String, 0, 0, 3);
break;
}
}
Expand Down
19 changes: 19 additions & 0 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ const t_menu_item MenuList[] =
#ifdef ENABLE_AM_FIX
{"AM-FIX", 0, VOICE_ID_INVALID, MENU_AM_FIX },
#endif
#ifdef ENABLE_AM_FIX_TEST1
{"AM-FT1", 0, VOICE_ID_INVALID, MENU_AM_FIX_TEST1},
#endif
#ifdef ENABLE_NOAA
{"NOAA-S", 0, VOICE_ID_INVALID, MENU_NOAA_S },
#endif
Expand Down Expand Up @@ -267,6 +270,16 @@ const char gSubMenu_BACKLIGHT[7][7] =
};
#endif

#ifdef ENABLE_AM_FIX_TEST1
const char gSubMenu_AM_fix_test1[4][8] =
{
"LNA-S 0",
"LNA-S 1",
"LNA-S 2",
"LNA-S 3"
};
#endif

const char gSubMenu_BAT_TXT[3][8] =
{
"NONE",
Expand Down Expand Up @@ -425,6 +438,12 @@ void UI_DisplayMenu(void)
break;
#endif

#ifdef ENABLE_AM_FIX_TEST1
case MENU_AM_FIX_TEST1:
strcpy(String, gSubMenu_AM_fix_test1[gSubMenuSelection]);
break;
#endif

case MENU_AUTOLK:
strcpy(String, (gSubMenuSelection == 0) ? "OFF" : "AUTO");
break;
Expand Down
6 changes: 6 additions & 0 deletions ui/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ enum
#ifdef ENABLE_AM_FIX
MENU_AM_FIX,
#endif
#ifdef ENABLE_AM_FIX_TEST1
MENU_AM_FIX_TEST1,
#endif
#ifdef ENABLE_NOAA
MENU_NOAA_S,
#endif
Expand Down Expand Up @@ -140,6 +143,9 @@ extern const char gSubMenu_BACKLIGHT[7][7];
#ifdef ENABLE_COMPANDER
extern const char gSubMenu_Compand[4][6];
#endif
#ifdef ENABLE_AM_FIX_TEST1
extern const char gSubMenu_AM_fix_test1[4][8];
#endif
extern const char gSubMenu_BAT_TXT[3][8];

extern bool gIsInSubMenu;
Expand Down

0 comments on commit 9626dbb

Please sign in to comment.