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

Module to read the battery Voltage and Current periodically and set alarms appropriately. More...

#include "openpilot.h"
#include "flightbatterystate.h"
#include "flightbatterysettings.h"
#include "modulesettings.h"
#include "pios_thread.h"

Go to the source code of this file.

Macros

#define STACK_SIZE_BYTES   624
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define SAMPLE_PERIOD_MS   250
 

Functions

static void batteryTask (void *parameters)
 
static int32_t BatteryStart (void)
 
int32_t BatteryInitialize (void)
 

Variables

static bool module_enabled = false
 
static struct pios_thread * batteryTaskHandle
 
static int8_t voltageADCPin = -1
 
static int8_t currentADCPin = -1
 
static bool battery_settings_updated
 
static float avg_current_lpf_for_time
 

Detailed Description

Module to read the battery Voltage and Current periodically and set alarms appropriately.

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

Definition in file battery.c.