Commit 4471418
committed
driver: adc_esp32: protect the adc reading against core migration.
On dual core esp32 the either the interrupts and the FoC task may migrate
to a different core, making the ADC registers subject to corruption if
the other core tries to manage the ADC while current core owns it, so
add a spinlock around the ADC to avoid that. On single core devices
this is call is a NOOP.
Signed-off-by: Felipe Neves <[email protected]>1 parent c4e8470 commit 4471418
File tree
1 file changed
+14
-0
lines changed- src/current_sense/hardware_specific/esp32
1 file changed
+14
-0
lines changedLines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| |||
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
131 | 143 | | |
132 | 144 | | |
133 | 145 | | |
| |||
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| 169 | + | |
| 170 | + | |
157 | 171 | | |
158 | 172 | | |
159 | 173 | | |
| |||
0 commit comments