|
|
@ -153,7 +153,7 @@ void app_analog_init() |
|
|
|
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_1, 4); |
|
|
|
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_1, 4); |
|
|
|
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_1); |
|
|
|
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_1); |
|
|
|
|
|
|
|
|
|
|
|
LL_ADC_EnableIT_EOS(ADC_TEMP); |
|
|
|
LL_DMA_EnableIT_TC(DMA1, LL_DMA_CHANNEL_1); |
|
|
|
|
|
|
|
|
|
|
|
LL_ADC_REG_StartConversionExtTrig(ADC_TEMP, LL_ADC_REG_TRIG_EXT_RISING); |
|
|
|
LL_ADC_REG_StartConversionExtTrig(ADC_TEMP, LL_ADC_REG_TRIG_EXT_RISING); |
|
|
|
LL_ADC_REG_StartConversionSWStart(ADC_TEMP); |
|
|
|
LL_ADC_REG_StartConversionSWStart(ADC_TEMP); |
|
|
@ -241,6 +241,7 @@ float app_temp_read_soc() |
|
|
|
|
|
|
|
|
|
|
|
void app_temp_adc_eos() |
|
|
|
void app_temp_adc_eos() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
PUTCHAR('a'); |
|
|
|
// notify
|
|
|
|
// notify
|
|
|
|
memcpy((void *) &s_analog.adc_averagebuf[s_analog.averagebuf_ptr * 4], (const void *) adc_values, 4 * sizeof(uint16_t)); |
|
|
|
memcpy((void *) &s_analog.adc_averagebuf[s_analog.averagebuf_ptr * 4], (const void *) adc_values, 4 * sizeof(uint16_t)); |
|
|
|
s_analog.averagebuf_ptr = (s_analog.averagebuf_ptr + 1) % AVERAGEBUF_DEPTH; |
|
|
|
s_analog.averagebuf_ptr = (s_analog.averagebuf_ptr + 1) % AVERAGEBUF_DEPTH; |
|
|
|