Skip to content

Commit

Permalink
require a check on 3.3V power supply for loadclock (#157)
Browse files Browse the repository at this point in the history
* loadclock req. a 3.3V power supply implemented
  • Loading branch information
pkotamnives authored Oct 28, 2022
1 parent 8ad8b7b commit fcebefd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions projects/cm_mcu/CommandLineTask.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ static BaseType_t init_load_clock_ctl(int argc, char **argv, char *m)
}
copied += snprintf(m + copied, SCRATCH_SIZE - copied, "%s is programming clock %s. \r\n", argv[0], clk_ids[i]);
int status = -1; // shut up clang compiler warning
enum power_system_state power_state = getPowerControlState();
if (power_state != POWER_ON) { // if the power state is not fully on
snprintf(m + copied, SCRATCH_SIZE - copied, " 3V3 died. skip loadclock\r\n");
return pdFALSE; // skip this iteration
}
// grab the semaphore to ensure unique access to I2C controller
while (xSemaphoreTake(i2c2_sem, (TickType_t)10) == pdFALSE)
;
Expand Down

0 comments on commit fcebefd

Please sign in to comment.