summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2021-06-13 12:45:51 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2021-06-13 12:45:51 +0200
commit8bf6263cbf36c27533c1d24dbbd183dc2ad91533 (patch)
tree7bb806cbd5582d741257c8d32498317a9fc2b206
parent2945702efe92aace8f77ffd6a449208d09606efb (diff)
download2021-arduino-obd-8bf6263cbf36c27533c1d24dbbd183dc2ad91533.tar.gz
2021-arduino-obd-8bf6263cbf36c27533c1d24dbbd183dc2ad91533.tar.bz2
2021-arduino-obd-8bf6263cbf36c27533c1d24dbbd183dc2ad91533.zip
OBD: avoid compilation warnings
-rw-r--r--libraries/OBD/OBD.cpp4
1 files 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);