Skip to content

M2351: Integrate ESP8266 power on/off logic into ESP8266 driver main… #11299

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions components/wifi/esp8266-driver/ESP8266Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,26 @@ ESP8266Interface::ResetPin::ResetPin(PinName rst_pin) : _rst_pin(mbed::DigitalOu
void ESP8266Interface::ResetPin::rst_assert()
{
if (_rst_pin.is_connected()) {
#if defined(TARGET_NUMAKER_PFM_M2351_CM)
// For M2351, _rst_pin is power control pin. This is to power off the module.
_rst_pin = 1;
#else
_rst_pin = 0;
#endif
tr_debug("HW reset asserted");
}
}

void ESP8266Interface::ResetPin::rst_deassert()
{
if (_rst_pin.is_connected()) {
#if defined(TARGET_NUMAKER_PFM_M2351_CM)
// For M2351, _rst_pin is power control pin. This is to power on the module.
_rst_pin = 0;
#else
// Notice that Pin7 CH_EN cannot be left floating if used as reset
_rst_pin = 1;
#endif
tr_debug("HW reset deasserted");
}
}
Expand Down