/*
 * Copyright (c) 2023 Juan Manuel Cruz <jcruz@fi.uba.ar> <jcruz@frba.utn.edu.ar>.
 * Copyright (c) 2026 Martin Javier Klöckner <mklockner@fi.uba.ar>
 *
 * See file `LICENSE` for full details
 */

#ifndef APP_INC_APP_H_
#define APP_INC_APP_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>

extern uint32_t g_app_runtime_us;
extern uint32_t g_app_WCET_us;
extern volatile uint32_t g_app_tick_cnt;

typedef struct {
    uint8_t start_hour, start_min;
    uint8_t end_hour, end_min;
    bool enabled;
} task_system_timer_t;

typedef struct {
    int16_t temp_set_point;   // Desired temp
    int16_t temp_sensor;      // Actual temp
    uint8_t temp_ctrl_pwm_dc; // Duty cycle of output [0, 100]
    bool temp_ctrl_enabled;
    task_system_timer_t *timer;
} shared_data_type;

extern void app_init(void);
extern void app_update(void);

#ifdef __cplusplus
}
#endif

#endif /* APP_INC_APP_H_ */
