diff --git a/Makefile b/Makefile index 33205b2..ceddb1c 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,17 @@ ENABLE_FLASHLIGHT ?= 1 ifeq ($(BANDSCOPE),1) ENABLE_SPECTRUM := 1 ENABLE_FMRADIO := 0 -EXTRA_CFLAGS += -DPOCSAG_DEBUG_UART=0 -finline-limit=1 +ENABLE_POCSAG_DEBUG := 0 +EXTRA_CFLAGS += -finline-limit=1 endif # ---- CUSTOM MODS ---- ENABLE_SPECTRUM ?= 0 +# ---- BRN-POCSAG components ---- +ENABLE_POCSAG ?= 1 +ENABLE_POCSAG_DEBUG ?= 1 +ENABLE_POCSAG_DEV_TUNING ?= 0 +ENABLE_OOK_SENDER ?= 1 ENABLE_BIG_FREQ ?= 0 ENABLE_SMALL_BOLD ?= 0 ENABLE_CUSTOM_MENU_LAYOUT ?= 1 @@ -146,9 +152,13 @@ OBJS += app/chFrScanner.o OBJS += app/common.o OBJS += app/dtmf.o OBJS += app/fskmodem.o -OBJS += app/pocsag.o +ifeq ($(ENABLE_POCSAG),1) + OBJS += app/pocsag.o +endif OBJS += app/messages.o -OBJS += app/ooksender.o +ifeq ($(ENABLE_OOK_SENDER),1) + OBJS += app/ooksender.o +endif ifeq ($(ENABLE_REGA),1) OBJS += app/rega.o endif @@ -188,7 +198,9 @@ ifeq ($(ENABLE_AIRCOPY),1) OBJS += ui/aircopy.o endif OBJS += ui/messages.o -OBJS += ui/ooksender.o +ifeq ($(ENABLE_OOK_SENDER),1) + OBJS += ui/ooksender.o +endif OBJS += ui/battery.o ifeq ($(ENABLE_FMRADIO),1) OBJS += ui/fmradio.o @@ -247,7 +259,7 @@ ifeq ($(ENABLE_FEAT_F4HWN),1) EDITION_STRING ?= Custom - AUTHOR_STRING ?= $(AUTHOR_STRING_1)+$(AUTHOR_STRING_2) + AUTHOR_STRING ?= BRN-POCSAG VERSION_STRING ?= $(VERSION_STRING_2) SQL_TONE ?= 550 # For SA818, use 600 and python3 sa818.py --port /dev/ttyS2 radio --frequency 434.975 --ctcss 71.9 --tail Open @@ -421,6 +433,13 @@ endif ifeq ($(ENABLE_AGC_SHOW_DATA),1) CFLAGS += -DENABLE_AGC_SHOW_DATA endif +ifeq ($(ENABLE_POCSAG),1) + CFLAGS += -DENABLE_POCSAG +endif +CFLAGS += -DPOCSAG_DEBUG_UART=$(ENABLE_POCSAG_DEBUG) -DPOCSAG_DEVIATION_TUNING=$(ENABLE_POCSAG_DEV_TUNING) +ifeq ($(ENABLE_OOK_SENDER),1) + CFLAGS += -DENABLE_OOK_SENDER +endif ifeq ($(ENABLE_FLASHLIGHT),1) CFLAGS += -DENABLE_FLASHLIGHT endif @@ -533,7 +552,7 @@ else ifneq (,$(HAS_CRCMOD)) $(info ) else ifeq ($(ENABLE_FEAT_F4HWN),1) - -$(MY_PYTHON) fw-pack.py $<.bin $(AUTHOR_STRING_2) $(VERSION_STRING_2) $<.packed.bin + -$(MY_PYTHON) fw-pack.py $<.bin BRN-POCSAG $(VERSION_STRING_2) $<.packed.bin else -$(MY_PYTHON) fw-pack.py $<.bin $(AUTHOR_STRING) $(VERSION_STRING) $<.packed.bin endif diff --git a/app/app.c b/app/app.c index f523976..a449fa0 100644 --- a/app/app.c +++ b/app/app.c @@ -92,7 +92,9 @@ #include "ui/status.h" #include "ui/ui.h" #include "messages.h" +#ifdef ENABLE_OOK_SENDER #include "ooksender.h" +#endif static bool flagSaveVfo; static bool flagSaveSettings; @@ -106,7 +108,9 @@ void (*ProcessKeysFunctions[])(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) [DISPLAY_MENU] = &MENU_ProcessKeys, [DISPLAY_SCANNER] = &SCANNER_ProcessKeys, [DISPLAY_MESSAGES] = &MESSAGES_ProcessKeys, +#ifdef ENABLE_OOK_SENDER [DISPLAY_OOKSENDER] = &OOKSENDER_ProcessKeys, +#endif #ifdef ENABLE_FMRADIO [DISPLAY_FM] = &FM_ProcessKeys, diff --git a/app/fskmodem.c b/app/fskmodem.c index 76e9914..8eeb6f7 100644 --- a/app/fskmodem.c +++ b/app/fskmodem.c @@ -34,6 +34,7 @@ RXState rxState = Ready; uint8_t SMSResponseCounterTarget = 6; +#ifdef ENABLE_POCSAG // --------------------------------------------------------------------------- // POCSAG 1200 modem (BK4819 native 2-FSK, NRZ) // @@ -186,13 +187,17 @@ static void POCSAG_AlertTimeSlice500ms(void) } } +#endif // ENABLE_POCSAG + void FSKModem_TimeSlice500ms(void) { +#ifdef ENABLE_POCSAG if (MODEM_IS_POCSAG(gEeprom.FSKMode)) { if (pocsagDuplicateTimeout > 0) pocsagDuplicateTimeout--; POCSAG_AlertTimeSlice500ms(); return; } +#endif if (SMSResponseCounter && FUNCTION_IsRx() && SMSResponseCounter++ > SMSResponseCounterTarget) { switch (gSMSResponseState) { @@ -224,10 +229,12 @@ void FSKModem_TimeSlice500ms(void) { } void MSG_ConfigureFSK(bool rx) { +#ifdef ENABLE_POCSAG if (MODEM_IS_POCSAG(gEeprom.FSKMode)) { POCSAG_ConfigureModem(rx); return; } +#endif // quick helper bool isAFSK = (gEeprom.FSKMode == MOD_AFSK_1200 || @@ -514,6 +521,7 @@ void processReceivedPacket(DataPacket *packet) { } } +#ifdef ENABLE_POCSAG static void MSG_POCSAGStoreReceived(void); // The chip locks somewhere in the preamble, so it usually has not collected all @@ -530,8 +538,12 @@ static void POCSAG_FlushCapture(void) pocsagRxSize = 0; } +#endif // ENABLE_POCSAG + void MSG_EnableRX(const bool enable) { +#ifdef ENABLE_POCSAG POCSAG_FlushCapture(); +#endif if (enable) { MSG_ConfigureFSK(true); @@ -565,6 +577,7 @@ static void MSG_EndDataTransmission(const bool audioWasEnabled) dataPTR = gMessageText; } +#ifdef ENABLE_POCSAG void MSG_POCSAGSend(const uint32_t ric, const char *text) { uint8_t frame[POCSAG_MAX_FRAME_SIZE]; @@ -641,7 +654,10 @@ void MSG_POCSAGSend(const uint32_t ric, const char *text) MSG_EndDataTransmission(audioWasEnabled); } +#endif // ENABLE_POCSAG + void MSG_FSKSendData(DataPacket *dataPacketIn) { +#ifdef ENABLE_POCSAG if (MODEM_IS_POCSAG(gEeprom.FSKMode)) { // e.g. UART command 0x06FF char text[DataPacketDataSize + 1U]; memcpy(text, dataPacketIn->data, DataPacketDataSize); @@ -649,6 +665,7 @@ void MSG_FSKSendData(DataPacket *dataPacketIn) { MSG_POCSAGSend(dataPacketIn->dest, text); return; } +#endif const unsigned int vfo = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO; @@ -764,6 +781,7 @@ void prepareDataPacket() { dataPacket.ttl = 20; } +#ifdef ENABLE_POCSAG // UART debug log for POCSAG RX (38400 8N1 on the programming cable): // "PS" chip locked on the preamble (FSK RX sync) // "PF " capture finished, n bytes @@ -903,6 +921,8 @@ static void POCSAG_HandleIRQ(const bool rx_sync, const bool rx_fifo_almost_full, } } +#endif // ENABLE_POCSAG + void FSK_HANDLE_IRQ(unsigned short irq) { //const uint16_t rx_sync_flags = BK4819_ReadRegister(BK4819_REG_0B); @@ -912,10 +932,12 @@ void FSK_HANDLE_IRQ(unsigned short irq) { //UART_printf("\nMSG : S%i, F%i, E%i | %i", rx_sync, rx_fifo_almost_full, rx_finished, irq); +#ifdef ENABLE_POCSAG if (MODEM_IS_POCSAG(gEeprom.FSKMode)) { POCSAG_HandleIRQ(rx_sync, rx_fifo_almost_full, rx_finished); return; } +#endif if (rx_sync) { // prevent listening to fsk data and squelch (kamilsss655) diff --git a/app/fskmodem.h b/app/fskmodem.h index 4a57147..47d4a1e 100644 --- a/app/fskmodem.h +++ b/app/fskmodem.h @@ -80,7 +80,7 @@ #define DataPacketDataSize (21) -#define SEQParameterEEPROM 0x1C00 +#define SEQParameterEEPROM 0x1900 // message counters, after the channels (settings.h) typedef struct __attribute__((packed)){ uint32_t dest; //4bytes diff --git a/app/main.c b/app/main.c index 4cbadc5..0a8af44 100644 --- a/app/main.c +++ b/app/main.c @@ -250,7 +250,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) { case KEY_7: #ifdef ENABLE_VOX ACTION_Vox(); -#else +#elif defined(ENABLE_OOK_SENDER) gRequestDisplayScreen = DISPLAY_OOKSENDER; // the VOX key is free: OOK sender #endif break; diff --git a/app/messages.c b/app/messages.c index 355efef..c789630 100644 --- a/app/messages.c +++ b/app/messages.c @@ -126,10 +126,12 @@ static void MESSAGES_ClearText(void) { } static void MESSAGES_Send(void) { +#ifdef ENABLE_POCSAG if (MODEM_IS_POCSAG(gEeprom.FSKMode)) { MSG_POCSAGSend(dataPacket.dest, gMessageText); return; } +#endif memset(dataPacket.data, 0, DataPacketDataSize); memcpy(dataPacket.data, gMessageText, DataPacketDataSize - 1U); @@ -137,10 +139,12 @@ static void MESSAGES_Send(void) { } void MESSAGES_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) { +#ifdef ENABLE_OOK_SENDER if(Key == KEY_STAR) { gRequestDisplayScreen = DISPLAY_OOKSENDER; return; } +#endif gKeyTimeout = 1; #if POCSAG_DEVIATION_TUNING // POCSAG deviation tuning: 2 = more, 8 = less (send a page and check it on an SDR) diff --git a/app/messages.h b/app/messages.h index 2d2913e..9c96cf7 100644 --- a/app/messages.h +++ b/app/messages.h @@ -13,17 +13,18 @@ // Message store: MESSAGES_COUNT slots between MESSAGES_START and the calibration // data at MESSAGES_END. Override MESSAGES_COUNT / POCSAG_MAX_MESSAGE_LENGTH with -D; // changing either moves the slots (old stored messages read back as garbage). -#define MESSAGES_START (0x1C08) -#define MESSAGES_END (0x1E00) -#ifndef MESSAGES_COUNT -#define MESSAGES_COUNT (12) -#endif +#define MESSAGES_START (SEQParameterEEPROM + 8U) +#define MESSAGES_END (0x1E00U) #define MESSAGE_FLAG_POCSAG (0x20U) #define MESSAGES_TEXT_LENGTH POCSAG_MAX_MESSAGE_LENGTH #define MESSAGES_HEADER_SIZE 7U // src, seq, ttl, flags // EEPROM is written in 8 byte blocks, so slots are a multiple of 8 bytes #define MESSAGES_SLOT_SIZE (((MESSAGES_HEADER_SIZE + MESSAGES_TEXT_LENGTH + 7U) / 8U) * 8U) +// default: as many messages as fit (40 characters -> 48 byte slots -> 26 messages) +#ifndef MESSAGES_COUNT +#define MESSAGES_COUNT ((MESSAGES_END - MESSAGES_START) / MESSAGES_SLOT_SIZE) +#endif // Display: 18 small-font characters per line, header line + text lines per message #define MESSAGES_LINE_CHARS 18U diff --git a/app/pocsag.h b/app/pocsag.h index dfba8b5..32c99e9 100644 --- a/app/pocsag.h +++ b/app/pocsag.h @@ -13,7 +13,7 @@ // Longest alphanumeric message (TX and RX). Also the stored message length, see // app/messages.h. Up to 45 fits the fixed two-batch TX frame (checked in pocsag.c). #ifndef POCSAG_MAX_MESSAGE_LENGTH -#define POCSAG_MAX_MESSAGE_LENGTH 33U +#define POCSAG_MAX_MESSAGE_LENGTH 40U #endif #define POCSAG_PREAMBLE_BYTES 72U // 576 bits of 1010..., the minimum the spec allows #define POCSAG_BATCH_WORDS 16U diff --git a/font.c b/font.c index e4fe9a9..82c5301 100644 --- a/font.c +++ b/font.c @@ -16,273 +16,6 @@ #include "font.h" -// removed last and middle column which was all 0x00 -// also the space char is not needed -//const uint8_t gFontBig[95 - 1][16 - 2] = -//{ -//#if 0 -//// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // ' ' -// {0x00, 0x00, 0x70, 0xF8, 0xF8, 0x70, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x1B, 0x1B, 0x00, 0x00}, // , 0x00}, // '!' -// {0x00, 0x1E, 0x3E, 0x00, 0x00, 0x3E, 0x1E, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '"' -// {0x40, 0xF0, 0xF0, 0x40, 0xF0, 0xF0, 0x40, /*0x00,*/ 0x04, 0x1F, 0x1F, 0x04, 0x1F, 0x1F, 0x04}, // , 0x00}, // '#' -// {0x70, 0xF8, 0x88, 0x8F, 0x8F, 0x98, 0x30, /*0x00,*/ 0x06, 0x0C, 0x08, 0x38, 0x38, 0x0F, 0x07}, // , 0x00}, // '$' -// {0x60, 0x60, 0x00, 0x00, 0x80, 0xC0, 0x60, /*0x00,*/ 0x18, 0x0C, 0x06, 0x03, 0x01, 0x18, 0x18}, // , 0x00}, // '%' -// {0x00, 0xB0, 0xF8, 0xC8, 0x78, 0xB0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x11, 0x0F, 0x1F, 0x10}, // , 0x00}, // '&' -// {0x00, 0x20, 0x3E, 0x1E, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // ''' -// {0x00, 0x00, 0xE0, 0xF0, 0x18, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x07, 0x0F, 0x18, 0x10, 0x00}, // , 0x00}, // '(' -// {0x00, 0x00, 0x08, 0x18, 0xF0, 0xE0, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x18, 0x0F, 0x07, 0x00}, // , 0x00}, // ')' -// {0x00, 0x40, 0xC0, 0x80, 0x80, 0xC0, 0x40, /*0x00,*/ 0x01, 0x05, 0x07, 0x03, 0x03, 0x07, 0x05}, // , 0x01}, // '*' -// {0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, /*0x00,*/ 0x00, 0x01, 0x01, 0x07, 0x07, 0x01, 0x01}, // , 0x00}, // '+' -// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x20, 0x3C, 0x1C, 0x00, 0x00}, // , 0x00}, // ',' -// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, // , 0x00}, // '-' -// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00}, // , 0x00}, // '.' -// {0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, /*0x00,*/ 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00}, // , 0x00}, // '/' -// {0xF0, 0xF8, 0x08, 0x88, 0x48, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x1F, 0x12, 0x11, 0x10, 0x1F, 0x0F}, // , 0x00}, // '0' -// {0x00, 0x20, 0x30, 0xF8, 0xF8, 0x00, 0x00, /*0x00,*/ 0x00, 0x10, 0x10, 0x1F, 0x1F, 0x10, 0x10}, // , 0x00}, // '1' -// {0x10, 0x18, 0x08, 0x88, 0xC8, 0x78, 0x30, /*0x00,*/ 0x1C, 0x1E, 0x13, 0x11, 0x10, 0x18, 0x18}, // , 0x00}, // '2' -// {0x10, 0x18, 0x88, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x08, 0x18, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '3' -// {0x80, 0xC0, 0x60, 0x30, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x01, 0x01, 0x01, 0x11, 0x1F, 0x1F, 0x11}, // , 0x00}, // '4' -// {0xF8, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x08, /*0x00,*/ 0x08, 0x18, 0x10, 0x10, 0x11, 0x1F, 0x0F}, // , 0x00}, // '5' -// {0xE0, 0xF0, 0x98, 0x88, 0x88, 0x80, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '6' -// {0x18, 0x18, 0x08, 0x08, 0x88, 0xF8, 0x78, /*0x00,*/ 0x00, 0x00, 0x1E, 0x1F, 0x01, 0x00, 0x00}, // , 0x00}, // '7' -// {0x70, 0xF8, 0x88, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // '8' -// {0x70, 0xF8, 0x88, 0x88, 0x88, 0xF8, 0xF0, /*0x00,*/ 0x00, 0x10, 0x10, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // '9' -// {0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00}, // , 0x00}, // ':' -// {0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1C, 0x0C, 0x00, 0x00}, // , 0x00}, // ';' -// {0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, 0x10, /*0x00,*/ 0x00, 0x01, 0x03, 0x06, 0x0C, 0x18, 0x10}, // , 0x00}, // '<' -// {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, /*0x00,*/ 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04}, // , 0x00}, // '=' -// {0x00, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, /*0x00,*/ 0x00, 0x10, 0x18, 0x0C, 0x06, 0x03, 0x01}, // , 0x00}, // '>' -// {0x30, 0x38, 0x08, 0x88, 0xC8, 0x78, 0x30, /*0x00,*/ 0x00, 0x00, 0x00, 0x1B, 0x1B, 0x00, 0x00}, // , 0x00}, // '?' -// {0xE0, 0xF0, 0x10, 0x90, 0x90, 0xF0, 0xE0, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x17, 0x17, 0x17, 0x03}, // , 0x00}, // '@' -// {0xC0, 0xE0, 0x30, 0x18, 0x30, 0xE0, 0xC0, /*0x00,*/ 0x1F, 0x1F, 0x01, 0x01, 0x01, 0x1F, 0x1F}, // , 0x00}, // 'A' -// {0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'B' -// {0xE0, 0xF0, 0x18, 0x08, 0x08, 0x18, 0x30, /*0x00,*/ 0x07, 0x0F, 0x18, 0x10, 0x10, 0x18, 0x0C}, // , 0x00}, // 'C' -// {0x08, 0xF8, 0xF8, 0x08, 0x18, 0xF0, 0xE0, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // 'D' -// {0x08, 0xF8, 0xF8, 0x88, 0xC8, 0x18, 0x38, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x11, 0x18, 0x1C}, // , 0x00}, // 'E' -// {0x08, 0xF8, 0xF8, 0x88, 0xC8, 0x18, 0x38, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x01, 0x00, 0x00}, // , 0x00}, // 'F' -// {0xE0, 0xF0, 0x18, 0x08, 0x08, 0x18, 0x30, /*0x00,*/ 0x07, 0x0F, 0x18, 0x11, 0x11, 0x0F, 0x1F}, // , 0x00}, // 'G' -// {0xF8, 0xF8, 0x80, 0x80, 0x80, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'H' -// {0x00, 0x00, 0x08, 0xF8, 0xF8, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'I' -// {0x00, 0x00, 0x00, 0x08, 0xF8, 0xF8, 0x08, /*0x00,*/ 0x0E, 0x1E, 0x10, 0x10, 0x1F, 0x0F, 0x00}, // , 0x00}, // 'J' -// {0x08, 0xF8, 0xF8, 0x80, 0xE0, 0x78, 0x18, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x01, 0x03, 0x1E, 0x1C}, // , 0x00}, // 'K' -// {0x08, 0xF8, 0xF8, 0x08, 0x00, 0x00, 0x00, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x10, 0x18, 0x1C}, // , 0x00}, // 'L' -// {0xF8, 0xF8, 0x70, 0xE0, 0x70, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'M' -// {0xF8, 0xF8, 0x70, 0xE0, 0xC0, 0xF8, 0xF8, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x00, 0x01, 0x1F, 0x1F}, // , 0x00}, // 'N' -// {0xE0, 0xF0, 0x18, 0x08, 0x18, 0xF0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x18, 0x10, 0x18, 0x0F, 0x07}, // , 0x00}, // 'O' -// {0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x00}, // , 0x00}, // 'P' -// {0xF0, 0xF8, 0x08, 0x08, 0x08, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x1C, 0x78, 0x7F, 0x4F}, // , 0x00}, // 'Q' -// {0x08, 0xF8, 0xF8, 0x88, 0x88, 0xF8, 0x70, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x00, 0x01, 0x1F, 0x1E}, // , 0x00}, // 'R' -// {0x30, 0x78, 0xC8, 0x88, 0x88, 0x38, 0x30, /*0x00,*/ 0x0C, 0x1C, 0x10, 0x10, 0x11, 0x1F, 0x0E}, // , 0x00}, // 'S' -// {0x00, 0x38, 0x18, 0xF8, 0xF8, 0x18, 0x38, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'T' -// {0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'U' -// {0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x03, 0x07, 0x0C, 0x18, 0x0C, 0x07, 0x03}, // , 0x00}, // 'V' -// {0xF8, 0xF8, 0x00, 0x00, 0x00, 0xF8, 0xF8, /*0x00,*/ 0x07, 0x1F, 0x1C, 0x07, 0x1C, 0x1F, 0x07}, // , 0x00}, // 'W' -// {0x18, 0x78, 0xE0, 0x80, 0xE0, 0x78, 0x18, /*0x00,*/ 0x18, 0x1E, 0x07, 0x01, 0x07, 0x1E, 0x18}, // , 0x00}, // 'X' -// {0x00, 0x78, 0xF8, 0x80, 0x80, 0xF8, 0x78, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'Y' -// {0x38, 0x18, 0x08, 0x88, 0xC8, 0x78, 0x38, /*0x00,*/ 0x1C, 0x1E, 0x13, 0x11, 0x10, 0x18, 0x1C}, // , 0x00}, // 'Z' -// {0x00, 0x00, 0xF8, 0xF8, 0x08, 0x08, 0x00, /*0x00,*/ 0x00, 0x00, 0x1F, 0x1F, 0x10, 0x10, 0x00}, // , 0x00}, // '[' -// {0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E, 0x1C}, // , 0x00}, // '"\' -// {0x00, 0x00, 0x08, 0x08, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x10, 0x1F, 0x1F, 0x00}, // , 0x00}, // ']' -// {0x10, 0x18, 0x0E, 0x07, 0x0E, 0x18, 0x10, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '^' -// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}, // , 0x40}, // '_' -// {0x00, 0x00, 0x07, 0x0F, 0x08, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // , 0x00}, // '`' -// {0x00, 0x40, 0x40, 0x40, 0xC0, 0x80, 0x00, /*0x00,*/ 0x0E, 0x1F, 0x11, 0x11, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'a' -// {0x08, 0xF8, 0xF8, 0x40, 0xC0, 0x80, 0x00, /*0x00,*/ 0x10, 0x1F, 0x0F, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'b' -// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x18, 0x08}, // , 0x00}, // 'c' -// {0x00, 0x80, 0xC0, 0x48, 0xF8, 0xF8, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'd' -// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x11, 0x11, 0x11, 0x19, 0x09}, // , 0x00}, // 'e' -// {0x80, 0xF0, 0xF8, 0x88, 0x18, 0x30, 0x00, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x00}, // , 0x00}, // 'f' -// {0x80, 0xC0, 0x40, 0x40, 0x80, 0xC0, 0x40, /*0x00,*/ 0x4F, 0xDF, 0x90, 0x90, 0xFF, 0x7F, 0x00}, // , 0x00}, // 'g' -// {0x08, 0xF8, 0xF8, 0x80, 0x40, 0xC0, 0x80, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'h' -// {0x00, 0x00, 0x40, 0xD8, 0xD8, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'i' -// {0x00, 0x00, 0x00, 0x00, 0x40, 0xD8, 0xD8, /*0x00,*/ 0x00, 0x60, 0xE0, 0x80, 0x80, 0xFF, 0x7F}, // , 0x00}, // 'j' -// {0x08, 0xF8, 0xF8, 0x00, 0x80, 0xC0, 0x40, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x03, 0x07, 0x1C, 0x18}, // , 0x00}, // 'k' -// {0x00, 0x00, 0x08, 0xF8, 0xF8, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1F, 0x1F, 0x10, 0x00}, // , 0x00}, // 'l' -// {0xC0, 0xC0, 0xC0, 0x80, 0xC0, 0xC0, 0x80, /*0x00,*/ 0x1F, 0x1F, 0x00, 0x1F, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'm' -// {0x40, 0xC0, 0x80, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x00, 0x1F, 0x1F, 0x00, 0x00, 0x1F, 0x1F}, // , 0x00}, // 'n' -// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'o' -// {0x40, 0xC0, 0x80, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x80, 0xFF, 0xFF, 0x90, 0x10, 0x1F, 0x0F}, // , 0x00}, // 'p' -// {0x80, 0xC0, 0x40, 0x40, 0x80, 0xC0, 0x40, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x90, 0xFF, 0xFF, 0x80}, // , 0x00}, // 'q' -// {0x40, 0xC0, 0x80, 0xC0, 0x40, 0xC0, 0x80, /*0x00,*/ 0x10, 0x1F, 0x1F, 0x10, 0x00, 0x00, 0x01}, // , 0x00}, // 'r' -// {0x80, 0xC0, 0x40, 0x40, 0x40, 0xC0, 0x80, /*0x00,*/ 0x08, 0x19, 0x13, 0x12, 0x16, 0x1C, 0x08}, // , 0x00}, // 's' -// {0x40, 0x40, 0xF0, 0xF8, 0x40, 0x40, 0x00, /*0x00,*/ 0x00, 0x00, 0x0F, 0x1F, 0x10, 0x18, 0x08}, // , 0x00}, // 't' -// {0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, /*0x00,*/ 0x0F, 0x1F, 0x10, 0x10, 0x0F, 0x1F, 0x10}, // , 0x00}, // 'u' -// {0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x00, 0x07, 0x0F, 0x18, 0x18, 0x0F, 0x07}, // , 0x00}, // 'v' -// {0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x0F, 0x1F, 0x18, 0x0E, 0x18, 0x1F, 0x0F}, // , 0x00}, // 'w' -// {0x40, 0xC0, 0x80, 0x00, 0x80, 0xC0, 0x40, /*0x00,*/ 0x10, 0x18, 0x0F, 0x07, 0x0F, 0x18, 0x10}, // , 0x00}, // 'x' -// {0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, /*0x00,*/ 0x8F, 0x9F, 0x90, 0x90, 0xD0, 0x7F, 0x3F}, // , 0x00}, // 'y' -// {0xC0, 0xC0, 0x40, 0x40, 0xC0, 0xC0, 0x40, /*0x00,*/ 0x18, 0x1C, 0x16, 0x13, 0x11, 0x18, 0x18}, // , 0x00}, // 'z' -// {0x00, 0x80, 0x80, 0xF0, 0x78, 0x08, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x10, 0x10}, // , 0x00}, // '{' -// {0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x00}, // , 0x00}, // '|' -// {0x00, 0x08, 0x08, 0x78, 0xF0, 0x80, 0x80, /*0x00,*/ 0x00, 0x10, 0x10, 0x1F, 0x0F, 0x00, 0x00}, // , 0x00}, // '}' -// {0x10, 0x18, 0x08, 0x18, 0x10, 0x18, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // , 0x00} // '->' -//#else -// // {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // ' ' -// {0x00, 0x00, 0x00, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00}, // '!' -// {0x00, 0x0F, 0x1F, 0x00, 0x00, 0x1F, 0x0F, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '"' -// {0x20, 0xF8, 0xF8, 0x20, 0xF8, 0xF8, 0x20, /*0x00,*/ 0x02, 0x0F, 0x0F, 0x02, 0x0F, 0x0F, 0x02}, // '#' -// {0x70, 0xF8, 0x88, 0x8E, 0x8E, 0x98, 0x10, /*0x00,*/ 0x04, 0x0C, 0x08, 0x38, 0x38, 0x0F, 0x07}, // '$' -// {0x30, 0x30, 0x00, 0x80, 0xC0, 0x60, 0x30, /*0x00,*/ 0x0C, 0x06, 0x03, 0x01, 0x00, 0x0C, 0x0C}, // '%' -// {0x80, 0xD8, 0x7C, 0xE4, 0xBC, 0xD8, 0x40, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x07, 0x0F, 0x08}, // '&' -// {0x00, 0x10, 0x1F, 0x0F, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // ''' -// {0x00, 0x00, 0xF0, 0xF8, 0x0C, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x03, 0x07, 0x0C, 0x08, 0x00}, // '(' -// {0x00, 0x00, 0x04, 0x0C, 0xF8, 0xF0, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0C, 0x07, 0x03, 0x00}, // ')' -// {0x00, 0x80, 0xA0, 0xE0, 0xC0, 0xE0, 0xA0, /*0x80,*/ 0x00, 0x00, 0x02, 0x03, 0x01, 0x03, 0x02}, // '*' -// {0x00, 0x80, 0x80, 0xE0, 0xE0, 0x80, 0x80, /*0x00,*/ 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00}, // '+' -// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x10, 0x1E, 0x0E, 0x00, 0x00}, // ',' -// {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '-' -// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00}, // '.' -// {0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, /*0x00,*/ 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00}, // '/' -// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '0' -// {0x00, 0x10, 0x18, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x08, 0x08}, // '1' -// {0x18, 0x1C, 0x04, 0x84, 0xC4, 0x7C, 0x38, /*0x00,*/ 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x08}, // '2' -// {0x18, 0x1C, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '3' -// {0x80, 0xC0, 0x60, 0x30, 0x18, 0xFC, 0xFC, /*0x00,*/ 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x0F}, // '4' -// {0x7C, 0x7C, 0x44, 0x44, 0x44, 0xC4, 0x84, /*0x00,*/ 0x04, 0x0C, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '5' -// {0xF0, 0xF8, 0x4C, 0x44, 0x44, 0xC4, 0x80, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '6' -// {0x04, 0x04, 0x04, 0x84, 0xE4, 0x7C, 0x1C, /*0x00,*/ 0x00, 0x00, 0x0E, 0x0F, 0x01, 0x00, 0x00}, // '7' -// {0xB8, 0xFC, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // '8' -// {0x78, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0xF8, /*0x00,*/ 0x00, 0x08, 0x08, 0x08, 0x0C, 0x07, 0x03}, // '9' -// {0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00}, // ':' -// {0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0E, 0x06, 0x00, 0x00}, // ';' -// {0x00, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x08, /*0x00,*/ 0x00, 0x00, 0x01, 0x03, 0x06, 0x0C, 0x08}, // '<' -// {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /*0x00,*/ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}, // '=' -// {0x00, 0x08, 0x18, 0x30, 0x60, 0xC0, 0x80, /*0x00,*/ 0x00, 0x08, 0x0C, 0x06, 0x03, 0x01, 0x00}, // '>' -// {0x38, 0x3C, 0x04, 0x84, 0xC4, 0x7C, 0x38, /*0x00,*/ 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00}, // '?' -// {0xF0, 0xF8, 0x08, 0xC8, 0xC8, 0xF8, 0xF0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0B, 0x0B, 0x0B, 0x01}, // '@' -// {0xF8, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0xF8, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'A' -// {0xFC, 0xFC, 0x44, 0x44, 0x44, 0xFC, 0xB8, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'B' -// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0x1C, 0x18, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0E, 0x06}, // 'C' -// {0xFC, 0xFC, 0x04, 0x04, 0x0C, 0xF8, 0xF0, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x0C, 0x07, 0x03}, // 'D' -// {0xFC, 0xFC, 0x44, 0x44, 0x44, 0x04, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08}, // 'E' -// {0xFC, 0xFC, 0x44, 0x44, 0x44, 0x04, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'F' -// {0xF8, 0xFC, 0x04, 0x84, 0x84, 0x9C, 0x98, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'G' -// {0xFC, 0xFC, 0x40, 0x40, 0x40, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'H' -// {0x00, 0x00, 0x04, 0xFC, 0xFC, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'I' -// {0x00, 0x00, 0x00, 0x04, 0xFC, 0xFC, 0x04, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x0F, 0x07, 0x00}, // 'J' -// {0xFC, 0xFC, 0xE0, 0x30, 0x18, 0x0C, 0x04, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'K' -// {0xFC, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x08, 0x08}, // 'L' -// {0xFC, 0xFC, 0x18, 0x70, 0x18, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'M' -// {0xFC, 0xFC, 0x60, 0xC0, 0x80, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x01, 0x0F, 0x0F}, // 'N' -// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'O' -// {0xFC, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0x78, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'P' -// {0xF8, 0xFC, 0x04, 0x04, 0x04, 0xFC, 0xF8, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0C, 0x0C, 0x1F, 0x17}, // 'Q' -// {0xFC, 0xFC, 0x84, 0x84, 0x84, 0xFC, 0x78, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'R' -// {0x38, 0x7C, 0x44, 0x44, 0x44, 0xCC, 0x88, /*0x00,*/ 0x06, 0x0E, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'S' -// {0x00, 0x04, 0x04, 0xFC, 0xFC, 0x04, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // 'T' -// {0xFC, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0xFC, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'U' -// {0x7C, 0xFC, 0x80, 0x00, 0x80, 0xFC, 0x7C, /*0x00,*/ 0x00, 0x03, 0x0F, 0x0C, 0x0F, 0x03, 0x00}, // 'V' -// {0xFC, 0xFC, 0x00, 0x80, 0x00, 0xFC, 0xFC, /*0x00,*/ 0x0F, 0x0F, 0x06, 0x03, 0x06, 0x0F, 0x0F}, // 'W' -// {0x0C, 0x3C, 0xF0, 0xC0, 0xF0, 0x3C, 0x0C, /*0x00,*/ 0x0C, 0x0F, 0x03, 0x00, 0x03, 0x0F, 0x0C}, // 'X' -// {0x00, 0x3C, 0x7C, 0xC0, 0xC0, 0x7C, 0x3C, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // 'Y' -// {0x04, 0x04, 0x84, 0xC4, 0x64, 0x3C, 0x1C, /*0x00,*/ 0x0E, 0x0F, 0x09, 0x08, 0x08, 0x08, 0x08}, // 'Z' -// {0x00, 0x00, 0xFC, 0xFC, 0x04, 0x04, 0x00, /*0x00,*/ 0x00, 0x00, 0x0F, 0x0F, 0x08, 0x08, 0x00}, // '[' -// {0x38, 0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E}, // '"\' -// {0x00, 0x00, 0x04, 0x04, 0xFC, 0xFC, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x08, 0x0F, 0x0F, 0x00}, // ']' -// {0x08, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x08, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '^' -// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20}, // '_' -// {0x00, 0x00, 0x03, 0x07, 0x04, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // '`' -// {0x00, 0xA0, 0xA0, 0xA0, 0xA0, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'a' -// {0xFC, 0xFC, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'b' -// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0x60, 0x40, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0C, 0x04}, // 'c' -// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xFC, 0xFC, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'd' -// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x09, 0x09, 0x09, 0x09, 0x01}, // 'e' -// {0x20, 0x20, 0xF8, 0xFC, 0x24, 0x24, 0x04, /*0x00,*/ 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00}, // 'f' -// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x4F, 0x48, 0x48, 0x48, 0x7F, 0x3F}, // 'g' -// {0xFC, 0xFC, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'h' -// {0x00, 0x00, 0x20, 0xEC, 0xEC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'i' -// {0x00, 0x00, 0x00, 0x00, 0x20, 0xEC, 0xEC, /*0x00,*/ 0x00, 0x30, 0x70, 0x40, 0x40, 0x7F, 0x3F}, // 'j' -// {0xFC, 0xFC, 0x00, 0x80, 0xC0, 0x60, 0x20, /*0x00,*/ 0x0F, 0x0F, 0x01, 0x03, 0x06, 0x0C, 0x08}, // 'k' -// {0x00, 0x00, 0x04, 0xFC, 0xFC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x08, 0x0F, 0x0F, 0x08, 0x00}, // 'l' -// {0xE0, 0xE0, 0x20, 0xE0, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x0F, 0x00, 0x0F, 0x0F}, // 'm' -// {0xE0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F}, // 'n' -// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'o' -// {0xE0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xC0, /*0x00,*/ 0x7F, 0x7F, 0x08, 0x08, 0x08, 0x0F, 0x07}, // 'p' -// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x7F, 0x7F}, // 'q' -// {0xE0, 0xE0, 0x60, 0x20, 0x20, 0x20, 0x20, /*0x00,*/ 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00}, // 'r' -// {0xC0, 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, /*0x00,*/ 0x08, 0x09, 0x09, 0x09, 0x09, 0x0F, 0x06}, // 's' -// {0x20, 0x20, 0xFC, 0xFC, 0x20, 0x20, 0x00, /*0x00,*/ 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08, 0x08}, // 't' -// {0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x08, 0x08, 0x0F, 0x0F}, // 'u' -// {0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x00, 0x03, 0x0F, 0x0C, 0x0F, 0x03, 0x00}, // 'v' -// {0xE0, 0xE0, 0x00, 0x80, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x0F, 0x08, 0x0F, 0x08, 0x0F, 0x07}, // 'w' -// {0x60, 0xE0, 0x80, 0x00, 0x80, 0xE0, 0x60, /*0x00,*/ 0x0C, 0x0E, 0x03, 0x01, 0x03, 0x0E, 0x0C}, // 'x' -// {0xE0, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xE0, /*0x00,*/ 0x07, 0x4F, 0x48, 0x48, 0x48, 0x7F, 0x3F}, // 'y' -// {0x20, 0x20, 0x20, 0xA0, 0xE0, 0x60, 0x20, /*0x00,*/ 0x0C, 0x0E, 0x0B, 0x09, 0x08, 0x08, 0x08}, // 'z' -// {0x00, 0x00, 0x40, 0xF8, 0xBC, 0x04, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08}, // '{' -// {0x00, 0x00, 0x00, 0xBC, 0xBC, 0x00, 0x00, /*0x00,*/ 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00}, // '|' -// {0x00, 0x04, 0x04, 0xBC, 0xF8, 0x40, 0x00, /*0x00,*/ 0x00, 0x08, 0x08, 0x0F, 0x07, 0x00, 0x00}, // '}' -// {0x08, 0x0C, 0x04, 0x0C, 0x08, 0x0C, 0x04, /*0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // '->' -//#endif -//}; - -#if 0 - // original font - const uint8_t gFontBigDigits[11][26] = - { - {0x00, 0xC0, 0xF0, 0xF8, 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1C, 0xF8, 0xF0, 0xE0, 0x00, 0x07, 0x1F, 0x3F, 0x78, 0x60, 0x60, 0x60, 0x60, 0x70, 0x3F, 0x1F, 0x0F}, - {0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC, 0xFC, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00}, - {0x00, 0x10, 0x38, 0x38, 0x1C, 0x0C, 0x0C, 0x0C, 0x0C, 0xFC, 0xF8, 0xF0, 0x00, 0x00, 0x70, 0x78, 0x7C, 0x7C, 0x6E, 0x66, 0x67, 0x67, 0x63, 0x61, 0x60, 0x00}, - {0x00, 0x10, 0x18, 0x18, 0x9C, 0x8C, 0x8C, 0x8C, 0x8C, 0xCC, 0xF8, 0xF8, 0x70, 0x00, 0x30, 0x30, 0x30, 0x71, 0x61, 0x61, 0x61, 0x61, 0x71, 0x3F, 0x3F, 0x1E}, - {0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x38, 0xFC, 0xFC, 0xFC, 0x00, 0x00, 0x1C, 0x1E, 0x1F, 0x1F, 0x19, 0x18, 0x18, 0x18, 0x7F, 0x7F, 0x7F, 0x18}, - {0x00, 0x00, 0xFC, 0xFC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8C, 0x0C, 0x00, 0x00, 0x18, 0x30, 0x70, 0x60, 0x60, 0x60, 0x60, 0x71, 0x7B, 0x3F, 0x1F}, - {0x00, 0xC0, 0xF0, 0xF8, 0x38, 0x9C, 0x8C, 0x8C, 0x8C, 0x8C, 0x9C, 0x38, 0x30, 0x00, 0x0F, 0x1F, 0x3F, 0x73, 0x61, 0x61, 0x61, 0x61, 0x73, 0x33, 0x3F, 0x1E}, - {0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x8C, 0xEC, 0xFC, 0x3C, 0x1C, 0x00, 0x00, 0x00, 0x40, 0x60, 0x78, 0x7C, 0x1F, 0x07, 0x03, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x78, 0xF8, 0xDC, 0x8C, 0x8C, 0x8C, 0x8C, 0xDC, 0xF8, 0x78, 0x00, 0x00, 0x1E, 0x3F, 0x3F, 0x73, 0x61, 0x61, 0x61, 0x61, 0x73, 0x3F, 0x3F, 0x1E}, - {0x00, 0xF0, 0xF8, 0xB8, 0x1C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1C, 0xB8, 0xF0, 0xE0, 0x00, 0x11, 0x33, 0x77, 0x67, 0x66, 0x66, 0x66, 0x76, 0x33, 0x3F, 0x1F, 0x07}, - {0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00} - }; - - // 6 Empty columns removed -#elif 0 - // VCR font - const uint8_t gFontBigDigits[11][26 - 6] = - { - {/*0x00, 0x00,*/ 0xF8, 0xFC, 0x06, 0x86, 0xC6, 0xE6, 0xF6, 0x76, 0xFC, 0xF8, /*0x00,*/ /*0x00, 0x00,*/ 0x1F, 0x3F, 0x77, 0x67, 0x63, 0x61, 0x60, 0x70, 0x3F, 0x1F, /*0x00*/}, - {/*0x00, 0x00,*/ 0x00, 0x00, 0x18, 0x1C, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x60, 0x60, 0x7F, 0x7F, 0x60, 0x60, 0x00, 0x00, /*0x00*/}, - {/*0x00, 0x00,*/ 0x18, 0x1C, 0x86, 0x86, 0x86, 0x86, 0x86, 0xC6, 0xFC, 0x78, /*0x00,*/ /*0x00, 0x00,*/ 0x7E, 0x7F, 0x63, 0x61, 0x61, 0x61, 0x61, 0x61, 0x60, 0x60, /*0x00*/}, - {/*0x00, 0x00,*/ 0x18, 0x1C, 0x06, 0x06, 0x86, 0x86, 0x86, 0xC6, 0xFC, 0x78, /*0x00,*/ /*0x00, 0x00,*/ 0x18, 0x38, 0x70, 0x60, 0x61, 0x61, 0x61, 0x73, 0x3F, 0x1E, /*0x00*/}, - {/*0x00, 0x00,*/ 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0xFE, 0xFE, 0x00, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 0x7F, 0x7F, 0x06, 0x06, /*0x00*/}, - {/*0x00, 0x00,*/ 0x7E, 0x7E, 0x66, 0x66, 0x66, 0x66, 0x66, 0xE6, 0xC6, 0x86, /*0x00,*/ /*0x00, 0x00,*/ 0x18, 0x38, 0x70, 0x60, 0x60, 0x60, 0x60, 0x70, 0x3F, 0x1F, /*0x00*/}, - {/*0x00, 0x00,*/ 0xF8, 0xFC, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x1C, 0x18, /*0x00,*/ /*0x00, 0x00,*/ 0x1F, 0x3F, 0x71, 0x61, 0x61, 0x61, 0x61, 0x73, 0x3F, 0x1E, /*0x00*/}, - {/*0x00, 0x00,*/ 0x06, 0x06, 0x06, 0x06, 0x06, 0x86, 0xC6, 0xE6, 0x7E, 0x3E, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x01, 0x00, 0x00, 0x00, /*0x00*/}, - {/*0x00, 0x00,*/ 0x78, 0xFC, 0xC6, 0x86, 0x86, 0x86, 0x86, 0xC6, 0xFC, 0x78, /*0x00,*/ /*0x00, 0x00,*/ 0x1E, 0x3F, 0x73, 0x61, 0x61, 0x61, 0x61, 0x73, 0x3F, 0x1E, /*0x00*/}, - {/*0x00, 0x00,*/ 0x78, 0xFC, 0xC6, 0x86, 0x86, 0x86, 0x86, 0x86, 0xFC, 0xF8, /*0x00,*/ /*0x00, 0x00,*/ 0x18, 0x38, 0x71, 0x61, 0x61, 0x61, 0x61, 0x71, 0x3F, 0x1F, /*0x00*/}, - {/*0x00, 0x00,*/ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, /*0x00*/} - }; -#else - // Terminus font - -// const uint8_t gFontBigDigits[11][26 - 6] = -// { -// {/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x06, 0x06, 0x06, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/}, -// {/*0x00, 0x00,*/ 0x00, 0x00, 0x18, 0x1C, 0xFE, 0xFE, 0xFE, 0x00, 0x00, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x60, 0x60, 0x7F, 0x7F, 0x7F, 0x60, 0x60, 0x00, /*0x00*/}, -// {/*0x00, 0x00,*/ 0x1C, 0x1E, 0x1E, 0x06, 0x06, 0x06, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x60, 0x70, 0x78, 0x7C, 0x6E, 0x67, 0x63, 0x61, 0x60, 0x60, /*0x00*/}, -// {/*0x00, 0x00,*/ 0x0C, 0x0E, 0x0E, 0x86, 0x86, 0x86, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x30, 0x70, 0x70, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x7F, 0x3E, /*0x00*/}, -// {/*0x00, 0x00,*/ 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0xFE, 0xFE, 0xFE, /*0x00,*/ /*0x00, 0x00,*/ 0x0F, 0x0F, 0x0F, 0x0C, 0x0C, 0x0C, 0x0C, 0x7F, 0x7F, 0x7F, /*0x00*/}, -// {/*0x00, 0x00,*/ 0xFE, 0xFE, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x86, /*0x00,*/ /*0x00, 0x00,*/ 0x30, 0x70, 0x70, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/}, -// {/*0x00, 0x00,*/ 0xF8, 0xFC, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x80, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x3F, /*0x00*/}, -// {/*0x00, 0x00,*/ 0x0E, 0x0E, 0x0E, 0x06, 0x06, 0x86, 0xE6, 0xFE, 0x7E, 0x1E, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x00, 0x00, 0x00, 0x7C, 0x7F, 0x7F, 0x03, 0x00, 0x00, /*0x00*/}, -// {/*0x00, 0x00,*/ 0x7C, 0xFE, 0xFE, 0x86, 0x86, 0x86, 0x86, 0xFE, 0xFE, 0x7C, /*0x00,*/ /*0x00, 0x00,*/ 0x3F, 0x7F, 0x7F, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x7F, 0x3F, /*0x00*/}, -// {/*0x00, 0x00,*/ 0xFC, 0xFE, 0xFE, 0x06, 0x06, 0x06, 0x06, 0xFE, 0xFE, 0xFC, /*0x00,*/ /*0x00, 0x00,*/ 0x01, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x7F, 0x3F, 0x1F, /*0x00*/}, -// {/*0x00, 0x00,*/ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /*0x00,*/ /*0x00, 0x00,*/ 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, /*0x00*/} -// }; -#endif -/* -const uint8_t gFontSmallDigits[11][7] = -{ - {0x00, 0x3E, 0x41, 0x41, 0x41, 0x41, 0x3E}, // '0' - {0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00}, // '1' - {0x00, 0x62, 0x51, 0x51, 0x49, 0x49, 0x46}, // '2' - {0x00, 0x22, 0x41, 0x49, 0x49, 0x4D, 0x32}, // '3' - {0x00, 0x18, 0x14, 0x12, 0x11, 0x7F, 0x10}, // '4' - {0x00, 0x27, 0x45, 0x45, 0x45, 0x45, 0x39}, // '5' - {0x00, 0x3E, 0x49, 0x49, 0x49, 0x49, 0x30}, // '6' - {0x00, 0x01, 0x71, 0x09, 0x05, 0x03, 0x00}, // '7' - {0x00, 0x36, 0x49, 0x49, 0x49, 0x49, 0x36}, // '8' - {0x00, 0x46, 0x49, 0x49, 0x49, 0x29, 0x1E}, // '9' - {0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00} // '-' -}; -*/ const uint8_t gFontSmall[95-1][6] = { // {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // ' ' @@ -483,7 +216,7 @@ const uint8_t gFontSmall[95-1][6] = }; #endif -//#ifdef ENABLE_SPECTRUM +#ifdef ENABLE_SPECTRUM // 3x5 font, only used by the spectrum const uint8_t gFont3x5[][3] = { {0x00, 0x00, 0x00}, // 32 - space @@ -651,4 +384,4 @@ const uint8_t gFontSmall[95-1][6] = // {0x03, 0x0b, 0x18}, // 190 - threequarters // {0x18, 0x15, 0x10}, // 191 - questiondown }; -//#endif +#endif diff --git a/font.h b/font.h index 8972aab..33d2fb3 100644 --- a/font.h +++ b/font.h @@ -20,9 +20,9 @@ #include -extern const uint8_t gFontBig[95 - 1][16 - 2]; -extern const uint8_t gFontBigDigits[11][26 - 6]; +#ifdef ENABLE_SPECTRUM extern const uint8_t gFont3x5[96][3]; +#endif extern const uint8_t gFontSmall[95 - 1][6]; #ifdef ENABLE_SMALL_BOLD extern const uint8_t gFontSmallBold[95 - 1][6]; diff --git a/misc.h b/misc.h index 59e0160..f5c434a 100644 --- a/misc.h +++ b/misc.h @@ -43,7 +43,7 @@ enum { MR_CHANNEL_FIRST = 0, - MR_CHANNEL_LAST = 199u, + MR_CHANNEL_LAST = 170u, // 171 memory channels, 32 byte records (settings.h EEPROM layout) FREQ_CHANNEL_FIRST = 200u, FREQ_CHANNEL_LAST = 206u, NOAA_CHANNEL_FIRST = 207u, diff --git a/radio.c b/radio.c index 51d1ee0..ad3b7f2 100644 --- a/radio.c +++ b/radio.c @@ -238,9 +238,9 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure uint16_t base; if (IS_MR_CHANNEL(channel)) - base = channel * 24; + base = EEPROM_CH_ADDR(channel); else - base = 0x0C80 + ((channel - FREQ_CHANNEL_FIRST) * 32) + (VFO * 24); + base = EEPROM_VFO_ADDR(channel - FREQ_CHANNEL_FIRST, VFO); if (configure == VFO_CONFIGURE_RELOAD || IS_FREQ_CHANNEL(channel)) { uint8_t tmp; @@ -332,11 +332,11 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure // *************** - EEPROM_ReadBuffer(base + 16, data, sizeof(data)); + EEPROM_ReadBuffer(base + 24, data, sizeof(data)); // name[8..9], scrambler uint16_t * data16 = (uint16_t *)data; - pVfo->SCRAMBLING_TYPE = data16[0]; + pVfo->SCRAMBLING_TYPE = data16[1]; struct { uint32_t Frequency; diff --git a/settings.c b/settings.c index 7977b64..52349bb 100644 --- a/settings.c +++ b/settings.c @@ -41,6 +41,12 @@ static const uint32_t gDefaultFrequencyTable[] = }; #endif +// EEPROM layout checks (see settings.h) +_Static_assert(EEPROM_CH_A_COUNT * EEPROM_CH_SIZE <= 0x0E40U, "channels overlap the settings"); +_Static_assert(EEPROM_CH_ATTR_BASE + 207U <= EEPROM_VFO_BASE, "channel attributes overlap the VFOs"); +_Static_assert(MR_CHANNEL_LAST + 1U > EEPROM_CH_A_COUNT, "channel layout expects a second channel area"); +_Static_assert(EEPROM_CH_END <= SEQParameterEEPROM, "channels overlap the message store"); + EEPROM_Config_t gEeprom = {0}; void SETTINGS_InitEEPROM(void) { @@ -137,7 +143,7 @@ void SETTINGS_InitEEPROM(void) { gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE; gEeprom.SCAN_RESUME_MODE = (Data[5] < 105) ? Data[5] : 14; gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 41) ? Data[6] : 0; - gEeprom.FSKMode = (Data[7] <= MOD_POCSAG_2400) ? Data[7] : MOD_FSK_1200; + gEeprom.FSKMode = (Data[7] <= MODEM_LAST) ? Data[7] : MOD_FSK_1200; // 0E98..0E9F #ifdef ENABLE_PWRON_PASSWORD EEPROM_ReadBuffer(0x0E98, Data, 8); @@ -265,7 +271,7 @@ void SETTINGS_InitEEPROM(void) { } // 0D60..0E27 - EEPROM_ReadBuffer(0x0D60, gMR_ChannelAttributes, sizeof(gMR_ChannelAttributes)); + EEPROM_ReadBuffer(EEPROM_CH_ATTR_BASE, gMR_ChannelAttributes, sizeof(gMR_ChannelAttributes)); for (uint16_t i = 0; i < sizeof(gMR_ChannelAttributes); i++) { ChannelAttributes_t *att = &gMR_ChannelAttributes[i]; if (att->__val == 0xff) { @@ -387,7 +393,7 @@ uint32_t SETTINGS_FetchChannelFrequency(const int channel) { uint32_t offset; } __attribute__((packed)) info; - EEPROM_ReadBuffer(channel * 20, &info, sizeof(info)); + EEPROM_ReadBuffer(EEPROM_CH_ADDR(channel), &info, sizeof(info)); return info.frequency; } @@ -404,7 +410,7 @@ void SETTINGS_FetchChannelName(char *s, const int channel) { if (!RADIO_CheckValidChannel(channel, false, 0)) return; - EEPROM_ReadBuffer(0x0F50 + (channel * 20), s, 10); + EEPROM_ReadBuffer(EEPROM_CH_ADDR(channel) + EEPROM_CH_NAME_OFFSET, s, 10); int i; for (i = 0; i < 10; i++) @@ -431,9 +437,10 @@ void SETTINGS_FactoryReset(bool bIsAll) { !(i >= 0x0EA0 && i < 0x0EA8) && // Voice Prompt (bIsAll || ( - !(i >= 0x0D60 && i < 0x0E28) && // MR Channel Attributes + !(i < 0x0E40) && // MR Channels (area A) + !(i >= EEPROM_CH_ATTR_BASE && i < EEPROM_VFO_BASE) && // MR Channel Attributes !(i >= 0x0F18 && i < 0x0F30) && // Scan List - !(i >= 0x0F50 && i < 0x1C00) && // MR Channel Names + !(i >= EEPROM_CH_B_BASE) && // MR Channels (area B) + messages !(i >= 0x0E40 && i < 0x0E70) && // FM Channels !(i >= 0x0E88 && i < 0x0E90) // FM settings )) @@ -724,11 +731,10 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, return; #endif - uint16_t OffsetVFO = Channel * 24; + uint16_t OffsetVFO = EEPROM_CH_ADDR(Channel); if (IS_FREQ_CHANNEL(Channel)) { // it's a VFO, not a channel - OffsetVFO = (VFO == 0) ? 0x0C80 : 0x0C98; - OffsetVFO += (Channel - FREQ_CHANNEL_FIRST) * 32; + OffsetVFO = EEPROM_VFO_ADDR(Channel - FREQ_CHANNEL_FIRST, VFO); } if (Mode >= 2 || IS_FREQ_CHANNEL(Channel)) { // copy VFO to a channel @@ -756,8 +762,10 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, State._8[6] = pVFO->STEP_SETTING; EEPROM_WriteBuffer(OffsetVFO + sizeof (State._32), State._8); - State._16[0] = pVFO->SCRAMBLING_TYPE; - EEPROM_WriteBuffer(OffsetVFO + sizeof (State._32) + sizeof (State._8), State._16); + // +24 block: name[8..9] (kept), scrambler, spare + EEPROM_ReadBuffer(OffsetVFO + 24, State._8, sizeof(State._8)); + State._16[1] = pVFO->SCRAMBLING_TYPE; + EEPROM_WriteBuffer(OffsetVFO + 24, State._8); SETTINGS_UpdateChannel(Channel, pVFO, true, true, true); @@ -786,11 +794,16 @@ void SETTINGS_SaveBatteryCalibration(const uint16_t *batteryCalibration) { } void SETTINGS_SaveChannelName(uint8_t channel, const char *name) { - uint16_t offset = channel * 24; + // name[0..7] at +16, name[8..9] at +24 (the rest of that block is the scrambler) + const uint16_t offset = EEPROM_CH_ADDR(channel) + EEPROM_CH_NAME_OFFSET; uint8_t buf[16] = {0}; memcpy(buf, name, MIN(strlen(name), 10u)); - EEPROM_WriteBuffer(0x0F50 + offset, buf); - EEPROM_WriteBuffer(0x0F58 + offset, buf + 8); + EEPROM_WriteBuffer(offset, buf); + uint8_t tail[8]; + EEPROM_ReadBuffer(offset + 8, tail, sizeof(tail)); + tail[0] = buf[8]; + tail[1] = buf[9]; + EEPROM_WriteBuffer(offset + 8, tail); } void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, bool check, bool save) { @@ -807,7 +820,7 @@ void SETTINGS_UpdateChannel(uint8_t channel, const VFO_Info_t *pVFO, bool keep, .scanlist3 = 0, }; // default attributes - uint16_t offset = 0x0D60 + (channel & ~7u); + uint16_t offset = EEPROM_CH_ATTR_BASE + (channel & ~7u); EEPROM_ReadBuffer(offset, state, sizeof(state)); if (keep) { @@ -921,8 +934,8 @@ void SETTINGS_WriteCurrentVol(void) { void SETTINGS_ResetTxLock(void) { uint8_t State[8]; - for (uint8_t channel = 0; channel < 200; channel++) { - uint16_t OffsetVFO = channel * 24; + for (uint8_t channel = MR_CHANNEL_FIRST; channel <= MR_CHANNEL_LAST; channel++) { + uint16_t OffsetVFO = EEPROM_CH_ADDR(channel); EEPROM_ReadBuffer(OffsetVFO + 8, State, sizeof(State)); State[4] |= (1 << 6); EEPROM_WriteBuffer(OffsetVFO + 8, State); diff --git a/settings.h b/settings.h index 15f515b..5e1c504 100644 --- a/settings.h +++ b/settings.h @@ -27,6 +27,31 @@ #include "app/fskmodem.h" #include +// ---- 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 diff --git a/ui/menu.c b/ui/menu.c index c4ec254..046e494 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -87,7 +87,9 @@ const t_menu_item MenuList[] = {"ChDisp", MENU_MDF}, // was "MDF" {"FSKMod", MENU_FSKMOD}, {"FSKSRC", MENU_FSKSRC}, // was "AUTOLk" +#ifdef ENABLE_POCSAG {"PocMon", MENU_PMON}, // POCSAG monitor: receive all RICs +#endif {"BLTime", MENU_ABR}, // was "ABR" {"BLMin", MENU_ABR_MIN}, {"BLMax", MENU_ABR_MAX}, @@ -235,9 +237,11 @@ const char gSubMenu_FSKMod[][8] = "A1200", "A2400", "NOAA", +#ifdef ENABLE_POCSAG "PCS1200", "PCS512", "PCS2400" +#endif }; const char gSubMenu_ROGER[][6] = diff --git a/ui/menu.h b/ui/menu.h index 615c83a..4bb77ab 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -145,7 +145,11 @@ extern const char gSubMenu_SET_PTT[2][4]; #endif extern const char *const gSubMenu_PTT_ID[5]; +#ifdef ENABLE_POCSAG extern const char gSubMenu_FSKMod[10][8]; +#else +extern const char gSubMenu_FSKMod[7][8]; +#endif extern const char gSubMenu_ROGER[3][6]; extern const char gSubMenu_RESET[2][4]; extern const char *const gSubMenu_F_LOCK[F_LOCK_LEN]; diff --git a/ui/messages.c b/ui/messages.c index f887135..82d329c 100644 --- a/ui/messages.c +++ b/ui/messages.c @@ -37,7 +37,7 @@ static void UI_PrintWrapped(const char *text, const uint8_t line, const uint8_t } void UI_DisplayMessages(void) { - char String[19]; + char String[24]; UI_DisplayClear(); if (gEnteringSMS != SMS_NOT_ENTERING) { if (gEnteringSMS == SMS_ENTERING_DEST) { @@ -76,8 +76,12 @@ void UI_DisplayMessages(void) { MESSAGES_GET(); // header: sender (POCSAG: "P:" + RIC), sequence, position in the list, EEPROM slot - sprintf(String, (loadedPacket.flags & MESSAGE_FLAG_POCSAG) ? "P:%07lu -%03u-%X-%X" : "%010lu-%03u-%X-%X", - (unsigned long) loadedPacket.src, loadedPacket.seq, ixa + pageOffset, gActiveMessage); + // header (max 18 chars): POCSAG "P: #nn", SMS "
s #nn" + if (loadedPacket.flags & MESSAGE_FLAG_POCSAG) + sprintf(String, "P:%07lu #%02u", (unsigned long) loadedPacket.src, ixa + pageOffset + 1U); + else + sprintf(String, "%08lu s%03u #%02u", (unsigned long) (loadedPacket.src % 100000000UL), + loadedPacket.seq, ixa + pageOffset + 1U); // header line, then the text wrapped over MESSAGES_TEXT_LINES lines const uint8_t line = ixa * (1U + MESSAGES_TEXT_LINES); diff --git a/ui/ui.c b/ui/ui.c index 7b09d6f..ed2ec29 100644 --- a/ui/ui.c +++ b/ui/ui.c @@ -40,7 +40,9 @@ #include "ui/ui.h" #include "../misc.h" #include "messages.h" +#ifdef ENABLE_OOK_SENDER #include "ooksender.h" +#endif GUI_DisplayType_t gScreenToDisplay; GUI_DisplayType_t gRequestDisplayScreen = DISPLAY_INVALID; @@ -55,7 +57,9 @@ void (*UI_DisplayFunctions[])(void) = { [DISPLAY_MENU] = &UI_DisplayMenu, [DISPLAY_SCANNER] = &UI_DisplayScanner, [DISPLAY_MESSAGES] = &UI_DisplayMessages, +#ifdef ENABLE_OOK_SENDER [DISPLAY_OOKSENDER] = &OOKSENDER_Display, +#endif #ifdef ENABLE_FMRADIO [DISPLAY_FM] = &UI_DisplayFM, diff --git a/ui/welcome.c b/ui/welcome.c index e2c09d8..152541b 100644 --- a/ui/welcome.c +++ b/ui/welcome.c @@ -55,7 +55,9 @@ void UI_DisplayWelcome(void) { UI_DrawLineBuffer(gFrameBuffer, 0, 31, 127, 31, 1); // Be ware, status zone = 8 lines, the rest = 56 ->total 64 - for (uint8_t i = 18; i < 110; i++) { + // firmware name in an inverted bar + UI_PrintStringSmallNormal(Version, 0, 127, 4); + for (uint8_t i = 0; i < 128; i++) { gFrameBuffer[4][i] ^= 0xFF; } diff --git a/version.c b/version.c index 66599ae..bb875f0 100644 --- a/version.c +++ b/version.c @@ -6,7 +6,9 @@ #endif #ifdef ENABLE_FEAT_F4HWN - const char Version[] = AUTHOR_STRING_2 " " VERSION_STRING_2; + // reported to CHIRP: a distinct name, because this fork has its own EEPROM layout + // (chirp/uvk5_brnpocsag.py); F4HWN / egzumer drivers must not accept it + const char Version[] = "BRN-POCSAG " VERSION_STRING_2; #else const char Version[] = AUTHOR_STRING VER; #endif