finally find the problem of code disappearing
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "can-halal.h"
|
||||
#include "stm32f0xx_hal_adc.h"
|
||||
|
||||
int16_t id = 0x200;
|
||||
int32_t adcRes = 0;
|
||||
|
||||
void adc_init(ADC_HandleTypeDef* hadc){
|
||||
HAL_ADCEx_Calibration_Start(hadc);
|
||||
}
|
||||
|
||||
void adc_loop(ADC_HandleTypeDef* hadc){
|
||||
HAL_ADC_Start_IT(hadc);
|
||||
static uint8_t data[8];
|
||||
ftcan_marshal_unsigned(data, adcRes, 4);
|
||||
ftcan_transmit(id, data, sizeof(data));
|
||||
HAL_Delay(5);
|
||||
//testing gitignore
|
||||
}
|
||||
|
||||
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){
|
||||
adcRes = HAL_ADC_GetValue(hadc);
|
||||
}
|
||||
Reference in New Issue
Block a user