diff --git a/include/hydrolink/protocol.h b/include/hydrolink/protocol.h index 4ae4311..37b425f 100644 --- a/include/hydrolink/protocol.h +++ b/include/hydrolink/protocol.h @@ -21,6 +21,7 @@ typedef struct { * @param msg_id the message's id * @param crc[out] the crc_extra byte as output of this function * @return Return 1 if successfull, 0 otherwise. +**/ static inline uint8_t hydrolink_get_crc_extra(uint8_t msg_id, uint8_t *crc) { static const hydrolink_crc_extra_t crcs[] = HYDROLINK_MSG_CRCS; uint8_t left = 0; @@ -35,7 +36,7 @@ static inline uint8_t hydrolink_get_crc_extra(uint8_t msg_id, uint8_t *crc) { left = center; continue; } - left = mid; + left = center; break; } if (crcs[left].msg_id != msg_id) {