Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
#include <ch.h>
#include <hal.h>
#include "modules/loggers/sdlog_chibios/sdLog.h"
#include "modules/loggers/sdlog_chibios/usbStorage.h"
#include "modules/loggers/sdlog_chibios.h"
#include "modules/tlsf/tlsf_malloc.h"
#include "mcu_periph/adc.h"
#include "led.h"
Go to the source code of this file.
Macros | |
#define | SDLOG_START_DELAY 30 |
#define | DefaultAdcOfVoltage(voltage) ((uint32_t) (voltage/(DefaultVoltageOfAdc(1)))) |
Functions | |
static | THD_WORKING_AREA (wa_thd_startlog, 2048) |
static void | thd_startlog (void *arg) |
static | THD_WORKING_AREA (wa_thd_bat_survey, 1024) |
static void | thd_bat_survey (void *arg) |
static void | powerOutageIsr (void) |
static void | systemDeepSleep (void) |
static int | sdlog_check_free_space (struct chibios_sdlog *p, long *fd, uint16_t len) |
static void | sdlog_transmit (struct chibios_sdlog *p, long fd, uint8_t byte) |
static void | sdlog_transmit_buffer (struct chibios_sdlog *p, long fd, uint8_t *data, uint16_t len) |
static void | sdlog_send (struct chibios_sdlog *p, long fd) |
static int | null_function (struct chibios_sdlog *p) |
void | chibios_sdlog_init (struct chibios_sdlog *sdlog, FileDes *file) |
init chibios_sdlog structure More... | |
void | sdlog_chibios_init (void) |
void | sdlog_chibios_finish (bool flush) |
Variables | |
static const uint16_t | V_ALERT = DefaultAdcOfVoltage(5.5f) |
static const char | PPRZ_LOG_NAME [] = "pprzlog_" |
static const char | PPRZ_LOG_DIR [] = "PPRZ" |
event_source_t | powerOutageSource |
event_listener_t | powerOutageListener |
bool | sdOk = false |
FileDes | pprzLogFile = -1 |
struct chibios_sdlog | chibios_sdlog |
#define DefaultAdcOfVoltage | ( | voltage | ) | ((uint32_t) (voltage/(DefaultVoltageOfAdc(1)))) |
Definition at line 53 of file sdlog_chibios.c.
#define SDLOG_START_DELAY 30 |
Definition at line 45 of file sdlog_chibios.c.
Referenced by thd_startlog().
void chibios_sdlog_init | ( | struct chibios_sdlog * | sdlog, |
FileDes * | file | ||
) |
init chibios_sdlog structure
Definition at line 123 of file sdlog_chibios.c.
References chibios_sdlog::device, chibios_sdlog::file, null_function(), sdlog_check_free_space(), sdlog_send(), sdlog_transmit(), and sdlog_transmit_buffer().
Referenced by flight_recorder_init(), and thd_startlog().
|
static |
Definition at line 121 of file sdlog_chibios.c.
Referenced by chibios_sdlog_init().
|
static |
Definition at line 253 of file sdlog_chibios.c.
Referenced by thd_bat_survey().
|
static |
Definition at line 88 of file sdlog_chibios.c.
References SDLOG_OK.
Referenced by chibios_sdlog_init().
void sdlog_chibios_finish | ( | bool | flush | ) |
Definition at line 149 of file sdlog_chibios.c.
References sdLogFinish().
Referenced by thd_bat_survey(), and thdUsbStorage().
void sdlog_chibios_init | ( | void | ) |
Definition at line 138 of file sdlog_chibios.c.
References thd_startlog(), and usbStorageStartPolling().
|
static |
Definition at line 115 of file sdlog_chibios.c.
References chibios_sdlog::file.
Referenced by chibios_sdlog_init().
|
static |
Definition at line 100 of file sdlog_chibios.c.
References byte.
Referenced by chibios_sdlog_init().
|
static |
Definition at line 108 of file sdlog_chibios.c.
Referenced by chibios_sdlog_init().
|
static |
Definition at line 259 of file sdlog_chibios.c.
References SCB.
Referenced by thd_bat_survey().
|
static |
Definition at line 231 of file sdlog_chibios.c.
References AD1_4_CHANNEL, powerOutageIsr(), sdlog_chibios_finish(), systemDeepSleep(), and V_ALERT.
Referenced by thd_startlog().
|
static |
Definition at line 161 of file sdlog_chibios.c.
References chibios_sdlog_init(), gps, LED_TOGGLE, PPRZ_LOG_DIR, PPRZ_LOG_NAME, removeEmptyLogs(), SDLOG_OK, SDLOG_START_DELAY, sdLogInit(), sdOk, thd_bat_survey(), GpsState::tow, usbStorageIsItRunning(), and GpsState::week.
Referenced by sdlog_chibios_init().
|
static |
|
static |
struct chibios_sdlog chibios_sdlog |
Definition at line 78 of file sdlog_chibios.c.
event_listener_t powerOutageListener |
Definition at line 72 of file sdlog_chibios.c.
event_source_t powerOutageSource |
Definition at line 71 of file sdlog_chibios.c.
|
static |
Definition at line 56 of file sdlog_chibios.c.
Referenced by thd_startlog().
|
static |
Definition at line 55 of file sdlog_chibios.c.
Referenced by thd_startlog().
FileDes pprzLogFile = -1 |
Definition at line 76 of file sdlog_chibios.c.
Referenced by airspeed_ets_read_event(), aoa_pwm_update(), apogee_baro_event(), gps_ubx_parse(), humid_sht_periodic(), ins_float_invariant_propagate(), meteo_stick_periodic(), mf_daq_send_report(), mf_ptu_periodic(), and temod_event().
bool sdOk = false |
Definition at line 74 of file sdlog_chibios.c.
Referenced by thd_startlog().
|
static |
Definition at line 54 of file sdlog_chibios.c.
Referenced by thd_bat_survey().