Fix MY_CORE_ONLY: Initialize HW (#1070)
This commit is contained in:
@@ -388,7 +388,6 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
|
|||||||
#include "core/MySensorsCore.cpp"
|
#include "core/MySensorsCore.cpp"
|
||||||
|
|
||||||
// HW mains
|
// HW mains
|
||||||
#if !defined(MY_CORE_ONLY)
|
|
||||||
#if defined(ARDUINO_ARCH_AVR)
|
#if defined(ARDUINO_ARCH_AVR)
|
||||||
#include "hal/architecture/AVR/MyMainAVR.cpp"
|
#include "hal/architecture/AVR/MyMainAVR.cpp"
|
||||||
#elif defined(ARDUINO_ARCH_SAMD)
|
#elif defined(ARDUINO_ARCH_SAMD)
|
||||||
@@ -404,7 +403,6 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
|
|||||||
#elif defined(TEENSYDUINO)
|
#elif defined(TEENSYDUINO)
|
||||||
#include "hal/architecture/Teensy3/MyMainTeensy3.cpp"
|
#include "hal/architecture/Teensy3/MyMainTeensy3.cpp"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ void _infiniteLoop(void)
|
|||||||
|
|
||||||
void _begin(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
|
// reset wdt
|
||||||
hwWatchdogReset();
|
hwWatchdogReset();
|
||||||
|
|
||||||
|
|||||||
@@ -439,9 +439,7 @@ void setup()
|
|||||||
hwRandomNumberInit();
|
hwRandomNumberInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Serial.begin(MY_BAUD_RATE);
|
|
||||||
while(!Serial); // For USB enabled devices, wait for USB enumeration before continuing
|
while(!Serial); // For USB enabled devices, wait for USB enumeration before continuing
|
||||||
hwInit();
|
|
||||||
|
|
||||||
print_greeting();
|
print_greeting();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user