46#ifndef SDLOG_START_DELAY
47#define SDLOG_START_DELAY 30
51#ifndef SDLOG_AUTO_FLUSH_PERIOD
52#define SDLOG_AUTO_FLUSH_PERIOD 10
56#ifndef SDLOG_CONTIGUOUS_STORAGE_MEM
57#define SDLOG_CONTIGUOUS_STORAGE_MEM 50
60#if (!defined USE_ADC_WATCHDOG) || (USE_ADC_WATCHDOG == 0)
61#error sdlog_chibios need USE_ADC_WATCHDOG in order to properly close files when power is unplugged
79#if FLIGHTRECORDER_SDLOG
81static const char FR_LOG_DIR[] =
"FLIGHT_RECORDER";
105#ifdef SDLOG_PREFLIGHT_ERROR
116#if PERIODIC_TELEMETRY
190#if PERIODIC_TELEMETRY
217#if FF_FS_REENTRANT == 0
225#if FLIGHTRECORDER_SDLOG
232#if defined(SDLOG_BAT_ADC) && defined(SDLOG_BAT_CHAN)
242#define DefaultAdcOfVoltage(voltage) ((uint32_t) (voltage/(DefaultVoltageOfAdc(1))))
311#if FLIGHTRECORDER_SDLOG
323#if defined(SDLOG_BAT_ADC) && defined(SDLOG_BAT_CHAN)
349#if HAL_USE_RTC && USE_GPS
375 if(ac_id !=
AC_ID && ac_id != 0xFF) {
arch independent ADC (Analog to Digital Converter) API
#define SDLOG_USB_VBUS_PIN
#define SDLOG_USB_VBUS_PORT
static THD_WORKING_AREA(wa_thd_spi1, SPI_THREAD_STACK_SIZE)
struct GpsState gps
global GPS state
Device independent GPS code (interface)
uint32_t tow
GPS time of week in ms.
void chsnprintf(char *buffer, size_t size, const char *fmt,...)
void mcu_reboot(enum reboot_state_t reboot_state)
Reboot the MCU.
void mcu_energy_save(void)
Save energy for performing operations on shutdown Used for example to shutdown SD-card logging.
@ MCU_REBOOT_POWEROFF
Poweroff the device.
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
arch independent LED (Light Emitting Diodes) API
Arch independent mcu ( Micro Controller Unit ) utilities.
void preflight_error(struct preflight_result_t *result, const char *fmt,...)
Register a preflight error used inside the preflight checking functions.
void preflight_success(struct preflight_result_t *result, const char *fmt,...)
Register a preflight success used inside the preflight checking functions.
void preflight_warning(struct preflight_result_t *result, const char *fmt,...)
Register a preflight warning used inside the preflight checking functions.
void preflight_check_register(struct preflight_check_t *check, preflight_check_f func)
Register a preflight check and add it to the linked list.
Mini printf-like functionality.
#define IN_DMA_SECTION(var)
SdioError sdLogFinish(void)
unmount filesystem
SdioError removeEmptyLogs(const char *directoryName, const char *prefix, const size_t sizeConsideredEmpty)
remove spurious log file left on sd
SdioError sdLogInit(uint32_t *freeSpaceInKo)
initialise sdLog
struct _SdLogBuffer SdLogBuffer
#define LOG_APPEND_TAG_AT_CLOSE_DISABLED
#define LOG_PREALLOCATION_DISABLED
static void sdlog_send(struct chibios_sdlog *p, long fd)
static int null_function(struct chibios_sdlog *p)
static enum @294 chibios_sdlog_status
sdlog status
static void send_sdlog_status(struct transport_tx *trans, struct link_device *dev)
static int sdlog_check_free_space(struct chibios_sdlog *p, long *fd, uint16_t len)
void logger_log_msg_up(uint8_t *buf)
static void thd_startlog(void *arg)
#define SDLOG_AUTO_FLUSH_PERIOD
static const char PPRZ_LOG_DIR[]
void sdlog_chibios_finish(const bool flush)
static void sdlog_transmit(struct chibios_sdlog *p, long fd, uint8_t byte)
#define SDLOG_START_DELAY
static char NO_FILE_NAME[]
static const char PPRZ_LOG_NAME[]
#define SDLOG_CONTIGUOUS_STORAGE_MEM
void chibios_sdlog_init(struct chibios_sdlog *sdlog, FileDes *file)
init chibios_sdlog structure
static char chibios_sdlog_filenames[68]
sdlog filenames
static uint8_t null_byte_function(struct chibios_sdlog *p)
static void sdlog_transmit_buffer(struct chibios_sdlog *p, long fd, uint8_t *data, uint16_t len)
void sdlog_chibios_init(void)
#define DEST_INFO_MSG_PPRZLOG
#define DEST_INFO_MSG_ALL
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
Dynamic memory allocation based on TLSF library.
void usbStorageStartPolling(void)
bool usbStorageIsItRunning(void)
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.