Commit 2c2f0b2
esp32: Re-use allocated timer interrupts and simplify UART timer code.
If the interrupt is not freed but merely disabled, instead of reallocating
it every time the timer is enabled again we can instead just re-enable it.
That means we're no longer setting the handler every time, and we need to
ensure it does not change. Doing so by adding an additional wrapper
function does not only solve that problem, it also allows us to remove
some code duplication and simplify how machine_uart uses the timer.
Signed-off-by: Daniël van de Giessen <[email protected]>1 parent bf90930 commit 2c2f0b2
3 files changed
+31
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
172 | | - | |
173 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
174 | 185 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
| |||
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
| 239 | + | |
232 | 240 | | |
233 | | - | |
234 | 241 | | |
235 | | - | |
| 242 | + | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 113 | + | |
125 | 114 | | |
126 | | - | |
127 | | - | |
| 115 | + | |
| 116 | + | |
128 | 117 | | |
129 | | - | |
130 | | - | |
| 118 | + | |
| 119 | + | |
131 | 120 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
135 | 124 | | |
136 | | - | |
| 125 | + | |
137 | 126 | | |
138 | 127 | | |
139 | 128 | | |
| |||
150 | 139 | | |
151 | 140 | | |
152 | 141 | | |
153 | | - | |
154 | | - | |
155 | | - | |
| 142 | + | |
156 | 143 | | |
157 | 144 | | |
158 | 145 | | |
| |||
553 | 540 | | |
554 | 541 | | |
555 | 542 | | |
| 543 | + | |
556 | 544 | | |
557 | 545 | | |
558 | 546 | | |
559 | 547 | | |
560 | | - | |
561 | 548 | | |
562 | 549 | | |
563 | 550 | | |
| |||
0 commit comments