Skip to content

Commit b51981a

Browse files
tekka007henrikekblad
authored andcommitted
Fix MY_CORE_ONLY: Initialize HW (#1070)
1 parent 345d6d7 commit b51981a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

MySensors.h

-2
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
388388
#include "core/MySensorsCore.cpp"
389389

390390
// HW mains
391-
#if !defined(MY_CORE_ONLY)
392391
#if defined(ARDUINO_ARCH_AVR)
393392
#include "hal/architecture/AVR/MyMainAVR.cpp"
394393
#elif defined(ARDUINO_ARCH_SAMD)
@@ -404,7 +403,6 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
404403
#elif defined(TEENSYDUINO)
405404
#include "hal/architecture/Teensy3/MyMainTeensy3.cpp"
406405
#endif
407-
#endif
408406

409407
#endif
410408

core/MySensorsCore.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ void _infiniteLoop(void)
8888

8989
void _begin(void)
9090
{
91+
#if defined(MY_CORE_ONLY)
92+
// initialize HW and run setup if present
93+
(void)hwInit();
94+
if (setup) {
95+
setup();
96+
}
97+
return;
98+
#endif
9199
// reset wdt
92100
hwWatchdogReset();
93101

examples/SecurityPersonalizer/SecurityPersonalizer.ino

-2
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,7 @@ void setup()
439439
hwRandomNumberInit();
440440
#endif
441441

442-
Serial.begin(MY_BAUD_RATE);
443442
while(!Serial); // For USB enabled devices, wait for USB enumeration before continuing
444-
hwInit();
445443

446444
print_greeting();
447445

0 commit comments

Comments
 (0)