Skip to content

Commit daaa618

Browse files
committed
check for definition of ARDUINO_SAMD_ZERO
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
1 parent bc9e0e3 commit daaa618

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

examples/data_saving/data_saving.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ Variable* ds3231Temp =
193193
// ==========================================================================
194194
/** Start [modbus_shared] */
195195
// Create a reference to the serial port for modbus
196-
#if defined(ARDUINO_ARCH_SAMD) || defined(ATMEGA2560)
196+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO) || \
197+
defined(ATMEGA2560)
197198
HardwareSerial& modbusSerial = Serial2; // Use hardware serial if possible
198199
#else
199200
AltSoftSerial& modbusSerial = altSoftSerial; // For software serial

examples/menu_a_la_carte/menu_a_la_carte.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ void SERCOM2_Handler() {
186186
// ==========================================================================
187187
// Assigning Serial Port Functionality
188188
// ==========================================================================
189-
#if defined(ARDUINO_ARCH_SAMD) || defined(ATMEGA2560) || \
190-
defined(ARDUINO_AVR_MEGA2560)
189+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO) || \
190+
defined(ATMEGA2560) || defined(ARDUINO_AVR_MEGA2560)
191191
/** Start [assign_ports_hw] */
192192
// If there are additional hardware Serial ports possible - use them!
193193

@@ -2410,7 +2410,7 @@ VariableArray varArray(variableCount, variableList, UUIDs);
24102410
// ==========================================================================
24112411

24122412

2413-
#else // BUILD_TEST_PRE_NAMED_VARS
2413+
#else // BUILD_TEST_PRE_NAMED_VARS
24142414
/** Start [variables_pre_named] */
24152415
// Version 3: Fill array with already created and named variable pointers
24162416
Variable* variableList[] = {

src/LoggerBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ volatile bool Logger::isTestingNow = false;
3535
volatile bool Logger::startTesting = false;
3636

3737
// Initialize the RTC for the SAMD boards
38-
#if defined(ARDUINO_ARCH_SAMD)
38+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO)
3939
RTCZero Logger::zero_sleep_rtc;
4040
#endif
4141

src/LoggerBase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
// Bring in the libraries to handle the processor sleep/standby modes
3636
// The SAMD library can also the built-in clock on those modules
37-
#if defined(ARDUINO_ARCH_SAMD)
37+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO)
3838
#include <RTCZero.h>
3939
#include "WatchDogs/WatchDogSAMD.h"
4040
#elif defined(ARDUINO_ARCH_AVR) || defined(__AVR__)
@@ -677,7 +677,7 @@ class Logger {
677677
// This gets the current epoch time (unix time, ie, the number of seconds
678678
// from January 1, 1970 00:00:00 UTC) and corrects it for the specified time
679679
// zone
680-
#if defined(ARDUINO_ARCH_SAMD)
680+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO)
681681
/**
682682
* @brief The RTC object.
683683
*
@@ -869,7 +869,7 @@ class Logger {
869869
*/
870870
void systemSleep(void);
871871

872-
#if defined(ARDUINO_ARCH_SAMD)
872+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO)
873873
/**
874874
* @brief A watch-dog implementation to use to reboot the system in case of
875875
* lock-ups

src/WatchDogs/WatchDogSAMD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Be careful to use a platform-specific conditional include to only make the
1313
// code visible for the appropriate platform. Arduino will try to compile and
1414
// link all .cpp files regardless of platform.
15-
#if defined(ARDUINO_ARCH_SAMD)
15+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO)
1616

1717
volatile uint32_t extendedWatchDogSAMD::_barksUntilReset = 0;
1818

src/sensors/ProcessorStats.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ String ProcessorStats::getSensorLocation(void) {
124124
}
125125

126126

127-
#if defined(ARDUINO_ARCH_SAMD)
127+
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO)
128128
extern "C" char* sbrk(int i);
129129

130130
int16_t FreeRam() {
@@ -202,7 +202,7 @@ bool ProcessorStats::addSingleMeasurementResult(void) {
202202
float sensorValue_freeRam = (int)&v -
203203
(__brkval == 0 ? (int)&__heap_start : (int)__brkval);
204204

205-
#elif defined(ARDUINO_ARCH_SAMD)
205+
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAMD_ZERO)
206206
float sensorValue_freeRam = FreeRam();
207207

208208
#else

0 commit comments

Comments
 (0)