rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
mass_storage_init.h File Reference

Functions

void initUsbMsd ()
 
void attachMsdSdCard (BaseBlockDevice *blkdev, uint8_t *blkbuf, size_t blkbufsize)
 
void deattachMsdSdCard (void)
 

Function Documentation

◆ attachMsdSdCard()

void attachMsdSdCard ( BaseBlockDevice *  blkdev,
uint8_t *  blkbuf,
size_t  blkbufsize 
)

Definition at line 77 of file mass_storage_init.cpp.

77 {
78 if ((blkbuf == NULL) || (blkbufsize == 0)) {
79 // if no specific buffer was provided use default
81 blkbufsize = sizeof(blkbuf0);
82 }
83 msd.attachLun(1, blkdev, blkbuf, blkbufsize, &sdCardInquiry, nullptr);
84
85#if EFI_TUNER_STUDIO
86 // SD MSD attached, enable indicator in TS
88#endif
89}
TunerStudioOutputChannels outputChannels
Definition engine.h:109
void attachLun(uint8_t lunIndex, BaseBlockDevice *blkdev, uint8_t *blkbuf, size_t blkbufsize, const scsi_inquiry_response_t *inquiry, const scsi_unit_serial_number_inquiry_response_t *serialInquiry)
static EngineAccessor engine
Definition engine.h:413
static NO_CACHE uint8_t blkbuf0[MMCSD_BLOCK_SIZE]
static MassStorageController msd(usb_driver)
static const scsi_inquiry_response_t sdCardInquiry
uint8_t blkbuf[4 *MMCSD_BLOCK_SIZE]
Definition mmc_card.cpp:292

Referenced by sdModeSwitcher().

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

◆ deattachMsdSdCard()

void deattachMsdSdCard ( void  )

Definition at line 91 of file mass_storage_init.cpp.

91 {
92 // this is safe to use same read/write buffer couse all luns are handled from one thread
93 msd.attachLun(1, (BaseBlockDevice*)&ND1, blkbuf0, sizeof(blkbuf0), &sdCardInquiry, nullptr);
94
95#if EFI_TUNER_STUDIO
96 // SD MSD attached, enable indicator in TS
98#endif
99}
NullDevice ND1

Referenced by sdModeSwitchToIdle().

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

◆ initUsbMsd()

void initUsbMsd ( )

Definition at line 129 of file mass_storage_init.cpp.

129 {
130 // Attach the ini ramdisk
131 msd.attachLun(0, getRamdiskDevice(), blkbuf0, sizeof(blkbuf0), &iniDriveInquiry, nullptr);
132
133 // attach a null device in place of the SD card for now - the SD thread may replace it later
134 // this is safe to use same read/write buffer couse all luns are handled from one thread
135 msd.attachLun(1, (BaseBlockDevice*)&ND1, blkbuf0, sizeof(blkbuf0), &sdCardInquiry, nullptr);
136
137 // start the mass storage thread
138 msd.start();
139}
void start()
Start the thread.
static BaseBlockDevice * getRamdiskDevice()
static const scsi_inquiry_response_t iniDriveInquiry

Referenced by runRusEfi().

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

Go to the source code of this file.