mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Merge pull request #5649 from jflyper/bdev-msc-white-space-tidy-2
MSC support code: White space tidy
This commit is contained in:
commit
4a314613d8
2 changed files with 49 additions and 49 deletions
|
@ -74,21 +74,21 @@ void mscInit(void)
|
|||
|
||||
uint8_t mscStart(void)
|
||||
{
|
||||
ledInit(statusLedConfig());
|
||||
ledInit(statusLedConfig());
|
||||
|
||||
//Start USB
|
||||
usbGenerateDisconnectPulse();
|
||||
//Start USB
|
||||
usbGenerateDisconnectPulse();
|
||||
|
||||
IOInit(IOGetByTag(IO_TAG(PA11)), OWNER_USB, 0);
|
||||
IOInit(IOGetByTag(IO_TAG(PA12)), OWNER_USB, 0);
|
||||
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &MSC_desc, &USBD_MSC_cb, &USR_cb);
|
||||
IOInit(IOGetByTag(IO_TAG(PA11)), OWNER_USB, 0);
|
||||
IOInit(IOGetByTag(IO_TAG(PA12)), OWNER_USB, 0);
|
||||
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &MSC_desc, &USBD_MSC_cb, &USR_cb);
|
||||
|
||||
// NVIC configuration for SYSTick
|
||||
NVIC_DisableIRQ(SysTick_IRQn);
|
||||
NVIC_SetPriority(SysTick_IRQn, NVIC_BUILD_PRIORITY(0, 0));
|
||||
NVIC_EnableIRQ(SysTick_IRQn);
|
||||
// NVIC configuration for SYSTick
|
||||
NVIC_DisableIRQ(SysTick_IRQn);
|
||||
NVIC_SetPriority(SysTick_IRQn, NVIC_BUILD_PRIORITY(0, 0));
|
||||
NVIC_EnableIRQ(SysTick_IRQn);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool mscCheckBoot(void)
|
||||
|
@ -116,16 +116,16 @@ bool mscCheckButton(void)
|
|||
|
||||
void mscWaitForButton(void)
|
||||
{
|
||||
// In order to exit MSC mode simply disconnect the board, or push the button again.
|
||||
while (mscCheckButton());
|
||||
delay(DEBOUNCE_TIME_MS);
|
||||
while (true) {
|
||||
asm("NOP");
|
||||
if (mscCheckButton()) {
|
||||
*((uint32_t *)0x2001FFF0) = 0xFFFFFFFF;
|
||||
delay(1);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
}
|
||||
// In order to exit MSC mode simply disconnect the board, or push the button again.
|
||||
while (mscCheckButton());
|
||||
delay(DEBOUNCE_TIME_MS);
|
||||
while (true) {
|
||||
asm("NOP");
|
||||
if (mscCheckButton()) {
|
||||
*((uint32_t *)0x2001FFF0) = 0xFFFFFFFF;
|
||||
delay(1);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -63,30 +63,30 @@ void mscInit(void)
|
|||
|
||||
uint8_t mscStart(void)
|
||||
{
|
||||
ledInit(statusLedConfig());
|
||||
ledInit(statusLedConfig());
|
||||
|
||||
//Start USB
|
||||
usbGenerateDisconnectPulse();
|
||||
//Start USB
|
||||
usbGenerateDisconnectPulse();
|
||||
|
||||
IOInit(IOGetByTag(IO_TAG(PA11)), OWNER_USB, 0);
|
||||
IOInit(IOGetByTag(IO_TAG(PA12)), OWNER_USB, 0);
|
||||
IOInit(IOGetByTag(IO_TAG(PA11)), OWNER_USB, 0);
|
||||
IOInit(IOGetByTag(IO_TAG(PA12)), OWNER_USB, 0);
|
||||
|
||||
USBD_Init(&USBD_Device, &VCP_Desc, 0);
|
||||
USBD_Init(&USBD_Device, &VCP_Desc, 0);
|
||||
|
||||
/** Regsiter class */
|
||||
USBD_RegisterClass(&USBD_Device, USBD_MSC_CLASS);
|
||||
/** Regsiter class */
|
||||
USBD_RegisterClass(&USBD_Device, USBD_MSC_CLASS);
|
||||
|
||||
/** Register interface callbacks */
|
||||
USBD_MSC_RegisterStorage(&USBD_Device, &USBD_MSC_Template_fops);
|
||||
/** Register interface callbacks */
|
||||
USBD_MSC_RegisterStorage(&USBD_Device, &USBD_MSC_Template_fops);
|
||||
|
||||
USBD_Start(&USBD_Device);
|
||||
USBD_Start(&USBD_Device);
|
||||
|
||||
// NVIC configuration for SYSTick
|
||||
NVIC_DisableIRQ(SysTick_IRQn);
|
||||
NVIC_SetPriority(SysTick_IRQn, NVIC_BUILD_PRIORITY(0, 0));
|
||||
NVIC_EnableIRQ(SysTick_IRQn);
|
||||
// NVIC configuration for SYSTick
|
||||
NVIC_DisableIRQ(SysTick_IRQn);
|
||||
NVIC_SetPriority(SysTick_IRQn, NVIC_BUILD_PRIORITY(0, 0));
|
||||
NVIC_EnableIRQ(SysTick_IRQn);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool mscCheckBoot(void)
|
||||
|
@ -114,16 +114,16 @@ bool mscCheckButton(void)
|
|||
|
||||
void mscWaitForButton(void)
|
||||
{
|
||||
// In order to exit MSC mode simply disconnect the board, or push the button again.
|
||||
while (mscCheckButton());
|
||||
delay(DEBOUNCE_TIME_MS);
|
||||
while (true) {
|
||||
asm("NOP");
|
||||
if (mscCheckButton()) {
|
||||
*((uint32_t *)0x2001FFF0) = 0xFFFFFFFF;
|
||||
delay(1);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
}
|
||||
// In order to exit MSC mode simply disconnect the board, or push the button again.
|
||||
while (mscCheckButton());
|
||||
delay(DEBOUNCE_TIME_MS);
|
||||
while (true) {
|
||||
asm("NOP");
|
||||
if (mscCheckButton()) {
|
||||
*((uint32_t *)0x2001FFF0) = 0xFFFFFFFF;
|
||||
delay(1);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue