Skip to content

Commit 6daec4a

Browse files
committed
ESP8266: Add configuration for reset pin polarity
1 parent b005bf2 commit 6daec4a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ ESP8266Interface::ResetPin::ResetPin(PinName rst_pin) : _rst_pin(mbed::DigitalOu
143143
void ESP8266Interface::ResetPin::rst_assert()
144144
{
145145
if (_rst_pin.is_connected()) {
146-
_rst_pin = 0;
146+
_rst_pin = MBED_CONF_ESP8266_RST_PIN_POLARITY;
147147
tr_debug("HW reset asserted");
148148
}
149149
}
@@ -152,7 +152,7 @@ void ESP8266Interface::ResetPin::rst_deassert()
152152
{
153153
if (_rst_pin.is_connected()) {
154154
// Notice that Pin7 CH_EN cannot be left floating if used as reset
155-
_rst_pin = 1;
155+
_rst_pin = !MBED_CONF_ESP8266_RST_PIN_POLARITY;
156156
tr_debug("HW reset deasserted");
157157
}
158158
}

components/wifi/esp8266-driver/mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"help": "RESET pin for the modem, defaults to Not Connected",
2222
"value": null
2323
},
24+
"rst-pin-polarity": {
25+
"help": "Polarity of RESET pin for the modem. [0/1]",
26+
"value": 0
27+
},
2428
"debug": {
2529
"help": "Enable debug logs. [true/false]",
2630
"value": false

0 commit comments

Comments
 (0)