Skip to content

Commit

Permalink
move nanf setting
Browse files Browse the repository at this point in the history
reduce the number of chances that PMBus monitoring returns NANF
  • Loading branch information
pwittich committed Sep 19, 2024
1 parent 41075fd commit 0b5d0aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ PL_MEM_CM_rev2.xml
projects/cm_mcu/MonI2C_addresses.c
projects/cm_mcu/MonI2C_addresses.h
CornellCM_MCU.tgz
CornellCM_MCU.tar.gz
3 changes: 2 additions & 1 deletion projects/cm_mcu/MonitorTask.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ void MonitorTask(void *parameters)
// loop over commands
for (int c = 0; c < args->n_commands; ++c) {
int index = ps * (args->n_commands * args->n_pages) + page * args->n_commands + c;
args->pm_values[index] = __builtin_nanf("");

data[0] = 0x0U;
data[1] = 0x0U;
Expand All @@ -147,6 +146,7 @@ void MonitorTask(void *parameters)
if (r != SMBUS_OK) {
log_warn(LOG_MON, "%s: SMBUS failed (master/bus busy, (ps=%d,c=%d,p=%d)\r\n", args->name,
ps, c, page);
args->pm_values[index] = __builtin_nanf("");
continue; // abort reading this register
}
tries = 0;
Expand All @@ -162,6 +162,7 @@ void MonitorTask(void *parameters)
log_warn(LOG_MON, "%s: Error %d, break out of loop (ps=%d,c=%d,p=%d) ...\r\n", args->name,
*args->smbus_status, ps, c, page);
// abort reading this device
args->pm_values[index] = __builtin_nanf("");
if (log)
errbuffer_put(EBUF_I2C, (uint16_t)args->name[0]);
release_break();
Expand Down

0 comments on commit 0b5d0aa

Please sign in to comment.