changes, enable ethernet

This commit is contained in:
2021-02-07 12:38:29 +01:00
parent ccdbab6f01
commit b3431fafa7
9 changed files with 36 additions and 22 deletions

View File

@ -29,7 +29,7 @@ void my_errorHandler() {
}
void second_tick(void *handle) {
logMsg("Tick");
coloredMsg(LOG_BLUE, false, "Tick");
}
@ -43,14 +43,14 @@ void my_setup_2() {
configInit();
// wizInit();
wizInit();
// cmdHandlerInit();
schAdd(second_tick, NULL, 0, 60*1000);
HAL_TIM_IC_Start_IT(&mainsCnt, TIM_CHANNEL_1);
// HAL_TIM_IC_Start_IT(&mainsCnt, TIM_CHANNEL_1);
logMsg("Application running");
}
@ -95,7 +95,7 @@ void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) {
} else if (state == 1) {
show(DEBUG_2, OFF);
uint32_t captured = (savedV < v) ? (v - savedV) : ((htim->Init.Period - savedV) + v);
double f = 1.0 / ((double)captured) * 1.0e6 * 2;
double f = 1.0 / ((double)captured) * 1.0e6;
logMsg("CCR: %ld, %f", captured, f);
state = 0;
} else {