Skip to content

Commit 0e1059d

Browse files
committed
cleanup comments
1 parent f3a492e commit 0e1059d

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

bootloaders/eboot/eboot.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
ets_wdt_* APIs, so our choices are not too critical.
3333
The SDK will set up the WDT as it wants it.
3434
35-
A rationale for keeping the ets_wdt_enable() line. If the system is not stable
36-
during a "soft restart." The HWDT would provide a recovery reboot.
35+
A rationale for keeping the "ets_wdt_enable()" line, if the system is not
36+
stable during a "soft restart," the HWDT would provide a recovery reboot.
3737
*/
3838
extern void ets_wdt_enable(uint32_t mode, uint32_t arg1, uint32_t arg2);
3939
/*
@@ -44,10 +44,10 @@ extern void ets_wdt_enable(uint32_t mode, uint32_t arg1, uint32_t arg2);
4444
For current mode 1, calls ets_timer_disarm, then return the current mode.
4545
For current mode 2, calls ets_isr_mask, then return the current mode.
4646
47-
I always see a value of 0xFFFFFFFF.
47+
I always see a return value of 0xFFFFFFFF.
4848
49-
The value would normally be used with ets_wdt_restore; however, that is not an
50-
option since a valid prior call to ets_wdt_enable() may not have been done.
49+
The return value would normally be used with ets_wdt_restore; however, that is
50+
not an option since a valid prior call to ets_wdt_enable() may not have been done.
5151
*/
5252
extern uint32_t ets_wdt_disable(void);
5353

cores/esp8266/Esp.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,11 @@ bool EspClass::eraseConfig(void) {
533533
}
534534

535535
bool EspClass::eraseConfigAndReset(void) {
536+
// Before calling, ensure the WiFi state is equivalent to
537+
// "WiFi.mode(WIFI_OFF)." This will reduce the likelihood of the SDK
538+
// performing WiFi data writes to Flash between erasing and resetting.
536539
bool reset = eraseConfig();
537540
if (reset) {
538-
// Must be called in WiFi.mode(WIFI_OFF) state.
539541
hardware_reset();
540542
}
541543
return reset;

cores/esp8266/Esp.h

+14-13
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,20 @@ class EspClass {
212212

213213
static bool eraseConfig();
214214

215-
/*
216-
Erases 4 sectors at the end of flash, 1 - RF_CAL and 3 - SYSTEMPARM.
217-
These are the same additional sectors that are erase when you select
218-
Erase Flash: "Sketch + WiFi Settings" from the Arduino IDE Tools menu.
219-
220-
As a precaution, since this operation erases the running SDKs flash
221-
configuration space, use reset flag "true" with eraseConfig. Also, for
222-
additional protection, call "WiFi.mode(WIFI_OFF)" before calling.
223-
224-
If you need to erase "WiFi Settings" and reboot consider using
225-
"ArduinoOTA.eraseConfigAndReset()" it handles shutting down WiFi
226-
before the erase.
227-
*/
215+
/**
216+
* @brief Erases 4 sectors at the end of flash, 1 - RF_CAL and 3 - SYSTEMPARM.
217+
* These are the same additional sectors that are erase when you select
218+
* Erase Flash: "Sketch + WiFi Settings" from the Arduino IDE Tools menu.
219+
*
220+
* This operation erases the running SDK's flash configuration space.
221+
* As a precaution before calling, first call "WiFi.mode(WIFI_OFF)."
222+
*
223+
* If you need to erase "WiFi Settings" and reboot consider using
224+
* "ArduinoOTA.eraseConfigAndReset()" it handles shutting down WiFi
225+
* before the erase.
226+
* @return bool result of operation. Always False on return.
227+
* Function does not return on success.
228+
*/
228229
static bool eraseConfigAndReset();
229230

230231
static uint8_t *random(uint8_t *resultArray, const size_t outputSizeBytes);

0 commit comments

Comments
 (0)