Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PinStatus error on some platforms #185

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions src/utility/wifi_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/utility/wifi_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down