Skip to content

Commit

Permalink
Merge pull request #4 from apollo-lhc/i2chang_fix
Browse files Browse the repository at this point in the history
Protect against 3.3V going away in Monitoring Task
  • Loading branch information
pwittich authored Jul 22, 2019
2 parents c30492c + 07bb111 commit a8e8881
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions projects/project2/MonitorTask.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "common/i2c_reg.h"
#include "common/smbus.h"
#include "common/smbus_units.h"
#include "common/power_ctl.h"
#include "MonitorTask.h"

void Print(const char* str);
Expand Down Expand Up @@ -109,18 +110,18 @@ void MonitorTask(void *parameters)

for (;;) {
//int prio = getLowestEnabledPSPriority();
// static bool good = false;
// if ( getPSStatus(5) != PWR_ON) {
// if ( good ) {
// Print("MON: 3V3 died. Skipping I2C monitoring.\n");
// good = false;
// }
// vTaskDelayUntil(&xLastWakeTime, pdMS_TO_TICKS(500));
// continue;
// }
// else {
// good = true;
// }
static bool good = false;
if ( getPSStatus(5) != PWR_ON) {
if ( good ) {
Print("MON: 3V3 died. Skipping I2C monitoring.\n");
good = false;
}
vTaskDelayUntil(&xLastWakeTime, pdMS_TO_TICKS(500));
continue;
}
else {
good = true;
}
// loop over power supplies attached to the MUX
for ( uint8_t ps = 0; ps < NSUPPLIES; ++ ps ) {
char tmp[64];
Expand Down

0 comments on commit a8e8881

Please sign in to comment.