call frontendInit later, however, still not working correctly
This commit is contained in:
@ -21,9 +21,9 @@ static volatile bool frontendEnabled = false;
|
|||||||
|
|
||||||
|
|
||||||
void frontendInit() {
|
void frontendInit() {
|
||||||
double u_threshold = I_THRESHOLD * SHUNT_RESISTOR;
|
// double u_threshold = I_THRESHOLD * SHUNT_RESISTOR;
|
||||||
frontendAdcThreshold = (uint16_t) (u_threshold / U_REF * ((double) N_MAX));
|
// frontendAdcThreshold = (uint16_t) (u_threshold / U_REF * ((double) N_MAX));
|
||||||
logMsg("frontendInit, threshold calculated: %d", frontendAdcThreshold);
|
// logMsg("frontendInit, threshold calculated: %d", frontendAdcThreshold);
|
||||||
|
|
||||||
HAL_ADCEx_Calibration_Start(&frontendAdc);
|
HAL_ADCEx_Calibration_Start(&frontendAdc);
|
||||||
logMsg("frontendInit, calibration done");
|
logMsg("frontendInit, calibration done");
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
void my_setup_1() {
|
void my_setup_1() {
|
||||||
schInit();
|
schInit();
|
||||||
logInit();
|
logInit();
|
||||||
// frontendInit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void my_errorHandler() {
|
void my_errorHandler() {
|
||||||
@ -38,6 +37,8 @@ void my_setup_2() {
|
|||||||
led(RED, OFF);
|
led(RED, OFF);
|
||||||
led(GREEN, ON);
|
led(GREEN, ON);
|
||||||
|
|
||||||
|
frontendInit();
|
||||||
|
|
||||||
schAdd(helloMeterbus, NULL, 0, 10000);
|
schAdd(helloMeterbus, NULL, 0, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user