Skip to content
Prev Previous commit
Next Next commit
change to #pragma once
  • Loading branch information
PRosenb committed Feb 7, 2019
commit 364da411feb951a28798612a47ce5f495e0e54b9
5 changes: 1 addition & 4 deletions cpp/arduino/AvrAdc.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#ifndef _AVR_ADC_H_
#define _AVR_ADC_H_
#pragma once

// mock storage to allow access to ADCSRA
extern unsigned char sfr_store;
#define _SFR_MEM8(mem_addr) sfr_store

#endif // _AVR_ADC_H_
5 changes: 1 addition & 4 deletions cpp/arduino/avr/interrupt.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#ifndef _AVR_INTERRUPT_H_
#define _AVR_INTERRUPT_H_
#pragma once

// allows the production code to define an ISR method
#define _VECTOR(N) __vector_ ## N
#define ISR(vector, ...) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link to the ISR() docs. Also, what is the extern doing here? What does this macro perform?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an explanation there

extern "C" void vector (void) __VA_ARGS__; \
void vector (void)

#endif // _AVR_INTERRUPT_H_
5 changes: 1 addition & 4 deletions cpp/arduino/avr/sleep.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _AVR_SLEEP_H_
#define _AVR_SLEEP_H_
#pragma once

#include <Godmode.h>

Expand Down Expand Up @@ -36,5 +35,3 @@ void sleep_mode() {
godmode->sleep.sleep_mode_count++;
sleep_disable();
}

#endif /* _AVR_SLEEP_H_ */
5 changes: 1 addition & 4 deletions cpp/arduino/avr/wdt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _AVR_WDT_H_
#define _AVR_WDT_H_
#pragma once

#include <Godmode.h>

Expand Down Expand Up @@ -31,5 +30,3 @@ void wdt_reset() {
GodmodeState* godmode = GODMODE();
godmode->wdt.wdt_reset_count++;
}

#endif /* _AVR_WDT_H_ */