Files
uv-k5-ua1zbe-firmware/external/CMSIS_5/CMSIS/DAP/Firmware/Validation/MDK5/test.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

90 lines
2.5 KiB
C

/*
* Copyright (c) 2013-2017 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ----------------------------------------------------------------------
*
* $Date: 1. December 2017
* $Revision: V2.0.0
*
* Project: CMSIS-DAP Validation
* Title: test.c CMSIS-DAP debug unit test module
*
*---------------------------------------------------------------------------*/
// Debug Variables
volatile int test_state = 0;
volatile int test_success = 0;
volatile int bpTestCounter = 0;
volatile char mem_rw_success = 0;
int test_array1[256] = {0};
int test_array2[256] = {0};
// Breakpoint Test function
static void BP_Test (void) {
int i;
for (i = 0; i < 10; i++) {
// increment counter so we know on which iteration breakpoint is hit
bpTestCounter++;
test_state++;
}
}
// Test function
static void Test(void) {
int i;
test_state++; // 'test_state' = 11
i = test_success; // 'test_success' read access
test_state++; // 'test_state' = 12
test_success = i; // 'test_success' write access
test_state++; // 'test_state' = 13
// test_array1 should have already been written by debugger
// copy test_array1 into test_array2 for future comparison
mem_rw_success = 1; // assume all values were written correctly
for (i = 0; i < 256; i++) {
if (test_array1[i] != (0x1000+i)) {
mem_rw_success = 0;
}
test_array2[i] = test_array1[i];
}
test_state++; // 'test_state' = 14
test_state++; // 'test_state' = 15
test_state++; // 'test_state' = 16
// execute 'test_state -= 16' from debugger
test_state++; // 'test_state' = 1
if (test_state == 1) {
test_success = 1;
} else {
test_success = 0;
}
}
// 'main' function
int main (void) {
BP_Test();
Test();
for (;;) {};
}