Skip to content

Commit e203d42

Browse files
committed
Disable Serial.println()
1 parent 00a5cfc commit e203d42

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
set(CORE_SRCS
2+
cores/esp32/dummySerial.cpp
23
cores/esp32/Print.cpp
34
cores/esp32/stdlib_noniso.c
45
cores/esp32/Stream.cpp

cores/esp32/Arduino.h

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "esp_timer.h"
4949

5050
#define millis() (esp_timer_get_time() / 1000ULL)
51+
#define micros64() (esp_timer_get_time())
5152

5253
#define PI 3.1415926535897932384626433832795
5354
#define HALF_PI 1.5707963267948966192313216916398
@@ -146,6 +147,15 @@ typedef unsigned int word;
146147
void setup(void);
147148
void loop(void);
148149

150+
class dummySerial{
151+
public:
152+
virtual void println(const char *);
153+
};
154+
155+
extern dummySerial dSerial;
156+
157+
#define Serial dSerial
158+
149159
// The default is using Real Hardware random number generator
150160
// But when randomSeed() is called, it turns to Psedo random
151161
// generator, exactly as done in Arduino mainstream

cores/esp32/dummySerial.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Dummy class to disable Arnduino Serial.println
2+
// Add other Serial. members if needed
3+
4+
5+
#include <Arduino.h>
6+
7+
void dummySerial::println(const char * c) {}
8+
9+
dummySerial dSerial;

0 commit comments

Comments
 (0)