Files
uv-k5-ua1zbe-firmware/external/CMSIS_5/CMSIS/RTOS2/RTX/Template/Timer.c
ua1zbe a1206d6fd4 UA1ZBE Custom Firmware v1.0
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)
2026-04-12 00:44:05 +03:00

52 lines
1.6 KiB
C

#include "cmsis_os2.h" // CMSIS RTOS header file
/*----------------------------------------------------------------------------
* Timer: Sample timer functions
*---------------------------------------------------------------------------*/
/*----- One-Shoot Timer Example -----*/
osTimerId_t tim_id1; // timer id
static uint32_t exec1; // argument for the timer call back function
// One-Shoot Timer Function
static void Timer1_Callback (void const *arg) {
// add user code here
}
/*----- Periodic Timer Example -----*/
osTimerId_t tim_id2; // timer id
static uint32_t exec2; // argument for the timer call back function
// Periodic Timer Function
static void Timer2_Callback (void const *arg) {
// add user code here
}
// Example: Create and Start timers
int Init_Timers (void) {
osStatus_t status; // function return status
// Create one-shoot timer
exec1 = 1U;
tim_id1 = osTimerNew((osTimerFunc_t)&Timer1_Callback, osTimerOnce, &exec1, NULL);
if (tim_id1 != NULL) { // One-shot timer created
// start timer with delay 100ms
status = osTimerStart(tim_id1, 100U);
if (status != osOK) {
return -1;
}
}
// Create periodic timer
exec2 = 2U;
tim_id2 = osTimerNew((osTimerFunc_t)&Timer2_Callback, osTimerPeriodic, &exec2, NULL);
if (tim_id2 != NULL) { // Periodic timer created
// start timer with periodic 1000ms interval
status = osTimerStart(tim_id2, 1000U);
if (status != osOK) {
return -1;
}
}
return NULL;
}