Skip to content

Commit caaea28

Browse files
committed
Re-ordered macros and defines
1 parent be8b9cc commit caaea28

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

WeatherStationReceiver.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,6 @@
44
Function Declarations
55
--------------------------------------------------------------------------------------*/
66

7-
/*--------------------------------------------------------------------------------------
8-
General macros
9-
--------------------------------------------------------------------------------------*/
10-
#define INPUT_CAPTURE_IS_RISING_EDGE() ((TCCR1B & _BV(ICES1)) != 0)
11-
#define INPUT_CAPTURE_IS_FALLING_EDGE() ((TCCR1B & _BV(ICES1)) == 0)
12-
#define SET_INPUT_CAPTURE_RISING_EDGE() (TCCR1B |= _BV(ICES1))
13-
#define SET_INPUT_CAPTURE_FALLING_EDGE() (TCCR1B &= ~_BV(ICES1))
14-
15-
#define GREEN_TESTLED_IS_ON() ((PORTD & (1<<PORTD6)) == 0)
16-
#define GREEN_TESTLED_IS_OFF() ((PORTD & (1<<PORTD6)) != 0)
17-
#define GREEN_TESTLED_ON() ((PORTD &= ~(1<<PORTD6)))
18-
#define GREEN_TESTLED_OFF() ((PORTD |= (1<<PORTD6)))
19-
#define GREEN_TESTLED_TOGGLE() if(GREEN_TESTLED_IS_ON()){GREEN_TESTLED_OFF();}else{GREEN_TESTLED_ON();}
20-
21-
#define RED_TESTLED_IS_ON() ((PORTD & (1<<PORTD7)) == 0)
22-
#define RED_TESTLED_IS_OFF() ((PORTD & (1<<PORTD7)) != 0)
23-
#define RED_TESTLED_ON() ((PORTD &= ~(1<<PORTD7)))
24-
#define RED_TESTLED_OFF() ((PORTD |= (1<<PORTD7)))
25-
#define RED_TESTLED_TOGGLE() if(RED_TESTLED_IS_ON()){RED_TESTLED_OFF();}else{RED_TESTLED_ON();}
26-
277
/*--------------------------------------------------------------------------------------
288
Defines
299
--------------------------------------------------------------------------------------*/
@@ -61,4 +41,24 @@ typedef signed int sint; //16bit
6141

6242
#define WSR_RESET() { bICP_WSR_State = WSR_STATE_IDLE; bICP_WSR_PacketInputBitPointer = WSR_TIMESTAMP_BIT_OFFSET; }
6343

44+
/*--------------------------------------------------------------------------------------
45+
General macros
46+
--------------------------------------------------------------------------------------*/
47+
#define INPUT_CAPTURE_IS_RISING_EDGE() ((TCCR1B & _BV(ICES1)) != 0)
48+
#define INPUT_CAPTURE_IS_FALLING_EDGE() ((TCCR1B & _BV(ICES1)) == 0)
49+
#define SET_INPUT_CAPTURE_RISING_EDGE() (TCCR1B |= _BV(ICES1))
50+
#define SET_INPUT_CAPTURE_FALLING_EDGE() (TCCR1B &= ~_BV(ICES1))
51+
52+
#define GREEN_TESTLED_IS_ON() ((PORTD & (1<<PORTD6)) == 0)
53+
#define GREEN_TESTLED_IS_OFF() ((PORTD & (1<<PORTD6)) != 0)
54+
#define GREEN_TESTLED_ON() ((PORTD &= ~(1<<PORTD6)))
55+
#define GREEN_TESTLED_OFF() ((PORTD |= (1<<PORTD6)))
56+
#define GREEN_TESTLED_TOGGLE() if(GREEN_TESTLED_IS_ON()){GREEN_TESTLED_OFF();}else{GREEN_TESTLED_ON();}
57+
58+
#define RED_TESTLED_IS_ON() ((PORTD & (1<<PORTD7)) == 0)
59+
#define RED_TESTLED_IS_OFF() ((PORTD & (1<<PORTD7)) != 0)
60+
#define RED_TESTLED_ON() ((PORTD &= ~(1<<PORTD7)))
61+
#define RED_TESTLED_OFF() ((PORTD |= (1<<PORTD7)))
62+
#define RED_TESTLED_TOGGLE() if(RED_TESTLED_IS_ON()){RED_TESTLED_OFF();}else{RED_TESTLED_ON();}
63+
6464
#endif /*WSR_H_*/

0 commit comments

Comments
 (0)