Tue, 26 Nov 2019 11:55:46 +0100
Version 0.2.1. When wakeup by user push, select the active unit screen if only one unit is active.
/** * @file task_adc.h * @brief The FreeRTOS task to query the pressure sensors connected to * ADC inputs. * The task will update the ADC_State structure. */ #ifndef _TASK_ADC_H #define _TASK_ADC_H /* * Error codes in this task */ #define ADC_ERR_NONE 0 ///< No errors #define ADC_ERR_READ 1 ///< Generic read error /** * @brief Pressure sensors */ typedef struct strPressure { bool valid; ///< Valid measurement adc_channel_t channel; ///< Channel adc_atten_t atten; ///< Attenuation uint32_t voltage; ///< Voltage measured int error; ///< Error result } pressure_t; /** * @brief Structure containing the variables for the ADC task. */ typedef struct { pressure_t Pressure[3]; ///< Pressure sensors uint32_t Batt_voltage; ///< Battery voltage int Batt_error; ///< Battery error state } ADC_State; /** * @brief Request a new measurement */ void request_adc(void); /** * @brief Check if results are ready * @return true of results are ready, else false. */ bool ready_adc(void); /** * @brief The FreeRTOS task to update the pressure sensors on request. */ void task_adc(void *); #endif