cleanup code and write a little documentation

This commit is contained in:
2021-11-28 23:40:43 +01:00
parent 7bfa0732db
commit b6a2790a59
4 changed files with 63 additions and 5 deletions

View File

@@ -31,8 +31,22 @@
#include <reflow-controller/safety/safety-controller.h>
static const uint8_t safety_adc_channels[SAFETY_ADC_NUM_OF_CHANNELS] = {SAFETY_ADC_CHANNELS};
static volatile uint8_t safety_adc_conversion_complete;
static volatile uint8_t safety_adc_triggered;
/**
* @brief Safety ADC conversion complete. Set in interrupt.
*/
static volatile uint8_t IN_SECTION(.ccm.bss) safety_adc_conversion_complete;
/**
* @brief Safety ADC has been started. It will perform all specified conversions and
* set @ref safety_adc_conversion_complete afterwards
*/
static volatile uint8_t IN_SECTION(.ccm.bss) safety_adc_triggered;
/**
* @brief Safety ADC conversion storage. This is filled by DMA.
* @note Do not move this to CCM RAM as the DMA won't be able to access it.
*/
static volatile uint16_t safety_adc_conversions[SAFETY_ADC_NUM_OF_CHANNELS];
void safety_adc_init(void)