aboutsummaryrefslogtreecommitdiff
path: root/sensor/sensor.ino
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-15 13:35:35 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-15 13:35:35 +0200
commit7b5fb81fc7927809db90c1b093a0de939a54ecd9 (patch)
tree4e6bd0a249899a8de6997de656fe4f058600a0ce /sensor/sensor.ino
parentf4a1116eb76656cdf1152ce34533cc56ea4487af (diff)
avoid need for external file mylog.h
Diffstat (limited to 'sensor/sensor.ino')
-rw-r--r--sensor/sensor.ino14
1 files changed, 11 insertions, 3 deletions
diff --git a/sensor/sensor.ino b/sensor/sensor.ino
index 019ff23..5a1f075 100644
--- a/sensor/sensor.ino
+++ b/sensor/sensor.ino
@@ -22,7 +22,16 @@
/// @see <https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z2tFBF4gN7ziG9oXtUytVQNYe3VhQ/tree/Mussel/README.md>
/// @see <https://moodle.ruc.dk/course/view.php?id=23504>
-#include "mylog.h"
+// include and refine ESP32 Logging system
+// activate in Arduino IDE: Tools -> Core Debug Level
+#define CONFIG_ARDUHAL_ESP_LOG 1
+#define LOG_LOCAL_LEVEL CORE_DEBUG_LEVEL
+#include <esp32-hal-log.h>
+#undef ARDUHAL_LOG_FORMAT
+#define ARDUHAL_LOG_FORMAT(letter, format) \
+ ARDUHAL_LOG_COLOR_##letter "[" #letter "] %s(): " format \
+ ARDUHAL_LOG_RESET_COLOR "\r\n", __FUNCTION__
+
#include "BLEDevice.h"
#include "BLEBeacon.h"
#include "BLEAdvertising.h"
@@ -160,11 +169,10 @@ void setBeacon(int angle) {
void setup() {
- // enable logging (when also raised in IDE: Tools -> Core Debug Level)
+ // enable logging to serial
Serial.begin(115200);
esp_log_level_set("*", ESP_LOG_DEBUG);
- Serial.begin(115200);
beginPace();
beginTouchDetection();