configuration
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user