Features: - VFO mode with direct frequency input - POCSAG decoder (512/1200 baud) with BCH(31,21) correction - Full-screen Spectrum analyzer - FM Radio receiver - RSSI signal indicator overlay - Custom boot splash (UA1ZBE / POCSAG pager / build date) Architecture: - app/mode.c — mode dispatcher (VFO/POCSAG/Spectrum/FM) - app/boot_splash.c — 2-second boot splash - app/pocsag/ — POCSAG decoder + BCH correction - app/display_rssi.c — RSSI indicator - main.c — entry point with custom init - syscalls.c — bare-metal _sbrk stub Build: arm-none-eabi-gcc -Os -flto -Wall -Werror -Wextra Size: 57.9KB Flash / 3.6KB RAM Controls: - 0-9: Direct frequency input (VFO) - SK2: POCSAG mode - SK1: Spectrum analyzer - 0: FM Radio - EXIT: Return to VFO - F/*: Toggle 512/1200 baud (in POCSAG)
61 lines
2.0 KiB
C
61 lines
2.0 KiB
C
|
|
#include "cmsis_os.h" // CMSIS RTOS header file
|
|
|
|
/*----------------------------------------------------------------------------
|
|
* Timer: Sample timer functions
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
|
|
/*----- One-Shoot Timer Example -----*/
|
|
static void Timer1_Callback (void const *arg); // prototype for timer callback function
|
|
|
|
static osTimerId id1; // timer id
|
|
static uint32_t exec1; // argument for the timer call back function
|
|
static osTimerDef (Timer1, Timer1_Callback); // define timers
|
|
|
|
// One-Shoot Timer Function
|
|
static void Timer1_Callback (void const *arg) {
|
|
// add user code here
|
|
}
|
|
|
|
|
|
/*----- Periodic Timer Example -----*/
|
|
static void Timer2_Callback (void const *arg); // prototype for timer callback function
|
|
|
|
static osTimerId id2; // timer id
|
|
static uint32_t exec2; // argument for the timer call back function
|
|
static osTimerDef (Timer2, Timer2_Callback);
|
|
|
|
// Periodic Timer Example
|
|
static void Timer2_Callback (void const *arg) {
|
|
// add user code here
|
|
}
|
|
|
|
|
|
// Example: Create and Start timers
|
|
void Init_Timers (void) {
|
|
osStatus status; // function return status
|
|
|
|
// Create one-shoot timer
|
|
exec1 = 1;
|
|
id1 = osTimerCreate (osTimer(Timer1), osTimerOnce, &exec1);
|
|
if (id1 != NULL) { // One-shot timer created
|
|
// start timer with delay 100ms
|
|
status = osTimerStart (id1, 100);
|
|
if (status != osOK) {
|
|
// Timer could not be started
|
|
}
|
|
}
|
|
|
|
// Create periodic timer
|
|
exec2 = 2;
|
|
id2 = osTimerCreate (osTimer(Timer2), osTimerPeriodic, &exec2);
|
|
if (id2 != NULL) { // Periodic timer created
|
|
// start timer with periodic 1000ms interval
|
|
status = osTimerStart (id2, 1000);
|
|
if (status != osOK) {
|
|
// Timer could not be started
|
|
}
|
|
}
|
|
}
|