Implementation of annunciation and simple color blending for RGB LEDs.
More...
|
void | systemmod_process_rgb_leds (bool led_override, bool led_override_active, uint8_t blink_prio, bool is_armed, bool force_dim) |
|
int32_t | SystemModInitialize (void) |
|
static void | systemPeriodicCb (const UAVObjEvent *ev, void *ctx, void *obj_data, int len) |
|
static void | objectUpdatedCb (const UAVObjEvent *ev, void *ctx, void *obj, int len) |
|
static uint32_t | processPeriodicUpdates () |
|
static int32_t | eventPeriodicCreate (UAVObjEvent *ev, UAVObjEventCallback cb, struct pios_queue *queue, uint16_t periodMs) |
|
static int32_t | eventPeriodicUpdate (UAVObjEvent *ev, UAVObjEventCallback cb, struct pios_queue *queue, uint16_t periodMs) |
|
static void | configurationUpdatedCb (const UAVObjEvent *ev, void *ctx, void *obj, int len) |
|
void | system_task () |
|
static void | updateStats () |
|
static void | updateSystemAlarms () |
|
int32_t | SystemModStart (void) |
|
| DONT_BUILD_IF (ANNUNCIATORSETTINGS_ANNUNCIATEAFTERARMING_NUMELEM!=ANNUNCIATORSETTINGS_ANNUNCIATEANYTIME_NUMELEM, AnnuncSettingsMismatch1) |
|
| DONT_BUILD_IF (ANNUNCIATORSETTINGS_ANNUNCIATEAFTERARMING_MAXOPTVAL!=ANNUNCIATORSETTINGS_ANNUNCIATEANYTIME_MAXOPTVAL, AnnuncSettingsMismatch2) |
|
void | system_annunc_custom_string (const char *string) |
|
void | vApplicationIdleHook (void) |
|
void | EventGetStats (EventStats *statsOut) |
|
void | EventClearStats () |
|
int32_t | EventPeriodicCallbackCreate (UAVObjEvent *ev, UAVObjEventCallback cb, uint16_t periodMs) |
|
int32_t | EventPeriodicCallbackUpdate (UAVObjEvent *ev, UAVObjEventCallback cb, uint16_t periodMs) |
|
int32_t | EventPeriodicQueueCreate (UAVObjEvent *ev, struct pios_queue *queue, uint16_t periodMs) |
|
int32_t | EventPeriodicQueueUpdate (UAVObjEvent *ev, struct pios_queue *queue, uint16_t periodMs) |
|
| DONT_BUILD_IF (ANNUNCIATORSETTINGS_MANUALBUZZER_MAXOPTVAL > MANUALCONTROLCOMMAND_ACCESSORY_NUMELEM, TooManyManualBuzzers) |
|
Implementation of annunciation and simple color blending for RGB LEDs.
#define DEBUG_MSG |
( |
|
format, |
|
|
|
... |
|
) |
| |
#define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 995998 |
#define MAX_UPDATE_PERIOD_MS 350 |
#define STACK_SIZE_BYTES 1024 |
#define SYSTEM_UPDATE_PERIOD_MS 117 |
static void configurationUpdatedCb |
( |
const UAVObjEvent * |
ev, |
|
|
void * |
ctx, |
|
|
void * |
obj, |
|
|
int |
len |
|
) |
| |
|
static |
Called whenever a critical configuration component changes
Definition at line 707 of file systemmod.c.
DONT_BUILD_IF |
( |
ANNUNCIATORSETTINGS_ANNUNCIATEAFTERARMING_NUMELEM! |
= ANNUNCIATORSETTINGS_ANNUNCIATEANYTIME_NUMELEM , |
|
|
AnnuncSettingsMismatch1 |
|
|
) |
| |
DONT_BUILD_IF |
( |
ANNUNCIATORSETTINGS_ANNUNCIATEAFTERARMING_MAXOPTVAL! |
= ANNUNCIATORSETTINGS_ANNUNCIATEANYTIME_MAXOPTVAL , |
|
|
AnnuncSettingsMismatch2 |
|
|
) |
| |
DONT_BUILD_IF |
( |
ANNUNCIATORSETTINGS_MANUALBUZZER_MAXOPTVAL |
, |
|
|
MANUALCONTROLCOMMAND_ACCESSORY_NUMELEM |
, |
|
|
TooManyManualBuzzers |
|
|
) |
| |
Clear the statistics counters
Definition at line 869 of file systemmod.c.
Get the statistics counters
- Parameters
-
[out] | statsOut | The statistics counters will be copied there |
Definition at line 859 of file systemmod.c.
Dispatch an event at periodic intervals.
- Parameters
-
[in] | ev | The event to be dispatched |
[in] | cb | The callback to be invoked |
[in] | periodMs | The period the event is generated |
- Returns
- Success (0), failure (-1)
- Todo:
- would be nice to get context record logic in these
Definition at line 884 of file systemmod.c.
Update the period of a periodic event.
- Parameters
-
[in] | ev | The event to be dispatched |
[in] | cb | The callback to be invoked |
[in] | periodMs | The period the event is generated |
- Returns
- Success (0), failure (-1)
Definition at line 896 of file systemmod.c.
Dispatch an event through a callback at periodic intervals.
- Parameters
-
[in] | ev | The event to be dispatched |
[in] | cb | The callback to be invoked or zero if none |
[in] | queue | The queue or zero if none |
[in] | periodMs | The period the event is generated |
- Returns
- Success (0), failure (-1)
Definition at line 933 of file systemmod.c.
Dispatch an event at periodic intervals.
- Parameters
-
[in] | ev | The event to be dispatched |
[in] | queue | The queue that the event will be pushed in |
[in] | periodMs | The period the event is generated |
- Returns
- Success (0), failure (-1)
Definition at line 908 of file systemmod.c.
Update the period of a periodic event.
- Parameters
-
[in] | ev | The event to be dispatched |
[in] | queue | The queue |
[in] | periodMs | The period the event is generated |
- Returns
- Success (0), failure (-1)
Definition at line 920 of file systemmod.c.
Update the period of a periodic event.
- Parameters
-
[in] | ev | The event to be dispatched |
[in] | cb | The callback to be invoked or zero if none |
[in] | queue | The queue or zero if none |
[in] | periodMs | The period the event is generated |
- Returns
- Success (0), failure (-1)
Definition at line 978 of file systemmod.c.
static void objectUpdatedCb |
( |
const UAVObjEvent * |
ev, |
|
|
void * |
ctx, |
|
|
void * |
obj_data, |
|
|
int |
len |
|
) |
| |
|
static |
Function called in response to object updates
Definition at line 634 of file systemmod.c.
static uint32_t processPeriodicUpdates |
( |
| ) |
|
|
static |
Handle periodic updates for all objects.
- Returns
- The system time until the next update (in ms) or -1 if failed
Definition at line 1014 of file systemmod.c.
void system_annunc_custom_string |
( |
const char * |
string | ) |
|
void systemmod_process_rgb_leds |
( |
bool |
led_override, |
|
|
bool |
led_override_active, |
|
|
uint8_t |
blink_prio, |
|
|
bool |
is_armed, |
|
|
bool |
force_dim |
|
) |
| |
int32_t SystemModInitialize |
( |
void |
| ) |
|
Initialize the module, called on startup.
- Returns
- 0 on success or -1 if initialization failed
Definition at line 188 of file systemmod.c.
int32_t SystemModStart |
( |
void |
| ) |
|
Create the module task.
- Returns
- 0 on success or -1 if initialization failed
Definition at line 172 of file systemmod.c.
static void systemPeriodicCb |
( |
const UAVObjEvent * |
ev, |
|
|
void * |
ctx, |
|
|
void * |
obj_data, |
|
|
int |
len |
|
) |
| |
|
static |
static void updateStats |
( |
| ) |
|
|
inlinestatic |
Called periodically to update the WDG statistics Called periodically to update the system stats
Definition at line 735 of file systemmod.c.
static void updateSystemAlarms |
( |
| ) |
|
|
inlinestatic |
void vApplicationIdleHook |
( |
void |
| ) |
|
Called by the RTOS when the CPU is idle, used to measure the CPU idle time.
Definition at line 844 of file systemmod.c.
volatile bool config_check_needed |
|
static |
const char* volatile custom_blink_string |
|
static |
volatile uint32_t idleCounter |
|
static |
volatile uint32_t idleCounterClear |
|
static |
struct pios_thread* systemTaskHandle |
|
static |