Skip to content

Commit a4e1e39

Browse files
committed
Use sam headers where appropriate
1 parent d62acef commit a4e1e39

14 files changed

Lines changed: 79 additions & 12 deletions

File tree

Bootloader/mchck.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@
2727

2828
// ----- Project Includes -----
2929

30+
#if defined(_kinetis_)
3031
#include <kinetis.h>
3132

33+
#elif defined(_sam_)
34+
#include <sam.h>
35+
36+
#endif
37+
3238

3339

3440
// ----- Local Includes -----

Debug/cli/cli.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ void cliFunc_version( char* args )
790790
printHex32_op( SIM_UIDMH, 8 );
791791
printHex32_op( SIM_UIDML, 8 );
792792
printHex32_op( SIM_UIDL, 8 );
793+
#elif defined(_sam_)
793794
#elif defined(_avr_at_)
794795
#elif defined(_host_)
795796
#else

Debug/led/led.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <stdint.h>
2727
#include <Lib/mcu_compat.h>
28+
#include <stdint.h>
2829

2930

3031

Debug/print/print.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void _print( const char* s )
6464
{
6565
Output_putchar( c );
6666
}
67-
#elif defined(_kinetis_) // ARM
67+
#elif defined(_kinetis_) || defined(_sam_) // ARM
6868
Output_putstr( (char*)s );
6969
#elif defined(_host_) // Host
7070
Output_putstr( (char*)s );

Lib/Interrupts.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@
2929

3030
#include <Lib/mcu_compat.h>
3131

32-
// ARM
32+
// Kinetis (ARM)
3333
#if defined(_kinetis_)
3434

3535
#include <Lib/kinetis.h>
3636

37+
// SAM (ARM)
38+
#elif defined(_sam_)
39+
40+
#include <Lib/sam.h>
41+
3742
// AVR
3843
#elif defined(_avr_at_)
3944

@@ -51,7 +56,7 @@
5156
// ----- Defines -----
5257

5358
// ARM
54-
#if defined(_kinetis_)
59+
#if defined(_kinetis_) || defined(_sam_)
5560

5661
// Map the Interrupt Enable/Disable to the AVR names
5762
#define cli() __disable_irq()

Lib/MacroLib.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434

35-
// ARM
35+
// Kinetis (ARM)
3636
#if defined(_kinetis_)
3737

3838
#include "kinetis.h"
@@ -43,6 +43,17 @@
4343

4444

4545

46+
// SAM (ARM)
47+
#if defined(_sam_)
48+
49+
#include "sam.h"
50+
#include "delay.h"
51+
#include "time.h"
52+
53+
#endif
54+
55+
56+
4657
// AVR
4758
#if defined(_avr_at_)
4859

Lib/MainLib.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434

35-
// ARM
35+
// Kinetis (ARM)
3636
#if defined(_kinetis_)
3737

3838
#include <Lib/kinetis.h>
@@ -42,6 +42,16 @@
4242

4343

4444

45+
// SAM (ARM)
46+
#if defined(_sam_)
47+
48+
#include <Lib/sam.h>
49+
#include <Lib/time.h>
50+
51+
#endif
52+
53+
54+
4555
// AVR
4656
#if defined(_avr_at_)
4757

Lib/OutputLib.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <Lib/mcu_compat.h>
3131

3232

33-
// ARM
33+
// Kinetis (ARM)
3434
#if defined(_kinetis_)
3535

3636
#include "kinetis.h"
@@ -41,6 +41,16 @@
4141

4242

4343

44+
// SAM (ARM)
45+
#if defined(_sam_)
46+
#include "sam.h"
47+
#include "delay.h"
48+
#include "time.h"
49+
50+
#endif
51+
52+
53+
4454
// AVR
4555
#if defined(_avr_at_)
4656

Lib/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Linker scripts can be found in the [ld](ld) directory.
3939

4040
* [kinetis.c](kinetis.c) - Kinetis-based MCU initialization and IRQ setup.
4141
* [kinetis.h](kinetis.h) - Register definitions for Kinetis-based MCUs.
42+
* [sam.c](sam.c) - SAM-based MCU initialization and IRQ setup.
43+
* [sam.h](sam.c) - Register definitions for Sam-based MCUs.
4244

4345

4446
## Misc

Lib/ScanLib.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232

3333

34-
// ARM
34+
// Kinetis (ARM)
3535
#if defined(_kinetis_)
3636

3737
#include "kinetis.h"
@@ -42,6 +42,17 @@
4242

4343

4444

45+
// SAM (ARM)
46+
#if defined(_sam_)
47+
48+
#include "sam.h"
49+
#include "delay.h"
50+
#include "time.h"
51+
52+
#endif
53+
54+
55+
4556
// AVR
4657
#if defined(_avr_at_)
4758

0 commit comments

Comments
 (0)