31 #include "hwsimulation.h"
33 #if defined(PIOS_INCLUDE_ANNUNC)
44 static inline void set_led(uint32_t led, uint8_t stat) {
47 uint8_t old_state = ledState[led];
48 uint8_t new_state = stat ? HWSIMULATION_LEDSTATE_ON : HWSIMULATION_LEDSTATE_OFF;
50 if (old_state == new_state)
52 ledState[led] = new_state;
54 HwSimulationLedStateSet(ledState);
58 for (
int i = 0;
i < HWSIMULATION_LEDSTATE_NUMELEM;
i++) {
59 leds[
i] = (ledState[
i] == HWSIMULATION_LEDSTATE_ON) ?
'*' :
'.';
77 bool PIOS_ANNUNC_GetStatus(uint32_t led)
81 return ledState[led] == HWSIMULATION_LEDSTATE_ON;
112 set_led(led, !PIOS_ANNUNC_GetStatus(led));
uint32_t PIOS_Thread_Systime(void)
Main PiOS header to include all the compiled in PiOS options.
void PIOS_ANNUNC_Off(uint32_t annunc_id)
int32_t PIOS_ANNUNC_Init(const struct pios_annunc_cfg *cfg)
void PIOS_ANNUNC_On(uint32_t annunc_id)
void PIOS_ANNUNC_Toggle(uint32_t annunc_id)
#define DONT_BUILD_IF(COND, MSG)
Includes PiOS and core architecture components.
int printf(const char *format,...)
#define PIOS_Assert(test)
#define PIOS_LED_HEARTBEAT
uint32_t PIOS_DELAY_GetRaw()
Get the raw delay timer, useful for timing.