Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix firefly optical power commands #234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion projects/cm_mcu/FireflyUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ float getFFoptpow(const uint8_t i, const uint8_t ch)
val = -999.f;
break;
}
return val * 10.f; // LSB is 0.1 uW, we return uW
return val * 0.1f; // LSB is 0.1 uW, we return uW
}
#undef SWAP_BYTES

Expand Down
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
2 changes: 1 addition & 1 deletion projects/cm_mcu/commands/SensorControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ BaseType_t ff_optpow(int argc, char **argv, char *m)
else {
copied += snprintf(m + copied, SCRATCH_SIZE - copied, "\r\n");
}
if ((SCRATCH_SIZE - copied) < 20) {
if ((SCRATCH_SIZE - copied) < 40) {
++i;
return pdTRUE;
}
Expand Down