call frontendInit later, however, still not working correctly

This commit is contained in:
2020-10-31 22:19:48 +01:00
parent 95af24a12a
commit a5b20556ac
2 changed files with 5 additions and 4 deletions

View File

@ -21,9 +21,9 @@ static volatile bool frontendEnabled = false;
void frontendInit() {
double u_threshold = I_THRESHOLD * SHUNT_RESISTOR;
frontendAdcThreshold = (uint16_t) (u_threshold / U_REF * ((double) N_MAX));
logMsg("frontendInit, threshold calculated: %d", frontendAdcThreshold);
// double u_threshold = I_THRESHOLD * SHUNT_RESISTOR;
// frontendAdcThreshold = (uint16_t) (u_threshold / U_REF * ((double) N_MAX));
// logMsg("frontendInit, threshold calculated: %d", frontendAdcThreshold);
HAL_ADCEx_Calibration_Start(&frontendAdc);
logMsg("frontendInit, calibration done");

View File

@ -19,7 +19,6 @@
void my_setup_1() {
schInit();
logInit();
// frontendInit();
}
void my_errorHandler() {
@ -38,6 +37,8 @@ void my_setup_2() {
led(RED, OFF);
led(GREEN, ON);
frontendInit();
schAdd(helloMeterbus, NULL, 0, 10000);
}