From a8ab17013f69217dcd6d2e15ffd9e21b28a0f4b7 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Tue, 25 Jun 2024 03:14:43 -0700 Subject: [PATCH] Switch to FM transmitter sweep --- ch32v/ch32v003-timer/nonlora.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ch32v/ch32v003-timer/nonlora.c b/ch32v/ch32v003-timer/nonlora.c index c6632b9..dc9b82a 100644 --- a/ch32v/ch32v003-timer/nonlora.c +++ b/ch32v/ch32v003-timer/nonlora.c @@ -48,7 +48,7 @@ SOFTWARE. // NOT LORA!!! // Transmit a sweep on 97.7MHz -//#define FM_TRANSMITTER_SWEEP +#define FM_TRANSMITTER_SWEEP // Nothing = Transmit a 315MHz signal. @@ -376,7 +376,9 @@ void LoopFunction2() { #ifdef FM_TRANSMITTER_SWEEP // 97.7MHz FM Station - uint32_t cp = ((SysTick->CNT>>3)&0x3fff)+0x12900; + int notein = (SysTick->CNT>>4)&0x3fff; + if( notein > 0x1fff ) notein = 0x4000-notein; + uint32_t cp = (notein)+0x12900; #else // 315MHz uint32_t cp = 0x1bfc3;