Skip to content

Commit

Permalink
Merge pull request #1202 from espruino/ESP32
Browse files Browse the repository at this point in the history
fix ESP32 'Not connected to the internet'
  • Loading branch information
gfwilliams committed Jul 23, 2017
2 parents 1b6838b + 10711c9 commit 228e78c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
7 changes: 6 additions & 1 deletion libs/network/esp32/jswrap_esp32_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,15 @@ static void sendWifiCompletionCB(
*g_jsCallback = NULL;
} // End of sendWifiCompletionCB

/*JSON{
"type":"init",
"generate":"jswrap_esp32_wifi_soft_init"
}
/**
* Perform a soft initialization of ESP32 networking.
*/
void esp32_wifi_soft_init() {
void jswrap_esp32_wifi_soft_init() {
JsNetwork net;
networkCreate(&net, JSNETWORKTYPE_ESP32); // Set the network type to be ESP32
networkState = NETWORKSTATE_ONLINE; // Set the global state of the networking to be online
Expand Down
2 changes: 1 addition & 1 deletion libs/network/esp32/jswrap_esp32_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ void jswrap_ESP32_ping(
);

void esp32_wifi_init();
void esp32_wifi_soft_init();
void jswrap_esp32_wifi_soft_init();
17 changes: 8 additions & 9 deletions targets/esp32/jshardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,20 @@ void jshInit() {
* Reset the Espruino environment.
*/
void jshReset() {
jshResetDevices();
jshPinDefaultPullup() ;
UartReset();
RMTReset();
ADCReset();
SPIReset();
I2CReset();
jshResetDevices();
jshPinDefaultPullup() ;
UartReset();
RMTReset();
ADCReset();
SPIReset();
I2CReset();
}

/**
* Re-init the ESP32 after a soft-reset
*/
void jshSoftInit() {
//jsWarn(">> jshSoftInit()\n");
esp32_wifi_soft_init();
jswrap_esp32_wifi_soft_init();
}

/**
Expand Down

0 comments on commit 228e78c

Please sign in to comment.