From 68c251226d2173f0bf0d0ac6b6cf6abd5ef254f1 Mon Sep 17 00:00:00 2001 From: David Gauchard Date: Wed, 6 Sep 2023 22:35:41 +0200 Subject: [PATCH 1/2] minor fixes for restoring warning-less emulation on host for debugging (using emuAsync, see main readme) --- examples/completeExample/completeExample.cpp | 5 +++-- examples/completeExample/completeExample.ino | 3 +++ examples/gui-generic-api/gui-generic-api.ino | 2 +- examples/gui/gui.ino | 2 +- examples/tabbedGui/tabbedGui.ino | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/completeExample/completeExample.cpp b/examples/completeExample/completeExample.cpp index 364a4f9..f81231c 100644 --- a/examples/completeExample/completeExample.cpp +++ b/examples/completeExample/completeExample.cpp @@ -35,7 +35,7 @@ #warning use decorators: { HeapSelectIram doAllocationsInIRAM; ESPUI.addControl(...) ... } (cf. https://arduino-esp8266.readthedocs.io/en/latest/mmu.html#how-to-select-heap) #warning then check http:///heap #endif // MMU_IRAM_HEAP -#ifndef DEBUG_ESP_OOM +#if !defined(DEBUG_ESP_OOM) && !defined(CORE_MOCK) #error on ESP8266 and ESPUI, you must define OOM debug option when developping #endif #endif @@ -396,7 +396,7 @@ void extendedCallback(Control* sender, int type, void* param) Serial.print(sender->label); Serial.print("' = "); Serial.println(sender->value); - Serial.println(String("param = ") + String((int)param)); + Serial.println(String("param = ") + String((long)param)); } void setup() { @@ -443,6 +443,7 @@ void loop() { #if !defined(ESP32) ((void (*)())0xf00fdead)(); #endif + break; default: Serial.print('#'); break; diff --git a/examples/completeExample/completeExample.ino b/examples/completeExample/completeExample.ino index ff7bd09..a4db808 100644 --- a/examples/completeExample/completeExample.ino +++ b/examples/completeExample/completeExample.ino @@ -1 +1,4 @@ // placeholder +#if CORE_MOCK +#include "completeExample.cpp" +#endif diff --git a/examples/gui-generic-api/gui-generic-api.ino b/examples/gui-generic-api/gui-generic-api.ino index 815e66d..003ce48 100644 --- a/examples/gui-generic-api/gui-generic-api.ino +++ b/examples/gui-generic-api/gui-generic-api.ino @@ -16,7 +16,7 @@ DNSServer dnsServer; #warning use decorators: { HeapSelectIram doAllocationsInIRAM; ESPUI.addControl(...) ... } (cf. https://arduino-esp8266.readthedocs.io/en/latest/mmu.html#how-to-select-heap) #warning then check http:///heap #endif // MMU_IRAM_HEAP -#ifndef DEBUG_ESP_OOM +#if !defined(DEBUG_ESP_OOM) && !defined(CORE_MOCK) #error on ESP8266 and ESPUI, you must define OOM debug option when developping #endif #endif diff --git a/examples/gui/gui.ino b/examples/gui/gui.ino index 1aca2f1..bcccd82 100644 --- a/examples/gui/gui.ino +++ b/examples/gui/gui.ino @@ -16,7 +16,7 @@ DNSServer dnsServer; #warning use decorators: { HeapSelectIram doAllocationsInIRAM; ESPUI.addControl(...) ... } (cf. https://arduino-esp8266.readthedocs.io/en/latest/mmu.html#how-to-select-heap) #warning then check http:///heap #endif // MMU_IRAM_HEAP -#ifndef DEBUG_ESP_OOM +#if !defined(DEBUG_ESP_OOM) && !defined(CORE_MOCK) #error on ESP8266 and ESPUI, you must define OOM debug option when developping #endif #endif diff --git a/examples/tabbedGui/tabbedGui.ino b/examples/tabbedGui/tabbedGui.ino index 7aa0b2f..d19cebe 100644 --- a/examples/tabbedGui/tabbedGui.ino +++ b/examples/tabbedGui/tabbedGui.ino @@ -16,7 +16,7 @@ DNSServer dnsServer; #warning use decorators: { HeapSelectIram doAllocationsInIRAM; ESPUI.addControl(...) ... } (cf. https://arduino-esp8266.readthedocs.io/en/latest/mmu.html#how-to-select-heap) #warning then check http:///heap #endif // MMU_IRAM_HEAP -#ifndef DEBUG_ESP_OOM +#if !defined(DEBUG_ESP_OOM) && !defined(CORE_MOCK) #error on ESP8266 and ESPUI, you must define OOM debug option when developping #endif #endif From 03c30fa75c02d11b5c76ae682d92b081920e3b1b Mon Sep 17 00:00:00 2001 From: David Gauchard Date: Wed, 6 Sep 2023 22:50:42 +0200 Subject: [PATCH 2/2] more minor changes for #249 --- examples/completeExample/completeExample.cpp | 3 ++- examples/gui-generic-api/gui-generic-api.ino | 3 ++- examples/gui/gui.ino | 3 ++- examples/tabbedGui/tabbedGui.ino | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/completeExample/completeExample.cpp b/examples/completeExample/completeExample.cpp index f81231c..7617e94 100644 --- a/examples/completeExample/completeExample.cpp +++ b/examples/completeExample/completeExample.cpp @@ -396,7 +396,8 @@ void extendedCallback(Control* sender, int type, void* param) Serial.print(sender->label); Serial.print("' = "); Serial.println(sender->value); - Serial.println(String("param = ") + String((long)param)); + Serial.print("param = "); + Serial.println((long)param); } void setup() { diff --git a/examples/gui-generic-api/gui-generic-api.ino b/examples/gui-generic-api/gui-generic-api.ino index 003ce48..54f003b 100644 --- a/examples/gui-generic-api/gui-generic-api.ino +++ b/examples/gui-generic-api/gui-generic-api.ino @@ -67,7 +67,8 @@ void buttonCallback(Control* sender, int type) void buttonExample(Control* sender, int type, void* param) { - Serial.println(String("param: ") + String(long(param))); + Serial.print("param: "); + Serial.println(long(param)); switch (type) { case B_DOWN: diff --git a/examples/gui/gui.ino b/examples/gui/gui.ino index bcccd82..759ed07 100644 --- a/examples/gui/gui.ino +++ b/examples/gui/gui.ino @@ -72,7 +72,8 @@ void buttonCallback(Control* sender, int type) void buttonExample(Control* sender, int type, void* param) { - Serial.println(String("param: ") + String(long(param))); + Serial.print("param: "); + Serial.println(long(param)); switch (type) { case B_DOWN: diff --git a/examples/tabbedGui/tabbedGui.ino b/examples/tabbedGui/tabbedGui.ino index d19cebe..a862aa9 100644 --- a/examples/tabbedGui/tabbedGui.ino +++ b/examples/tabbedGui/tabbedGui.ino @@ -66,7 +66,8 @@ void buttonCallback(Control* sender, int type) void buttonExample(Control* sender, int type, void* param) { - Serial.println(String("param: ") + String(long(param))); + Serial.print("param: "); + Serial.println(long(param)); switch (type) { case B_DOWN: