From 8bf8f73b7a2c002a42cf56f963355589928621fb Mon Sep 17 00:00:00 2001 From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com> Date: Wed, 9 Jun 2021 18:36:27 -0400 Subject: [PATCH] Fix PinStatus error on some platforms On some platforms, fix compile error: 'PinStatus' does not name a type --- src/utility/wifi_drv.cpp | 4 ++++ src/utility/wifi_drv.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/utility/wifi_drv.cpp b/src/utility/wifi_drv.cpp index 900bf67e..277e0aa7 100644 --- a/src/utility/wifi_drv.cpp +++ b/src/utility/wifi_drv.cpp @@ -1060,7 +1060,11 @@ void WiFiDrv::pinMode(uint8_t pin, uint8_t mode) SpiDrv::spiSlaveDeselect(); } +#if defined(ARDUINO_ARCH_MBED) PinStatus WiFiDrv::digitalRead(uint8_t pin) +#else +int WiFiDrv::digitalRead(uint8_t pin) +#endif { WAIT_FOR_SLAVE_SELECT(); // Send Command diff --git a/src/utility/wifi_drv.h b/src/utility/wifi_drv.h index 107bc63e..0d6180a0 100644 --- a/src/utility/wifi_drv.h +++ b/src/utility/wifi_drv.h @@ -290,7 +290,13 @@ class WiFiDrv static void debug(uint8_t on); static float getTemperature(); static void pinMode(uint8_t pin, uint8_t mode); + +#if defined(ARDUINO_ARCH_MBED) static PinStatus digitalRead(uint8_t pin); +#else + static int digitalRead(uint8_t pin); +#endif + static void digitalWrite(uint8_t pin, uint8_t value); static uint16_t analogRead(uint8_t adc_channel); static void analogWrite(uint8_t pin, uint8_t value);