Skip to content

Commit 6321cba

Browse files
committed
add explanations
1 parent 7e3eedc commit 6321cba

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

cpp/arduino/AvrAdc.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#pragma once
22

3-
// mock storage to allow access to ADCSRA
3+
// ADCSRA is defined in the CPU specific header files
4+
// like iom328p.h.
5+
// It is liked to _SFR_MEM8 what does not exists in the test environment.
6+
// Therefore we define _SFR_MEM8 here and provide it a storage
7+
// location so that the test code can read/write on it.
48
extern unsigned char sfr_store;
59
#define _SFR_MEM8(mem_addr) sfr_store

cpp/arduino/avr/interrupt.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
/*
2+
This header file defines the macros required for the production
3+
code for AVR CPUs to declare ISRs in the test environment.
4+
See for more details
5+
https://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
6+
*/
17
#pragma once
28

3-
// allows the production code to define an ISR method
9+
// Allows the production code to define an ISR method.
10+
// These definitions come from the original avr/interrupt.h file
11+
// https://www.nongnu.org/avr-libc/user-manual/interrupt_8h_source.html
412
#define _VECTOR(N) __vector_ ## N
513
#define ISR(vector, ...) \
614
extern "C" void vector (void) __VA_ARGS__; \

cpp/arduino/avr/sleep.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
This header file defines the functionality to put AVR CPUs to sleep mode.
3+
For details see
4+
https://www.nongnu.org/avr-libc/user-manual/group__avr__sleep.html
5+
*/
16
#pragma once
27

38
#include <Godmode.h>

cpp/arduino/avr/wdt.h

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
This header file defines the funtionality to use the watchdog timer on
3+
AVR CPUs.
4+
For details see
5+
https://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html
6+
*/
17
#pragma once
28

39
#include <Godmode.h>

0 commit comments

Comments
 (0)