Changeset 26 for trunk/fw_g473rct/SES/src/modbus.c
- Timestamp:
- Sep 8, 2025, 6:57:30 PM (7 weeks ago)
- File:
-
- 1 edited
-
trunk/fw_g473rct/SES/src/modbus.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fw_g473rct/SES/src/modbus.c
r24 r26 34 34 #define ILLEGAL_DATA_VALUE 0x03 35 35 #define SLAVE_DEVICE_FAILURE 0x04 36 #define SERVER_FAILURE 0x0436 #define SERVER_FAILURE 0x04 37 37 #define ACKNOWLEDGE 0x05 38 38 #define SLAVE_DEVICE_BUSY 0x06 … … 41 41 #define MEMORY_PARITY_ERROR 0x08 42 42 #define GATEWAY_PROBLEM_PATH 0x0A 43 #define GATEWAY_PROBLEM_TARGET 0x0B43 #define GATEWAY_PROBLEM_TARGET 0x0B 44 44 45 45 /* Local Error codes */ … … 185 185 186 186 HAL_UART_EnableReceiverTimeout( usart); 187 HAL_UART_ReceiverTimeout_Config(usart, 3.5 * nrOfBitsPerChar); 187 if (baudrate <= 19200) 188 { 189 HAL_UART_ReceiverTimeout_Config(usart, 3.5 * nrOfBitsPerChar); 190 } 191 else 192 { 193 uint32_t fixedDelayInBitDurations = (FAST_BAUDRATE_INTERFRAME_DELAY_us * baudrate) / 1000000UL + 1UL; 194 HAL_UART_ReceiverTimeout_Config(usart, fixedDelayInBitDurations); 195 } 196 197 188 198 SET_BIT(usart->Instance->CR1, USART_CR1_RTOIE); 189 199
Note: See TracChangeset
for help on using the changeset viewer.
