added LED code. Further Code restructure
This commit is contained in:
@ -1,9 +1,15 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "can-halal.h"
|
||||
#include "led.h"
|
||||
#include "farbe.h"
|
||||
#include "stm32f0xx_hal_adc.h"
|
||||
#include "stm32f0xx_hal_tim.h"
|
||||
|
||||
extern TIM_HandleTypeDef htim2;
|
||||
|
||||
int16_t id = 0x200;
|
||||
int32_t color = HEART_BEAT;
|
||||
int32_t adcRes = 0;
|
||||
|
||||
void adc_init(ADC_HandleTypeDef* hadc){
|
||||
@ -15,7 +21,8 @@ void adc_loop(ADC_HandleTypeDef* hadc){
|
||||
static uint8_t data[8];
|
||||
ftcan_marshal_unsigned(data, adcRes, 4);
|
||||
ftcan_transmit(id, data, sizeof(data));
|
||||
HAL_Delay(5);
|
||||
|
||||
blink(&htim2, color);
|
||||
}
|
||||
|
||||
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){
|
||||
|
||||
Reference in New Issue
Block a user