Commit 19a5117
committed
drivers/sf32lb52/lptim_systick: use averaged calibration value and add safety guards
Read RTC_BACKUP_LPCYCLE_AVE (freshly calibrated) instead of RTC_BACKUP_LPCYCLE
(stale boot-time value) in calibration timer callback. Add divide-by-zero
guards in get_elapsed_ticks() and get_rc10k_freq() for robustness when
calibration hasn't completed yet.
Signed-off-by: Joshua Jun <[email protected]>1 parent 13b627c commit 19a5117
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
139 | 149 | | |
140 | 150 | | |
141 | 151 | | |
| |||
202 | 212 | | |
203 | 213 | | |
204 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
205 | 219 | | |
206 | 220 | | |
207 | 221 | | |
| |||
0 commit comments