-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy path02-power.patch
100 lines (93 loc) · 3.85 KB
/
02-power.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
--- a/include/avr/power.h 2020-05-26 14:04:10.000000000 +0200
+++ b/include/avr/power.h 2020-05-26 11:29:38.153645260 +0200
@@ -689,6 +689,11 @@
#define power_spi_disable() (PRR0 |= (uint8_t)(1 << PRSPI))
#endif
+#if defined(__AVR_HAVE_PRR0_PRSPI0)
+#define power_spi_enable() (PRR0 &= (uint8_t)~(1 << PRSPI0))
+#define power_spi_disable() (PRR0 |= (uint8_t)(1 << PRSPI0))
+#endif
+
#if defined(__AVR_HAVE_PRR0_PRT0)
#define power_timer0_enable() (PRR0 &= (uint8_t)~(1 << PRT0))
#define power_timer0_disable() (PRR0 |= (uint8_t)(1 << PRT0))
@@ -734,6 +739,11 @@
#define power_twi_disable() (PRR0 |= (uint8_t)(1 << PRTWI))
#endif
+#if defined(__AVR_HAVE_PRR0_PRTWI0)
+#define power_twi_enable() (PRR0 &= (uint8_t)~(1 << PRTWI0))
+#define power_twi_disable() (PRR0 |= (uint8_t)(1 << PRTWI0))
+#endif
+
#if defined(__AVR_HAVE_PRR0_PRTWI1)
#define power_twi1_enable() (PRR0 &= (uint8_t)~(1 << PRTWI1))
#define power_twi1_disable() (PRR0 |= (uint8_t)(1 << PRTWI1))
@@ -814,6 +824,11 @@
#define power_spi_disable() (PRR1 |= (uint8_t)(1 << PRSPI))
#endif
+#if defined(__AVR_HAVE_PRR1_PRSPI1)
+#define power_spi1_enable() (PRR1 &= (uint8_t)~(1 << PRSPI1))
+#define power_spi1_disable() (PRR1 |= (uint8_t)(1 << PRSPI1))
+#endif
+
#if defined(__AVR_HAVE_PRR1_PRT1)
#define power_timer1_enable() (PRR1 &= (uint8_t)~(1 << PRT1))
#define power_timer1_disable() (PRR1 |= (uint8_t)(1 << PRT1))
@@ -859,6 +874,11 @@
#define power_transceiver_disable() (PRR1 |= (uint8_t)(1 << PRTRX24))
#endif
+#if defined(__AVR_HAVE_PRR1_PRTWI1)
+#define power_twi1_enable() (PRR1 &= (uint8_t)~(1 << PRTWI1))
+#define power_twi1_disable() (PRR1 |= (uint8_t)(1 << PRTWI1))
+#endif
+
#if defined(__AVR_HAVE_PRR1_PRUSART1)
#define power_usart1_enable() (PRR1 &= (uint8_t)~(1 << PRUSART1))
#define power_usart1_disable() (PRR1 |= (uint8_t)(1 << PRUSART1))
@@ -924,6 +944,11 @@
#define power_preamble_rssi_fifo_disable() (PRR2 |= (uint8_t)(1 << PRSF))
#endif
+#if defined(__AVR_HAVE_PRR2_PRSPI1)
+#define power_spi1_enable() (PRR2 &= (uint8_t)~(1 << PRSPI1))
+#define power_spi1_disable() (PRR2 |= (uint8_t)(1 << PRSPI1))
+#endif
+
#if defined(__AVR_HAVE_PRR2_PRSPI2)
#define power_spi2_enable() (PRR2 &= (uint8_t)~(1 << PRSPI2))
#define power_spi2_disable() (PRR2 |= (uint8_t)(1 << PRSPI2))
@@ -939,11 +964,21 @@
#define power_tx_modulator_disable() (PRR2 |= (uint8_t)(1 << PRTM))
#endif
+#if defined(__AVR_HAVE_PRR2_PRTWI1)
+#define power_twi1_enable() (PRR2 &= (uint8_t)~(1 << PRTWI1))
+#define power_twi1_disable() (PRR2 |= (uint8_t)(1 << PRTWI1))
+#endif
+
#if defined(__AVR_HAVE_PRR2_PRTWI2)
#define power_twi2_enable() (PRR2 &= (uint8_t)~(1 << PRTWI2))
#define power_twi2_disable() (PRR2 |= (uint8_t)(1 << PRTWI2))
#endif
+#if defined(__AVR_HAVE_PRR2_PRUSART2)
+#define power_usart2_enable() (PRR2 &= (uint8_t)~(1 << PRUSART2))
+#define power_usart2_disable() (PRR2 |= (uint8_t)(1 << PRUSART2))
+#endif
+
#if defined(__AVR_HAVE_PRR2_PRXA)
#define power_rx_buffer_A_enable() (PRR2 &= (uint8_t)~(1 << PRXA))
#define power_rx_buffer_A_disable() (PRR2 |= (uint8_t)(1 << PRXA))
@@ -1350,6 +1385,7 @@
|| defined(__AVR_ATmega324A__) \
|| defined(__AVR_ATmega324P__) \
|| defined(__AVR_ATmega324PA__) \
+|| defined(__AVR_ATmega324PB__) \
|| defined(__AVR_ATmega325__) \
|| defined(__AVR_ATmega325A__) \
|| defined(__AVR_ATmega325P__) \
@@ -1360,6 +1396,7 @@
|| defined(__AVR_ATmega3250PA__) \
|| defined(__AVR_ATmega328__) \
|| defined(__AVR_ATmega328P__) \
+|| defined(__AVR_ATmega328PB__) \
|| defined(__AVR_ATmega329__) \
|| defined(__AVR_ATmega329A__) \
|| defined(__AVR_ATmega329P__) \