Go to the documentation of this file.
29 uint8_t previous_thermostat_status =
UNKNOWN;
48 fsm_fire(p_fsm_thermostat);
51 if (current_thermostat_status != previous_thermostat_status)
56 printf(
"Thermostat ON at %ld\n", last_time_activated);
60 printf(
"Thermostat OFF at %ld\n", last_time_activated);
62 previous_thermostat_status = current_thermostat_status;
fsm_t * fsm_thermostat_new(port_led_hw_t *p_led_heat, port_led_hw_t *p_led_comfort, port_temp_hw_t *p_temp)
Creates a new thermostat FSM.
port_led_hw_t led_comfort_temperature
void port_led_init(port_led_hw_t *p_led)
Initializes the LED.
void port_system_delay_ms(uint32_t ms)
Wait for some milliseconds.
Header file for the thermostat FSM.
void port_led_off(port_led_hw_t *p_led)
Turn off the LED.
Header file for the LED port layer.
Header for port_system.c file.
port_led_hw_t led_heater_active
uint8_t fsm_thermostat_get_status(fsm_t *p_this)
Gets the thermostat status.
void port_led_on(port_led_hw_t *p_led)
Turn on the LED.
size_t port_system_init(void)
This function is based on the initialization of the HAL Library; it must be the first thing to be exe...
port_temp_hw_t temp_sensor_thermostat
uint32_t fsm_thermostat_get_last_time_event(fsm_t *p_this, uint8_t event)
Gets the last time there was an event in the thermostat. If the event is not found,...