alejoseb / Modbus-STM32-HAL-FreeRTOS

Modbus TCP and RTU, Master and Slave for STM32 using Cube HAL and FreeRTOS
GNU Lesser General Public License v2.1
519 stars 182 forks source link

~typo~ Supporting STM32G0 #74

Closed coratron closed 6 months ago

coratron commented 1 year ago

line 1576 of Modbus.c should be changed to:

while((modH->port->Instance->ISR & USART_ISR_TC) ==0 )

from

while((modH->port->Instance->SR & USART_SR_TC) ==0 )

(At least for STM32G0)

alejoseb commented 1 year ago

Hi, This is not a typo. Simply it requires updating the pre-processor directive according to the MCU family. Please consider submitting a pull request adding that MCU family. It should be something like this https://github.com/alejoseb/Modbus-STM32-HAL-FreeRTOS/pull/75/files/ddc474629f73a776debf0862f8cacf8ab8442d7b

coratron commented 1 year ago

Sounds good - I will submit a PR, it's a simple addition and I can confirm it is working.