From 8bf6263cbf36c27533c1d24dbbd183dc2ad91533 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 13 Jun 2021 12:45:51 +0200 Subject: OBD: avoid compilation warnings --- libraries/OBD/OBD.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/OBD/OBD.cpp b/libraries/OBD/OBD.cpp index 92b9bdf..03a13d4 100644 --- a/libraries/OBD/OBD.cpp +++ b/libraries/OBD/OBD.cpp @@ -562,7 +562,7 @@ void COBDI2C::end() void COBDI2C::write(const char* s) { - COMMAND_BLOCK cmdblock = {millis(), CMD_SEND_AT_COMMAND}; + COMMAND_BLOCK cmdblock = {(uint16_t)millis(), CMD_SEND_AT_COMMAND}; Wire.beginTransmission(I2C_ADDR); Wire.write((byte*)&cmdblock, sizeof(cmdblock)); Wire.write(s); @@ -571,7 +571,7 @@ void COBDI2C::write(const char* s) bool COBDI2C::sendCommandBlock(byte cmd, uint8_t data, byte* payload, byte payloadBytes) { - COMMAND_BLOCK cmdblock = {millis(), cmd, data}; + COMMAND_BLOCK cmdblock = {(uint16_t)millis(), cmd, data}; Wire.beginTransmission(I2C_ADDR); bool success = Wire.write((byte*)&cmdblock, sizeof(COMMAND_BLOCK)) == sizeof(COMMAND_BLOCK); if (payload) Wire.write(payload, payloadBytes); -- cgit v1.2.3