Skip to content

Commit 30e5b3f

Browse files
committedNov 26, 2020
Include samd.h instead of sam.h
The sam.h file uses some non-portable macros that raise a warning in newer gcc version. This warning was supressed in commit 8575a52 (Add -Wno-expansion-to-defined compile warning flag), but this is not ideal. However, since the only thing sam.h does is figure out what CPU is selected and include the right family header, and we always use SAMD21 CPUs, the only thing sam.h does is include samd.h. So we can easily bypass then and include samd.h directly. This fixes the first part of #556.
1 parent 25fea52 commit 30e5b3f

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed
 

‎cores/arduino/Arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern "C"{
3131
#endif // __cplusplus
3232

3333
// Include Atmel headers
34-
#include "sam.h"
34+
#include <samd.h>
3535

3636
#define clockCyclesPerMicrosecond() ( SystemCoreClock / 1000000L )
3737
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SystemCoreClock / 1000L) )

‎cores/arduino/SERCOM.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef _SERCOM_CLASS_
2020
#define _SERCOM_CLASS_
2121

22-
#include "sam.h"
22+
#include <samd.h>
2323

2424
#define SERCOM_FREQ_REF 48000000
2525
#define SERCOM_NVIC_PRIORITY ((1<<__NVIC_PRIO_BITS) - 1)

‎cores/arduino/WVariant.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#pragma once
2020

2121
#include <stdint.h>
22-
#include "sam.h"
22+
#include <samd.h>
2323

2424
#ifdef __cplusplus
2525
extern "C" {

‎cores/arduino/cortex_handlers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19-
#include <sam.h>
19+
#include <samd.h>
2020
#include <variant.h>
2121
#include <stdio.h>
2222

‎cores/arduino/startup.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19-
#include "sam.h"
19+
#include <samd.h>
2020
#include "variant.h"
2121

2222
#include <stdio.h>

‎cores/arduino/wiring_private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
// Includes Atmel CMSIS
30-
#include "sam.h"
30+
#include <samd.h>
3131

3232
int pinPeripheral( uint32_t ulPin, EPioType ulPeripheral );
3333

0 commit comments

Comments
 (0)
Please sign in to comment.