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)
This commit is contained in:
64
external/CMSIS_5/CMSIS/RTOS2/RTX/Template/MsgQueue.c
vendored
Normal file
64
external/CMSIS_5/CMSIS/RTOS2/RTX/Template/MsgQueue.c
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
#include "cmsis_os2.h" // CMSIS RTOS header file
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Message Queue creation & usage
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define MSGQUEUE_OBJECTS 16 // number of Message Queue Objects
|
||||
|
||||
typedef struct { // object data type
|
||||
uint8_t Buf[32];
|
||||
uint8_t Idx;
|
||||
} MSGQUEUE_OBJ_t;
|
||||
|
||||
osMessageQueueId_t mid_MsgQueue; // message queue id
|
||||
|
||||
osThreadId_t tid_Thread_MsgQueue1; // thread id 1
|
||||
osThreadId_t tid_Thread_MsgQueue2; // thread id 2
|
||||
|
||||
void Thread_MsgQueue1 (void *argument); // thread function 1
|
||||
void Thread_MsgQueue2 (void *argument); // thread function 2
|
||||
|
||||
int Init_MsgQueue (void) {
|
||||
|
||||
mid_MsgQueue = osMessageQueueNew(MSGQUEUE_OBJECTS, sizeof(MSGQUEUE_OBJ_t), NULL);
|
||||
if (mid_MsgQueue == NULL) {
|
||||
; // Message Queue object not created, handle failure
|
||||
}
|
||||
|
||||
tid_Thread_MsgQueue1 = osThreadNew(Thread_MsgQueue1, NULL, NULL);
|
||||
if (tid_Thread_MsgQueue1 == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
tid_Thread_MsgQueue2 = osThreadNew(Thread_MsgQueue2, NULL, NULL);
|
||||
if (tid_Thread_MsgQueue2 == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void Thread_MsgQueue1 (void *argument) {
|
||||
MSGQUEUE_OBJ_t msg;
|
||||
|
||||
while (1) {
|
||||
; // Insert thread code here...
|
||||
msg.Buf[0] = 0x55U; // do some work...
|
||||
msg.Idx = 0U;
|
||||
osMessageQueuePut(mid_MsgQueue, &msg, 0U, 0U);
|
||||
osThreadYield(); // suspend thread
|
||||
}
|
||||
}
|
||||
|
||||
void Thread_MsgQueue2 (void *argument) {
|
||||
MSGQUEUE_OBJ_t msg;
|
||||
osStatus_t status;
|
||||
|
||||
while (1) {
|
||||
; // Insert thread code here...
|
||||
status = osMessageQueueGet(mid_MsgQueue, &msg, NULL, 0U); // wait for message
|
||||
if (status == osOK) {
|
||||
; // process data
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user