From ffb17b4a1a68770d0f044d54e483c1d4bf19b318 Mon Sep 17 00:00:00 2001 From: Jan Mrna Date: Fri, 17 Jun 2022 12:14:13 +0200 Subject: [PATCH] Fixed warnings --- modbus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modbus.c b/modbus.c index ddf37b6..1b03d13 100644 --- a/modbus.c +++ b/modbus.c @@ -157,6 +157,8 @@ static int8_t modbus_transaction_to_buffer(uint8_t *buffer, uint8_t *msg_len, mo *msg_len = modbus_fill_device_id_objects(buffer+buffer_pos, transaction); *msg_len += 7; /* includes 2 bytes for CRC */ break; + default: + break; } } crc16 = modbus_CRC16(buffer, buffer_pos); /* last two bytes is the checksum itself */ @@ -240,7 +242,9 @@ static int8_t modbus_process_read_write_request(const uint8_t *buffer, int len, case MODBUS_WRITE_MULTIPLE_AO: case MODBUS_READ_WRITE_MULTIPLE_REGISTERS: transaction->register_number = MODBUS_AO_START_NUMBER; - break; + break; + default: + break; } #define MODBUS_FLAG_WRITE 0x01