Skip to content

Fix MY_CORE_ONLY: Initialize HW #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions MySensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
#include "core/MySensorsCore.cpp"

// HW mains
#if !defined(MY_CORE_ONLY)
#if defined(ARDUINO_ARCH_AVR)
#include "hal/architecture/AVR/MyMainAVR.cpp"
#elif defined(ARDUINO_ARCH_SAMD)
Expand All @@ -404,7 +403,6 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
#elif defined(TEENSYDUINO)
#include "hal/architecture/Teensy3/MyMainTeensy3.cpp"
#endif
#endif

#endif

Expand Down
8 changes: 8 additions & 0 deletions core/MySensorsCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ void _infiniteLoop(void)

void _begin(void)
{
#if defined(MY_CORE_ONLY)
// initialize HW and run setup if present
(void)hwInit();
if (setup) {
setup();
}
return;
#endif
// reset wdt
hwWatchdogReset();

Expand Down
2 changes: 0 additions & 2 deletions examples/SecurityPersonalizer/SecurityPersonalizer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,7 @@ void setup()
hwRandomNumberInit();
#endif

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

print_greeting();

Expand Down