BRN-POCSAG: 171 channels, 26 x 40 char messages, make toggles

EEPROM layout (settings.h), replacing the broken 24 byte layout from
85fb527 (200 x 24 B channels overran the VFOs, attributes and settings;
names were saved at ch*24 but read at ch*20):
- 32 byte channel records with the 10 char name and the 16 bit scrambler
  inside, 171 channels in two areas (0x0000, 0x11E0); VFOs at 0x1020 with
  the same record; attributes moved to 0x0F50.
- Message store from 0x1900: 26 messages of 40 characters.
- Reset VFO no longer wipes the memory channels and messages.
- Static asserts that no area overlaps another or the calibration.

Identity: reports "BRN-POCSAG v4.0" to CHIRP and in the packed image, so
stock / egzumer / F4HWN drivers do not accept the new layout; the name is
shown on the welcome screen.

Make toggles: ENABLE_POCSAG, ENABLE_POCSAG_DEBUG, ENABLE_POCSAG_DEV_TUNING,
ENABLE_OOK_SENDER (POCSAG code and the OOK sender compile out completely).

Fonts: removed the unused big font, big digits and small digits; the 3x5
font is only built with the spectrum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 01:43:05 +01:00
co-authored by Claude Opus 5.5
parent c5a2b41fdb
commit aabd0f4956
20 changed files with 159 additions and 312 deletions

No files matched your search

+31
View File
@@ -27,6 +27,31 @@
#include "app/fskmodem.h"
#include <driver/backlight.h>
// ---- EEPROM layout (keep chirp/uvk5_brnpocsag.py in sync) ----
// Channel / VFO record, 32 bytes:
// +0 frequency, offset +8 codes, modulation, flags, step, (spare)
// +16 name[0..7] +24 name[8..9], scrambler (u16), 4 spare
// 0x0000 channels 0 .. EEPROM_CH_A_COUNT-1
// 0x0E40 settings ... 0x0F4F (unused in this build: logo 0x0EB0, DTMF ANI/kill
// codes 0x0EE0, power-on password 0x0E98, AES key 0x0F30)
// 0x0F50 channel attributes, ChannelAttributes_t[207] (VFO bands at 200..206)
// 0x1020 VFOs: 7 bands x (VFO A, VFO B)
// 0x11E0 channels EEPROM_CH_A_COUNT .. MR_CHANNEL_LAST
// 0x1900 message counters, then the message store (app/messages.h) up to 0x1E00
// 0x1E00 calibration
#define EEPROM_CH_SIZE 32U
#define EEPROM_CH_NAME_OFFSET 16U // 10 characters
#define EEPROM_CH_SCR_OFFSET 26U // u16 scrambler, inside the +24 block
#define EEPROM_CH_A_COUNT (0x0E40U / EEPROM_CH_SIZE) // 114
#define EEPROM_CH_ATTR_BASE 0x0F50U
#define EEPROM_VFO_BASE 0x1020U
#define EEPROM_VFO_ADDR(band, vfo) ((uint16_t) (EEPROM_VFO_BASE + ((band) * 2U + (vfo)) * EEPROM_CH_SIZE))
#define EEPROM_VFO_END EEPROM_VFO_ADDR(7U, 0U) // 0x11E0
#define EEPROM_CH_B_BASE EEPROM_VFO_END
#define EEPROM_CH_ADDR(ch) ((uint16_t) (((unsigned) (ch) < EEPROM_CH_A_COUNT) ? (unsigned) (ch) * EEPROM_CH_SIZE \
: EEPROM_CH_B_BASE + ((unsigned) (ch) - EEPROM_CH_A_COUNT) * EEPROM_CH_SIZE))
#define EEPROM_CH_END (EEPROM_CH_B_BASE + (MR_CHANNEL_LAST + 1U - EEPROM_CH_A_COUNT) * EEPROM_CH_SIZE)
// Modem Modulation
typedef enum ModemModulation {
MOD_FSK_450, // for bad conditions
@@ -41,7 +66,13 @@ typedef enum ModemModulation {
MOD_POCSAG_2400
} ModemModulation;
#ifdef ENABLE_POCSAG
#define MODEM_IS_POCSAG(mode) ((mode) >= MOD_POCSAG_1200 && (mode) <= MOD_POCSAG_2400)
#define MODEM_LAST MOD_POCSAG_2400
#else
#define MODEM_IS_POCSAG(mode) false // POCSAG code is compiled out (dead branches)
#define MODEM_LAST MOD_NOAA_SAME
#endif
enum POWER_OnDisplayMode_t {
#ifdef ENABLE_FEAT_F4HWN