1
0

display adc measure with provided app

This commit is contained in:
2024-01-13 19:15:56 +01:00
parent 65ff5de90f
commit bf3d58a8d0
5 changed files with 112 additions and 12 deletions

View File

@@ -8,6 +8,10 @@
#include "stm32f7xx_hal.h"
#include "main.h"
#include "board/buttonscontroller.h"
#include "app/factory.h"
uint16_t adcValuesBuffer[ADC_VALUES_BUFFER_SIZE];
int ADCBufferIndex = 0;
extern "C" void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
@@ -26,8 +30,10 @@ extern "C" void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
}
extern "C" void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef * hadc) {
HAL_GPIO_TogglePin(OUT1_GPIO_Port, OUT1_Pin);
volatile uint32_t value = HAL_ADC_GetValue(hadc);
//HAL_GPIO_TogglePin(OUT1_GPIO_Port, OUT1_Pin);
adcValuesBuffer[ADCBufferIndex] = HAL_ADC_GetValue(hadc);
ADCBufferIndex++;
if(ADCBufferIndex == ADC_VALUES_BUFFER_SIZE) ADCBufferIndex = 0;
}