dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
systemmod.c File Reference

System module. More...

#include "openpilot.h"
#include <eventdispatcher.h>
#include <utlist.h>
#include "systemmod.h"
#include "sanitycheck.h"
#include "taskinfo.h"
#include "taskmonitor.h"
#include "pios_thread.h"
#include "pios_mutex.h"
#include "pios_queue.h"
#include "misc_math.h"
#include "morsel.h"
#include "annunciatorsettings.h"
#include "flightstatus.h"
#include "manualcontrolcommand.h"
#include "manualcontrolsettings.h"
#include "objectpersistence.h"
#include "stabilizationsettings.h"
#include "stateestimation.h"
#include "systemsettings.h"
#include "systemstats.h"
#include "watchdogstatus.h"

Go to the source code of this file.

Data Structures

struct  EventCallbackInfo
 
struct  PeriodicObjectListStruct
 

Macros

#define DEBUG_MSG(format,...)
 
#define IDLE_COUNTS_PER_SEC_AT_NO_LOAD   995998
 
#define STACK_SIZE_BYTES   1024
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_NORMAL
 
#define SYSTEM_UPDATE_PERIOD_MS   117
 
#define SYSTEM_UPDATE_PERIOD_MS4TH   (SYSTEM_UPDATE_PERIOD_MS)
 
#define MAX_UPDATE_PERIOD_MS   350
 

Typedefs

typedef struct
PeriodicObjectListStruct 
PeriodicObjectList
 

Functions

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)
 
int32_t SystemModInitialize (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)
 

Variables

static PeriodicObjectListobjList
 
static struct
pios_recursive_mutex
mutex
 
static EventStats stats
 
static volatile uint32_t idleCounter
 
static volatile uint32_t idleCounterClear
 
static struct pios_thread * systemTaskHandle
 
static struct pios_queueobjectPersistenceQueue
 
static volatile bool config_check_needed
 
static const char *volatile custom_blink_string
 

Detailed Description

System module.

Author
The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
Tau Labs, http://taulabs.org, Copyright (C) 2013-2015
dRonin, http://dronin.org Copyright (C) 2015-2016
See Also
The GNU Public License (GPL) Version 3

Definition in file systemmod.c.