summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/stm32/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/stm32/main.c b/examples/stm32/main.c
index ebf90b6..7fbcfd7 100644
--- a/examples/stm32/main.c
+++ b/examples/stm32/main.c
@@ -29,21 +29,24 @@
* the UART functions match perfectly and can be directly mapped to the Modbus
* library functions
*/
-MB_StatusTypeDef (*MB_UART_Tx)(void*, uint16_t*, uint8_t*, uint8_t*) = &HAL_UART_Transmit;
-MB_StatusTypeDef (*MB_UART_Rx)(void*, uint16_t*, uint8_t*, uint8_t*) = &HAL_UART_Receive;
+MB_StatusTypeDef (*MB_UART_Tx)(void*, uint16_t*, uint8_t*, uint8_t*) =
+ &HAL_UART_Transmit;
+MB_StatusTypeDef (*MB_UART_Rx)(void*, uint16_t*, uint8_t*, uint8_t*) =
+ &HAL_UART_Receive;
int main()
{
/* Single modbus device node */
modbus_slave_device modbus_dev_single;
- /* Multiple modbus device nodes.. after all, what is the point of using Modbus in a single point-to-point connection? */
+ /* Multiple modbus device nodes.. after all, what is the point of using
+ * Modbus in a single point-to-point connection? */
/* Not illustrated beyond the definition, but should be clear enough */
modbus_slave_device modbus_dev_multiple[10];
/* Set the slave ID to 1 */
modbus_dev_single.slave_id = 1;
/* Attach the UART device on the STM32 to this node */
- /* Note that the initialization of UART1 device is not included in this example */
+ /* Note that initialization of UART1 is not included in this example */
modbus_dev_single.modbus_uart = &huart1;
/* Continuously read the 30001 input register */
uint16_t register = 30001;