Skip to content

Commit

Permalink
cal warning
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Jan 8, 2025
1 parent 5f53e20 commit f20b5e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/driver/drv_pwrCal.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ static commandResult_t Calibrate(const char *cmd, const char *args, float raw,
CMD_GetResultString(CMD_RES_BAD_ARGUMENT));
return CMD_RES_BAD_ARGUMENT;
}
#define VERY_SMALL_VAL 0.001f
if (raw > -VERY_SMALL_VAL && raw < VERY_SMALL_VAL) {
ADDLOG_ERROR(LOG_FEATURE_ENERGYMETER, "Calibration incorrect - connect load first.");
}


*cal = (cal_type == PWR_CAL_MULTIPLY ? real / raw : raw / real);
CFG_SetPowerMeasurementCalibrationFloat(cfg_index, *cal);
Expand Down

0 comments on commit f20b5e2

Please sign in to comment.