From a5535581e9a65c58f2e74ff68b9bcc3dc599dead Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 10 Dec 2020 06:19:50 +0100 Subject: [PATCH] Changing return type of 'requestFrom' from uint8_t to size_t allows the function to return the correct amount of bytes read (since internally it's already a size_t which is downcast to a uint8_t upon returning it. --- api/HardwareI2C.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/HardwareI2C.h b/api/HardwareI2C.h index c107d1a6..4a8e5f98 100644 --- a/api/HardwareI2C.h +++ b/api/HardwareI2C.h @@ -36,8 +36,8 @@ class HardwareI2C : public Stream virtual uint8_t endTransmission(bool stopBit) = 0; virtual uint8_t endTransmission(void) = 0; - virtual uint8_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0; - virtual uint8_t requestFrom(uint8_t address, size_t len) = 0; + virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0; + virtual size_t requestFrom(uint8_t address, size_t len) = 0; virtual void onReceive(void(*)(int)) = 0; virtual void onRequest(void(*)(void)) = 0; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy