From d03f1d4cf57aa77fa4b29c865c5768ae69edb784 Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Wed, 7 Oct 2020 19:17:40 -0700 Subject: [PATCH] Fix permissive compile issue --- src/openmvrpc.cpp | 4 ++-- src/openmvrpc.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openmvrpc.cpp b/src/openmvrpc.cpp index 6315fae..d33e29d 100644 --- a/src/openmvrpc.cpp +++ b/src/openmvrpc.cpp @@ -805,7 +805,7 @@ bool rpc_i2c_master::put_bytes(uint8_t *data, size_t size, unsigned long timeout } volatile uint8_t *rpc_i2c_slave::__bytes_buff = NULL; -volatile size_t rpc_i2c_slave::__bytes_size = 0; +volatile int rpc_i2c_slave::__bytes_size = 0; void rpc_i2c_slave::onReceiveHandler(int numBytes) { @@ -818,7 +818,7 @@ void rpc_i2c_slave::onReceiveHandler(int numBytes) void rpc_i2c_slave::onRequestHandler() { if (!__bytes_size) return; - size_t written = Wire.write((const uint8_t *) __bytes_buff, min(__bytes_size, 32)); + size_t written = Wire.write((uint8_t *) __bytes_buff, min(__bytes_size, 32)); __bytes_buff += written; __bytes_size -= written; } diff --git a/src/openmvrpc.h b/src/openmvrpc.h index 4f1d8f7..b7bf359 100644 --- a/src/openmvrpc.h +++ b/src/openmvrpc.h @@ -288,7 +288,7 @@ class rpc_i2c_slave : public rpc_slave private: uint8_t __slave_addr; static volatile uint8_t *__bytes_buff; - static volatile size_t __bytes_size; + static volatile int __bytes_size; static void onReceiveHandler(int numBytes); static void onRequestHandler(); rpc_i2c_slave(const rpc_i2c_slave &);