diff --git a/.gitignore b/.gitignore index 082d17a..ac00791 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ bin/ GitVersion\.h + +STM32F10X_Lib/ diff --git a/Config.h b/Config.h index 3fdec76..79902fd 100644 --- a/Config.h +++ b/Config.h @@ -58,8 +58,10 @@ // Send RSSI value: // #define SEND_RSSI_DATA -// Enable Nextion LCD serial port repeater: +// Enable Nextion LCD serial port repeater on USART2: // #define SERIAL_REPEATER +// Enable Nextion LCD serial port repeater on USART1 (not compatible with ZUM-Spot Libre or STM32_USART1_HOST): +// #define SERIAL_REPEATER_USART1 // Enable P25 Wide modulation // #define ENABLE_P25_WIDE diff --git a/IOArduino.cpp b/IOArduino.cpp index a74a324..4be1dc3 100644 --- a/IOArduino.cpp +++ b/IOArduino.cpp @@ -85,7 +85,7 @@ #define PIN_COS_LED PB15 #else -#error "Either PI_HAT_7021_REV_02, PI_HAT_7021_REV_03, or ADF7021_CARRIER_BOARD need to be defined" +#error "Either PI_HAT_7021_REV_02, PI_HAT_7021_REV_03 or ADF7021_CARRIER_BOARD need to be defined" #endif #elif defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) diff --git a/IOSTM.cpp b/IOSTM.cpp index 7abfb33..90b2c85 100644 --- a/IOSTM.cpp +++ b/IOSTM.cpp @@ -197,7 +197,7 @@ #define PORT_COS_LED GPIOB #else -#error "Either PI_HAT_7021_REV_02, PI_HAT_7021_REV_03, or ADF7021_CARRIER_BOARD need to be defined" +#error "Either PI_HAT_7021_REV_02, PI_HAT_7021_REV_03 or ADF7021_CARRIER_BOARD need to be defined" #endif extern "C" { diff --git a/SerialSTM.cpp b/SerialSTM.cpp index e02ea81..9397299 100644 --- a/SerialSTM.cpp +++ b/SerialSTM.cpp @@ -44,7 +44,7 @@ USART2 - TXD PA2 - RXD PA3 #define TX_SERIAL_FIFO_SIZE 256U #define RX_SERIAL_FIFO_SIZE 256U -#if defined(STM32_USART1_HOST) +#if defined(STM32_USART1_HOST) || defined(SERIAL_REPEATER_USART1) extern "C" { void USART1_IRQHandler(); @@ -443,6 +443,10 @@ void CSerialPort::beginInt(uint8_t n, int speed) case 3U: InitUSART2(speed); break; + #elif defined(SERIAL_REPEATER_USART1) + case 3U: + InitUSART1(speed); + break; #endif default: break; @@ -461,6 +465,9 @@ int CSerialPort::availableInt(uint8_t n) #if defined(SERIAL_REPEATER) case 3U: return AvailUSART2(); + #elif defined(SERIAL_REPEATER_USART1) + case 3U: + return AvailUSART1(); #endif default: return 0; @@ -479,6 +486,9 @@ uint8_t CSerialPort::readInt(uint8_t n) #if defined(SERIAL_REPEATER) case 3U: return ReadUSART2(); + #elif defined(SERIAL_REPEATER_USART1) + case 3U: + return ReadUSART1(); #endif default: return 0U; @@ -505,6 +515,12 @@ void CSerialPort::writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool if (flush) TXSerialFlush2(); break; + #elif defined(SERIAL_REPEATER_USART1) + case 3U: + WriteUSART1(data, length); + if (flush) + TXSerialFlush1(); + break; #endif default: break;