Sat, 01 Apr 2023 21:06:59 +0200
Added task_out to drive the relays and led lights. Added NVS namespace to store the state of the outputs. Respond to subscribed MQTT topics to set new output values.
/** * @file task_out.h * @brief The FreeRTOS task to drive the output relays and dimmed leds. */ #ifndef _TASK_OUT_H #define _TASK_OUT_H /* * Error codes in this task */ #define OUT_ERR_NONE 0 ///< No errors #define OUT_ERR_READ 1 /** * @brief Structure containing the variables for the out task. */ typedef struct { int error; ///< Error result uint8_t out1; ///< Actual output state uint8_t out2; uint8_t out3; uint8_t out4; } OUT_State; /** * @brief The FreeRTOS task to update the outputs. * @param pvParameters Parameters for the task. */ void task_out(void *pvParameters); #endif