Skip to content

Commit

Permalink
Write build options to EEPROM for CHIRP to use.
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Dec 7, 2023
1 parent f7061c3 commit 0793b68
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void Main(void)
BOARD_ADC_GetBatteryInfo(&gBatteryCurrentVoltage, &gBatteryCurrent);

SETTINGS_InitEEPROM();

SETTINGS_WriteBuildOptions();
SETTINGS_LoadCalibration();

RADIO_ConfigureChannel(0, VFO_CONFIGURE_RELOAD);
Expand Down
47 changes: 47 additions & 0 deletions settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,3 +711,50 @@ void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep)
}
}
}

void SETTINGS_WriteBuildOptions(void)
{
uint8_t buf[8]= {};
buf[0] = 0
#ifdef ENABLE_FMRADIO
| (1 << 0)
#endif
#ifdef ENABLE_NOAA
| (1 << 1)
#endif
#ifdef ENABLE_VOICE
| (1 << 2)
#endif
#ifdef ENABLE_VOX
| (1 << 3)
#endif
#ifdef ENABLE_ALARM
| (1 << 4)
#endif
#ifdef ENABLE_TX1750
| (1 << 5)
#endif
#ifdef ENABLE_PWRON_PASSWORD
| (1 << 6)
#endif
#ifdef ENABLE_DTMF_CALLING
| (1 << 7)
#endif
;

buf[1] = 0
#ifdef ENABLE_FLASHLIGHT
| (1 << 0)
#endif
#ifdef ENABLE_WIDE_RX
| (1 << 1)
#endif
#ifdef ENABLE_BYP_RAW_DEMODULATORS
| (1 << 2)
#endif
#ifdef ENABLE_BLMIN_TMP_OFF
| (1 << 3)
#endif
;
EEPROM_WriteBuffer(0x1FF0, buf);
}
1 change: 1 addition & 0 deletions settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,6 @@ void SETTINGS_SaveChannelName(uint8_t channel, const char * name);
void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, uint8_t Mode);
void SETTINGS_SaveBatteryCalibration(const uint16_t * batteryCalibration);
void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep);
void SETTINGS_WriteBuildOptions(void);

#endif

0 comments on commit 0793b68

Please sign in to comment.