Fix MY_CORE_ONLY: Initialize HW (#1070)

This commit is contained in:
tekka
2018-02-20 12:32:03 +01:00
committed by Henrik Ekblad
parent 345d6d7d11
commit b51981ab3d
3 changed files with 8 additions and 4 deletions
-2
View File
@@ -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)
@@ -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
+8
View File
@@ -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();
@@ -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();