diff --git a/protocol.hpp b/protocol.hpp index 3ebe7cf..e425dba 100644 --- a/protocol.hpp +++ b/protocol.hpp @@ -1,7 +1,7 @@ #pragma once -#include "protocol\cmdid.hpp" -#include "protocol\errorcode.hpp" -#include "protocol\packet.hpp" -#include "protocol\reg_index.hpp" +#include "protocol/cmdid.hpp" +#include "protocol/errorcode.hpp" +#include "protocol/packet.hpp" +#include "protocol/reg_index.hpp" // -#include "protocol\zmotor_struct.hpp" +#include "protocol/zmotor_struct.hpp" diff --git a/protocol/packet.hpp b/protocol/packet.hpp index 481ba23..bfe4a09 100644 --- a/protocol/packet.hpp +++ b/protocol/packet.hpp @@ -40,8 +40,8 @@ typedef enum { } zcan_cmd_packet_type_t; static inline bool zcr_cmd_checkpacket(const zcr_cmd_header_t* header, int len) { - if (len < sizeof(zcr_cmd_header_t)) return false; - if ((header->datalen + sizeof(zcr_cmd_header_t) + 1) != len) return false; + if (len < (int)sizeof(zcr_cmd_header_t)) return false; + if ((int)(header->datalen + sizeof(zcr_cmd_header_t) + 1) != len) return false; uint8_t checksum = 0; for (int i = 0; i < len - 1; i++) checksum += ((uint8_t*)header)[i];