radio_tx_burst(): captures current slot, calls fhss_next_channel() to
advance the sequence, sets channel, transmits ptt_frame_t, then holds
the dwell window via TIMER0 so the receiver has the full 2 ms to listen.
radio_rx_burst(): advances to the same channel, enables RX, waits for
EVENTS_END or TIMER0 COMPARE0 expiry. On a valid CRC the ptt_frame_t
is returned; caller syncs FHSS with fhss_set_slot(frame.slot + 1).
TIMER0: configured once in radio_init() (MODE=Timer, BITMODE=16-bit,
PRESCALER=4 -> 1 MHz tick, CC[0]=2000 -> 2 ms, COMPARE0_STOP shortcut).
fhss.c: replace zero key with a non-trivial 128-bit value; add
fhss_set_slot() and fhss_get_slot() for RX synchronisation.
power.c: add BUTTON_ACTIVE_LOW flag (default 1 = pull-up + GND button);
configure PIN_CNF accordingly; implement power_button_pressed() via
NRF_P0->IN.
regs.h: add gpio_pin_cnf_t with GPIO_PULL_* constants.
main.c: tight PTT loop -- radio_tx_burst() while button held, otherwise
radio_rx_burst() with slot sync on reception. No WFI in RX mode.
Doxygen:
- Doxyfile: minimal config, HTML output to docs/, no LaTeX
- @file/@brief on all source files, full @param/@return on public API
- docs/ added to .gitignore
clang-format (14, Linux brace style, 4-space, column 100):
- .clang-format added
- Applied to entire codebase; this commit is the canonical baseline
- just format rewrites in-place; just format-check is the CI gate
cppcheck (--enable=warning,style,performance,portability):
- Linker-symbol pointer comparisons in startup.c suppressed with
inline cppcheck-suppress (false positives, not real bugs)
- just lint runs cppcheck; zero warnings required to pass
Dockerfile gains clang-format, cppcheck, doxygen packages so all
tools run inside the existing container -- host stays clean.
Gitea Actions (.gitea/workflows/ci.yml):
- Four parallel jobs: build, format, lint, docs
- All jobs use the same Dockerfile-based image
- Doxygen job fails on any warning line in output
radio_init() configures RADIO in NRF_1Mbit proprietary mode: 8-bit
length field, 4-byte address (BASE0+PREFIX0), 2-byte CRC-16/CCITT,
0 dBm TX power, channel 20 (2420 MHz). READY->START and END->DISABLE
shortcuts let radio_tx() trigger the full ramp-up/TX/disable sequence
by writing TASKS_TXEN once, then polling EVENTS_END.
main.c sends a fixed 4-byte test frame on every button press.
FHSS and AES remain compiled but are not called.
New bitfield unions in regs.h: radio_pcnf0_t, radio_pcnf1_t,
radio_crccnf_t, radio_shorts_t.