From 906c470567f673bad74ed40d6e5f9c0f67ba9a7e Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Sun, 15 Oct 2023 13:24:10 +0100 Subject: [PATCH] eeprom structure update (not yet used though) --- firmware.bin | Bin 61260 -> 61260 bytes firmware.packed.bin | Bin 61278 -> 61278 bytes settings.h | 94 +++++++++++++++++++++++++++----------------- 3 files changed, 58 insertions(+), 36 deletions(-) diff --git a/firmware.bin b/firmware.bin index 2a3b7ad03f675ea61c92b35b492afc0b86092201..d966f686fa1bafd5b8b997ea16e360473d9bbd12 100644 GIT binary patch delta 69 zcmX?ekNM0!<_)q}*vu>pOjA=gD_=RxCJSMk>L~apmnayTDi|3U87mkXTNxQz8Jccp RzMU(`4&j(=E`M{C2>>_A783vf delta 69 zcmX?ekNM0!<_)q}*vylS%?-^rD_=RxCJSMk>L~apmnayTDi|3U87mkXS{WHz85nM6 UzMU(`4&)eFnObfxe{+=y0472ev;Y7A diff --git a/firmware.packed.bin b/firmware.packed.bin index 1044fdf1adf5c70151bf0ff2c307486b3e110d02..793396a7938cd60d3395d75d30a5ebec60382dbd 100644 GIT binary patch delta 84 zcmV-a0IUDr-UHs=1F!}l27au8RRzAY3?L!224H{LkCZ2~Gt|Qd9ZQ1`98EG8`m)3% qR^Vf3cY36QQ$Xrm*?vvpd*ibc+iejCbQtnuXJ&k}hwRk?0`AZq8YX}M delta 84 zcmV-a0IUDr-UHs=1F!}l27mX0S5fS<3?L!224N)HjlgxYGt|Qd9ZJ{?9vNU4`m)3% qR^Vf3cY36QQ$Xro*?v#rdgrqf+iejCb{O(tXJT=)hwRk?0{K{I%_lzq diff --git a/settings.h b/settings.h index 97de811..7cfb924 100644 --- a/settings.h +++ b/settings.h @@ -118,9 +118,19 @@ enum mdf_display_mode_e { typedef enum mdf_display_mode_e mdf_display_mode_t; // ************************************************ +// this is the full eeprom structure, both config and calibration areas +// +// am going to use this to replace ALL the currently scattered values +// +// this will also make AIRCOPY safe as we'll first save the incoming transfer +// into this ram area. +// Then, IF the transfer completes withput error, we'll copy it in one go to eeprom -// unused bits are all '0's if the channel is used, -// unless the channel is unused, in which case all 16 bytes are 0xff + +// if channel is used, all unused bits are '0's +// if channel not used, all bytes are 0xff +// +// 16 bytes typedef struct { // [0] uint32_t frequency; // @@ -240,20 +250,31 @@ typedef struct { } __attribute__((packed)) t_calibration; +// entire eeprom typedef struct { // 0x0000 t_channel channel[200]; // unused channels are set to all '0xff' // 0x0C80 - t_channel vfo[14]; - + #if 0 + t_channel vfo[14]; // 2 VFO's (upper/lower) per band, 7 frequency bands + #else + union { // 2 VFO's (upper/lower) per band, 7 frequency bands + t_channel vfo[14]; + struct { + t_channel a; + t_channel b; + } __attribute__((packed)) vfo_band[7]; + } __attribute__((packed)); + #endif + // 0x0D60 - struct { - uint8_t band:4; - uint8_t compander:2; - uint8_t scanlist2:1; - uint8_t scanlist1:1; + struct { // all these channel settings could have been in the t_channel structure ! + uint8_t band:4; // why do QS have these 4 bits ? .. band can/is computed from the frequency + uint8_t compander:2; // TODO: move this to the t_channel structure + uint8_t scanlist2:1; // set if is in scan list 2 + uint8_t scanlist1:1; // set if is in scan list 1 } __attribute__((packed)) channel_attr[200]; uint8_t unused1[8]; @@ -266,7 +287,7 @@ typedef struct { // 0x0E70 uint8_t call1; uint8_t squelch; - uint8_t tot; + uint8_t tx_timeout; uint8_t noaa_auto_scan; uint8_t key_lock; uint8_t vox_switch; @@ -317,8 +338,8 @@ typedef struct { uint8_t unused8[4]; // 0x0EB0 - uint8_t welcome_line1[16]; - uint8_t welcome_line2[16]; + char welcome_line1[16]; + char welcome_line2[16]; // 0x0ED0 uint8_t dtmf_side_tone; @@ -341,45 +362,45 @@ typedef struct { uint8_t dtmf_key_up_code[16]; uint8_t dtmf_key_down_code[16]; uint8_t s_list_default; - uint8_t scanlist1_enable; - uint8_t scanlist1_channel1; - uint8_t scanlist1_channel2; - uint8_t scanlist2_enable; - uint8_t scanlist2_channel1; - uint8_t scanlist2_channel2; + uint8_t priority1_enable; + uint8_t priority1_channel1; + uint8_t priority1_channel2; + uint8_t priority2_enable; + uint8_t priority2_channel1; + uint8_t priority2_channel2; uint8_t unused10; // 0x0F20 uint8_t unused11[8]; // 0x0F30 - uint8_t aes_key[16]; + uint8_t aes_key[16]; // disabled = all 0xff // 0x0F40 - uint8_t freq_lock; - uint8_t enable_tx_350; - uint8_t killed; - uint8_t enable_tx_200; - uint8_t enable_tx_500; - uint8_t enable_350; - uint8_t enable_scrambler; + uint8_t freq_lock; // + uint8_t enable_tx_350; // 350MHz ~ 400MHz + uint8_t killed; // + uint8_t enable_tx_200; // + uint8_t enable_tx_500; // + uint8_t enable_350; // + uint8_t enable_scrambler; // #if 0 // QS uint8_t unused12[9]; #else - // 1of11 - uint8_t tx_enable:1; - uint8_t dtmf_live_decoder:1; - uint8_t battery_text:2; - uint8_t mic_bar:1; - uint8_t am_fix:1; - uint8_t backlight_on_tx_rx:2; + // 1of11 .. some of my additional settings + uint8_t tx_enable:1; // 0 = completely disable TX, 1 = allow TX + uint8_t dtmf_live_decoder:1; // 1 = enable on-screen live DTMF decoder + uint8_t battery_text:2; // 0 = no battery text, 1 = voltage, 2 = percent .. on the status bar + uint8_t mic_bar:1; // 1 = on-screen TX audio level + uint8_t am_fix:1; // 1 = RX AM fix + uint8_t backlight_on_tx_rx:2; // 0 = no backlight when TX/RX, 1 = when RX, 2 = when TX, 3 = both RX/TX uint8_t unused12[8]; #endif // 0x0F50 - char channel_name[200][16]; + char channel_name[200][16]; // each channels name text // 0x1BD0 uint8_t unused13[16]; @@ -390,14 +411,15 @@ typedef struct { uint8_t dtmf_contact[16][16]; // 0x1D00 - uint8_t unused16[256]; + uint8_t unused16[256]; // lots of unused area we could make use of // 0x1E00 - t_calibration calibration; + t_calibration calibration; // the radios calibration/general settings } __attribute__((packed)) t_eeprom; // ************************************************ +// this and all the other variables are going to be replaced with the above t_eeprom typedef struct { uint8_t screen_channel[2];