1 Star 3 Fork 1

Kono/USBComposite_stm32f1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
USBMassStorage.cpp 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
arpruss 提交于 2018-08-17 19:07 . support mass storage above 4gb
#include "USBComposite.h"
#include "usb_mass.h"
#include "usb_mass_mal.h"
#include "usb_composite_serial.h"
#include <string.h>
void USBMassStorage::begin() {
if(!enabled) {
USBComposite.clear();
registerComponent();
USBComposite.begin();
enabled = true;
}
}
void USBMassStorage::end() {
USBComposite.end();
}
void USBMassStorage::loop() {
usb_mass_loop();
}
bool USBMassStorage::registerComponent() {
return USBComposite.add(&usbMassPart, this);
}
void USBMassStorage::setDriveData(uint32 driveNumber, uint32 numSectors, MassStorageReader reader,
MassStorageWriter writer, MassStorageStatuser statuser, MassStorageInitializer initializer) {
if (driveNumber >= USB_MASS_MAX_DRIVES)
return;
usb_mass_drives[driveNumber].blockCount = numSectors;
usb_mass_drives[driveNumber].read = reader;
usb_mass_drives[driveNumber].write = writer;
usb_mass_drives[driveNumber].status = statuser;
usb_mass_drives[driveNumber].init = initializer;
usb_mass_drives[driveNumber].format = initializer;
}
void USBMassStorage::clearDrives() {
memset(usb_mass_drives, 0, sizeof(usb_mass_drives));
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Kono2019/USBComposite_stm32f1.git
git@gitee.com:Kono2019/USBComposite_stm32f1.git
Kono2019
USBComposite_stm32f1
USBComposite_stm32f1
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385