Skip to content

Commit bab6e25

Browse files
committed
Clean up
1 parent 0496c06 commit bab6e25

File tree

4 files changed

+4
-61
lines changed

4 files changed

+4
-61
lines changed

examples/Wippersnapper_demo/Wippersnapper_demo.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ void setup() {
2626
Serial.begin(115200);
2727
//while (!Serial) delay(10);
2828

29-
WS_DEBUG_HEAP("boot");
3029

3130
wipper.connect();
3231

platformio.ini

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -508,39 +508,11 @@ build_flags =
508508
-DSSL_ALL
509509
-DMMU_3232
510510
-DNON32XFER_FAST
511-
-DDEBUG_DISABLED
512-
-DDEBUG_LEVEL_NONE
513-
-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48 ; avoid section `.text1' will not fit in region `iram1_0_seg'
514-
board_build.eesz=4M2M
515-
board_build.filesystem = littlefs
516-
upload_port = COM19
517-
518-
; Adafruit Feather HUZZAH ESP8266 Debug
519-
[env:huzzah_esp8266_debug]
520-
extends=common:esp8266
521-
board = huzzah
522-
board_build.f_cpu = 80000000L
523-
build_type = debug
524-
; Arduino CLI uses this from adafruit_ci#ci-wippersnapper
525-
; esp8266:esp8266:huzzah:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=4816,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200
526-
build_flags =
527-
-Wl,--gc-sections
528-
-Wl,-Map=output_8266_debug.map
529-
-DARDUINO_ESP8266_ADAFRUIT_HUZZAH
530-
-DDEBUG_ESP_PORT=Serial
531-
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
532-
-DVTABLES_IN_FLASH
533-
-DNO_EXCEPTIONS
534-
-DNO_STACK_SMASH_PROTECTION
535-
-DSSL_ALL
536-
-DMMU_4816
537-
-DNON32XFER_FAST
538511
-DDEBUG_ENABLED
539-
-DDEBUG_LEVEL_NONE
540-
-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED ; 16KB cache + 48KB IRAM + 2nd heap (shared)
512+
-DDEBUG_LEVEL_CORE
513+
-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48 ; avoid section `.text1' will not fit in region `iram1_0_seg'
541514
board_build.eesz=4M2M
542515
board_build.filesystem = littlefs
543-
monitor_filters = esp8266_exception_decoder
544516

545517
; SAMD51 Boards ;
546518

src/Wippersnapper.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ Wippersnapper::~Wippersnapper() {
9595
*/
9696
/**************************************************************************/
9797
void Wippersnapper::provision() {
98-
// Note: Serial not initialized yet, cannot use WS_DEBUG_HEAP here
99-
10098
// Obtain device's MAC address
10199
getMacAddr();
102100

@@ -118,11 +116,12 @@ void Wippersnapper::provision() {
118116
#else
119117
set_user_key(); // non-fs-backed, sets global credentials within network iface
120118
#endif
119+
121120
// Set the status pixel's brightness
122121
setStatusLEDBrightness(WS._config.status_pixel_brightness);
122+
123123
// Set device's wireless credentials
124124
set_ssid_pass();
125-
// Note: Serial not initialized yet, cannot use WS_DEBUG_HEAP here
126125
}
127126

128127
/**************************************************************************/
@@ -2791,7 +2790,6 @@ void printDeviceInfo() {
27912790
*/
27922791
/**************************************************************************/
27932792
void Wippersnapper::connect() {
2794-
WS_DEBUG_HEAP("connect-start");
27952793
WS_DEBUG_PRINTLN("Adafruit.io WipperSnapper");
27962794

27972795
// Dump device info to the serial monitor
@@ -2845,7 +2843,6 @@ void Wippersnapper::connect() {
28452843
statusLEDFade(GREEN, 3);
28462844
WS_DEBUG_PRINTLN(
28472845
"Registration and configuration complete!\nRunning application...");
2848-
WS_DEBUG_HEAP("connect-end");
28492846
}
28502847

28512848
/**************************************************************************/
@@ -2893,8 +2890,6 @@ void Wippersnapper::publishPinConfigComplete() {
28932890
*/
28942891
/**************************************************************************/
28952892
ws_status_t Wippersnapper::run() {
2896-
WS_DEBUG_HEAP("loop");
2897-
28982893
// Check networking
28992894
runNetFSM();
29002895
WS.feedWDT();

src/Wippersnapper.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,6 @@
7474
#define WS_DEBUG_PRINTHEX(...) \
7575
{ WS_PRINTER.print(__VA_ARGS__, HEX); } ///< Prints in hexadecimal
7676

77-
// ESP8266 heap monitoring macro
78-
#ifdef ARDUINO_ARCH_ESP8266
79-
#define WS_HEAP_TOTAL 81920 ///< ESP8266 total heap size in bytes
80-
#define WS_DEBUG_HEAP(label) \
81-
{ \
82-
uint32_t freeHeap = ESP.getFreeHeap(); \
83-
uint8_t freePct = (freeHeap * 100) / WS_HEAP_TOTAL; \
84-
WS_DEBUG_PRINT("[HEAP] "); \
85-
WS_DEBUG_PRINT(label); \
86-
WS_DEBUG_PRINT(": "); \
87-
WS_DEBUG_PRINTVAR(freeHeap); \
88-
WS_DEBUG_PRINT("B ("); \
89-
WS_DEBUG_PRINTVAR(freePct); \
90-
WS_DEBUG_PRINT("%) frag="); \
91-
WS_DEBUG_PRINTVAR(ESP.getHeapFragmentation()); \
92-
WS_DEBUG_PRINT("% maxblk="); \
93-
WS_DEBUG_PRINTLNVAR(ESP.getMaxFreeBlockSize()); \
94-
}
95-
#else
96-
#define WS_DEBUG_HEAP(label) \
97-
{} ///< No-op for non-ESP8266 platforms
98-
#endif
99-
10077
#else
10178
#define WS_DEBUG_PRINT(...) \
10279
{} ///< Disabled debug output

0 commit comments

Comments
 (0)