configuration

This commit is contained in:
2020-11-27 13:37:57 +01:00
parent 9223cbda73
commit cb5dd5f79a
5 changed files with 7 additions and 19 deletions

View File

@ -6,9 +6,10 @@
#include <frontend.h>
#include <logger.h>
#include <show.h>
#include <config.h>
static t_configBlock *config;
static volatile int32_t frontendAdcThreshold = 0;
@ -16,16 +17,15 @@ static volatile bool frontendEnabled = false;
void frontendInit() {
config = getConfig();
frontendAdcThreshold = config->frontendThreshold;
HAL_ADCEx_Calibration_Start(&frontendAdc);
logMsg("frontendInit, calibration done");
HAL_ADC_Start_IT(&frontendAdc);
logMsg("frontendInit, adc started");
}
void frontendSetThreshold(int32_t threshold) {
frontendAdcThreshold = threshold;
}
void frontendEnable() {
frontendEnabled = true;
}