File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,15 @@ Mock Arduino.h library.
55Where possible, variable names from the Arduino library are used to avoid conflicts
66
77*/
8+
9+ // hardware mocks
10+ volatile long long __ARDUINO_CI_SFR_MOCK [1024 ];
11+ #define _SFR_IO8 (io_addr ) (*(volatile uint8_t *)(__ARDUINO_CI_SFR_MOCK + io_addr)) // this macro is all we need from the sfr file
12+ #define _SFR_IO16 (io_addr ) (*(volatile uint16_t *)(__ARDUINO_CI_SFR_MOCK + io_addr)) // this macro is all we need from the sfr file
13+ #define _SFR_MEM8 (io_addr ) (*(volatile uint8_t *)(__ARDUINO_CI_SFR_MOCK + io_addr)) // this macro is all we need from the sfr file
14+ #define _SFR_MEM16 (io_addr ) (*(volatile uint16_t *)(__ARDUINO_CI_SFR_MOCK + io_addr)) // this macro is all we need from the sfr file
15+ #define _SFR_MEM32 (io_addr ) (*(volatile uint32_t *)(__ARDUINO_CI_SFR_MOCK + io_addr)) // this macro is all we need from the sfr file
16+
817// Chars and strings
918
1019#include "ArduinoDefines.h"
@@ -71,5 +80,3 @@ inline unsigned int makeWord(unsigned int w) { return w; }
7180inline unsigned int makeWord (unsigned char h , unsigned char l ) { return (h << 8 ) | l ; }
7281
7382#define word (...) makeWord(__VA_ARGS__)
74-
75-
Original file line number Diff line number Diff line change 9696#ifndef _AVR_IO_H_
9797#define _AVR_IO_H_
9898
99- #define _SFR_IO8 (io_addr ) (*(volatile uint8_t *)(io_addr)) // this macro is all we need from the sfr file
100-
10199#if defined (__AVR_AT94K__ )
102100# include "ioat94k.h"
103101#elif defined (__AVR_AT43USB320__ )
You can’t perform that action at this time.
0 commit comments