Skip to content

Commit b072a40

Browse files
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 356a11a commit b072a40

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
@@ -45,7 +45,7 @@ extern "C"{
4545
#endif // __cplusplus
4646

4747
// Include Atmel headers
48-
#include "sam.h"
48+
#include <samd.h>
4949

5050
#include "wiring_constants.h"
5151

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
#include "wiring_constants.h"
3333

0 commit comments

Comments
 (0)