207 {
208 bool wasSpiFailure = false;
209
210 (void)p;
211
212 chRegSetThreadName(DRIVER_NAME);
213
214 while (1) {
215 chThdSleepMilliseconds(TLE9201_POLL_INTERVAL_MS);
216
217static bool isInitialized = false;
218
220 if (isInitialized) {
221 efiPrintf("Power loss? Would have to re-init TLE9201?");
222 isInitialized = false;
223 }
224 continue;
225 }
226
227
228 for (int i = 0; i < BOARD_TLE9201_COUNT; i++) {
229 auto chip = &
chips[i];
230 if ((chip->cfg == NULL) ||
233 continue;
234 }
235
236 uint8_t diag, rev;
237
238 if (!chip->get_diag_and_rev(&diag, &rev)) {
239 if (!wasSpiFailure) {
240 efiPrintf("%s ERROR: SPI failure!", chip->name);
241 wasSpiFailure = true;
242 }
243 } else {
244 wasSpiFailure = false;
245 }
246
247 chip->process_diag_and_rev(diag, rev);
248 }
249 }
250}
static Tle9201 chips[BOARD_TLE9201_COUNT]