Merge branch 'master' into mqtt

This commit is contained in:
Jonathan Naylor 2024-08-01 12:55:06 +01:00
commit 65c51bf849
3 changed files with 14 additions and 12 deletions

View File

@ -100,6 +100,9 @@
// Use the modem as a serial repeater for Nextion displays // Use the modem as a serial repeater for Nextion displays
#define SERIAL_REPEATER #define SERIAL_REPEATER
// Set the baud rate of the modem serial repeater for Nextion displays
#define SERIAL_REPEATER_BAUD_RATE 9600
// Use the modem as an I2C repeater for OLED displays // Use the modem as an I2C repeater for OLED displays
// #define I2C_REPEATER // #define I2C_REPEATER

View File

@ -42,8 +42,7 @@ class CFMDirectFormI
public: public:
// convenience function which takes the a0 argument but ignores it! // convenience function which takes the a0 argument but ignores it!
CFMDirectFormI(const q31_t b0, const q31_t b1, const q31_t b2, CFMDirectFormI(const q31_t b0, const q31_t b1, const q31_t b2, const q31_t, const q31_t a1, const q31_t a2)
const q31_t, const q31_t a1, const q31_t a2)
{ {
// FIR coefficients // FIR coefficients
c_b0 = b0; c_b0 = b0;
@ -83,11 +82,7 @@ public:
inline q15_t filter(const q15_t in) inline q15_t filter(const q15_t in)
{ {
// calculate the output // calculate the output
register q31_t out_upscaled = c_b0 * in q31_t out_upscaled = c_b0 * in + c_b1 * m_x1 + c_b2 * m_x2 - c_a1 * m_y1 - c_a2 * m_y2;
+ c_b1 * m_x1
+ c_b2 * m_x2
- c_a1 * m_y1
- c_a2 * m_y2;
q15_t out = __SSAT(out_upscaled >> 15, 15); q15_t out = __SSAT(out_upscaled >> 15, 15);

View File

@ -896,8 +896,12 @@ void CSerialPort::start()
beginInt(1U, SERIAL_SPEED); beginInt(1U, SERIAL_SPEED);
#if defined(SERIAL_REPEATER) #if defined(SERIAL_REPEATER)
#if defined(SERIAL_REPEATER_BAUD_RATE)
beginInt(3U, SERIAL_REPEATER_BAUD_RATE);
#else
beginInt(3U, 9600); beginInt(3U, 9600);
#endif #endif
#endif
#if defined(I2C_REPEATER) #if defined(I2C_REPEATER)
beginInt(10U, 9600); beginInt(10U, 9600);
#endif #endif