Paparazzi UAS  v7.0_unstable
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.

Macros

#define SDLOG_USB_VBUS_BOOT   false
 

Functions

static void thdUsbStorage (void *arg)
 
static BSEMAPHORE_DECL (bs_start_msd, true)
 
static void usbActivity (bool active)
 
static THD_WORKING_AREA (waThdUsbStorage, 4096)
 
void usbStorageStartPolling (void)
 
void usbStorageWaitForDeconnexion (void)
 
void usbStorageStop (void)
 
bool usbStorageIsItRunning (void)
 
void usbStorage_enable_usb_storage (float e)
 

Variables

static thread_t * usbStorageThreadPtr = NULL
 
static bool isRunning = false
 
float usb_storage_status = 0
 
static USBMassStorageConfig msdConfig
 

Macro Definition Documentation

◆ SDLOG_USB_VBUS_BOOT

#define SDLOG_USB_VBUS_BOOT   false

Definition at line 41 of file usbStorage.c.

Function Documentation

◆ BSEMAPHORE_DECL()

static BSEMAPHORE_DECL ( bs_start_msd  ,
true   
)
static

◆ THD_WORKING_AREA()

static THD_WORKING_AREA ( waThdUsbStorage  ,
4096   
)
static

◆ thdUsbStorage()

static void thdUsbStorage ( void *  arg)
static

◆ usbActivity()

static void usbActivity ( bool  active)
static

Definition at line 52 of file usbStorage.c.

References LED_OFF, LED_ON, and SDLOG_USB_LED.

◆ usbStorage_enable_usb_storage()

void usbStorage_enable_usb_storage ( float  e)

Definition at line 171 of file usbStorage.c.

References SDLOG_USB_VBUS_PIN, SDLOG_USB_VBUS_PORT, and usb_storage_status.

◆ usbStorageIsItRunning()

bool usbStorageIsItRunning ( void  )

Definition at line 163 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 76 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 92 of file usbStorage.c.

References usbStorageThreadPtr.

◆ usbStorageWaitForDeconnexion()

void usbStorageWaitForDeconnexion ( void  )

Definition at line 84 of file usbStorage.c.

References usbStorageThreadPtr.

Variable Documentation

◆ isRunning

bool isRunning = false
static

Definition at line 47 of file usbStorage.c.

Referenced by thdUsbStorage(), and usbStorageIsItRunning().

◆ msdConfig

USBMassStorageConfig msdConfig
static
Initial value:
= {
&USBD1,
(BaseBlockDevice *) &SDLOG_SDIO,
"Pprz_sd",
"AutoPilot",
"0.2"
}
static void usbActivity(bool active)
Definition: usbStorage.c:52
#define USB_MS_DATA_EP
Definition: usb_msd.h:40

Definition at line 64 of file usbStorage.c.

Referenced by init_msd_driver(), and thdUsbStorage().

◆ usb_storage_status

float usb_storage_status = 0

Definition at line 48 of file usbStorage.c.

Referenced by thdUsbStorage(), and usbStorage_enable_usb_storage().

◆ usbStorageThreadPtr

thread_t* usbStorageThreadPtr = NULL
static