From 5d987969a9ac5ba3641eefa963993786b7aae7f7 Mon Sep 17 00:00:00 2001 From: Shawn Chain Date: Tue, 13 Sep 2022 20:18:03 +0800 Subject: [PATCH] The AX25 sine value ranges from 0-4095, and inside io.write() will perform the calculation (value * q15_t(txLevel) >> 15) which may exceed 4096 and cause the DAC Overflow error --- AX25TX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AX25TX.cpp b/AX25TX.cpp index a844c25..aacc05a 100644 --- a/AX25TX.cpp +++ b/AX25TX.cpp @@ -160,7 +160,7 @@ void CAX25TX::writeBit(bool b) m_tablePtr += 11U; } - buffer[i] = value; + buffer[i] = value >> 1; if (m_tablePtr >= AUDIO_TABLE_LEN) m_tablePtr -= AUDIO_TABLE_LEN;