Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
usbStorage.c File Reference
#include <ch.h>
#include <hal.h>
#include "usb_msd.h"
#include "usbStorage.h"
#include "modules/loggers/sdlog_chibios.h"
#include <stdio.h>
#include <string.h>
#include "main_chibios.h"
#include "mcu.h"
#include "mcu_periph/sdio.h"
#include "led.h"
+ Include dependency graph for usbStorage.c:

Go to the source code of this file.

Functions

static void thdUsbStorage (void *arg)
 
static void usbActivity (bool active)
 
static THD_WORKING_AREA (waThdUsbStorage, 1024)
 
void usbStorageStartPolling (void)
 
void usbStorageWaitForDeconnexion (void)
 
void usbStorageStop (void)
 
bool usbStorageIsItRunning (void)
 

Variables

static thread_t * usbStorageThreadPtr = NULL
 
static bool isRunning = false
 
static USBMassStorageConfig msdConfig
 

Function Documentation

◆ THD_WORKING_AREA()

static THD_WORKING_AREA ( waThdUsbStorage  ,
1024   
)
static

◆ thdUsbStorage()

static void thdUsbStorage ( void *  arg)
static

Definition at line 96 of file usbStorage.c.

References deinit_msd_driver(), init_msd_driver(), isRunning, mcu_reset(), msd_register_evt_connected(), msdConfig, pprz_terminate_autopilot_threads(), sdio_connect(), sdlog_chibios_finish(), SDLOG_USB_VBUS_PIN, and SDLOG_USB_VBUS_PORT.

Referenced by usbStorageStartPolling().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usbActivity()

static void usbActivity ( bool  active)
static

Definition at line 46 of file usbStorage.c.

References LED_OFF, LED_ON, and SDLOG_USB_LED.

◆ usbStorageIsItRunning()

bool usbStorageIsItRunning ( void  )

Definition at line 145 of file usbStorage.c.

References isRunning.

Referenced by thd_startlog().

+ Here is the caller graph for this function:

◆ usbStorageStartPolling()

void usbStorageStartPolling ( void  )

Definition at line 70 of file usbStorage.c.

References thdUsbStorage(), and usbStorageThreadPtr.

Referenced by sdlog_chibios_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usbStorageStop()

void usbStorageStop ( void  )

Definition at line 86 of file usbStorage.c.

References usbStorageThreadPtr.

◆ usbStorageWaitForDeconnexion()

void usbStorageWaitForDeconnexion ( void  )

Definition at line 78 of file usbStorage.c.

References usbStorageThreadPtr.

Variable Documentation

◆ isRunning

bool isRunning = false
static

Definition at line 42 of file usbStorage.c.

Referenced by thdUsbStorage(), and usbStorageIsItRunning().

◆ msdConfig

USBMassStorageConfig msdConfig
static
Initial value:
= {
&USBD1,
(BaseBlockDevice *) &SDCD1,
"Pprz_sd",
"AutoPilot",
"0.2"
}

Definition at line 58 of file usbStorage.c.

Referenced by init_msd_driver(), and thdUsbStorage().

◆ usbStorageThreadPtr

thread_t* usbStorageThreadPtr = NULL
static
USB_MS_DATA_EP
#define USB_MS_DATA_EP
Definition: usb_msd.h:40
usbActivity
static void usbActivity(bool active)
Definition: usbStorage.c:46