Cosmetics

This commit is contained in:
Bertrand Songis
2016-07-02 09:56:16 +02:00
parent 42aa06a166
commit 30f31450ce
3 changed files with 47 additions and 60 deletions
+2 -11
View File
@@ -100,16 +100,7 @@ void USB_OTG_BSP_DisableInterrupt(USB_OTG_CORE_HANDLE *pdev)
*/ */
void USB_OTG_BSP_uDelay (const uint32_t usec) void USB_OTG_BSP_uDelay (const uint32_t usec)
{ {
uint32_t count = 0; delay_us(usec);
const uint32_t utime = ((SystemCoreClock/1000000) * usec);
do
{
if ( ++count > utime )
{
return ;
}
}
while (1);
} }
@@ -121,7 +112,7 @@ void USB_OTG_BSP_uDelay (const uint32_t usec)
*/ */
void USB_OTG_BSP_mDelay (const uint32_t msec) void USB_OTG_BSP_mDelay (const uint32_t msec)
{ {
USB_OTG_BSP_uDelay(msec * 1000); delay_ms(msec);
} }
+24 -24
View File
@@ -1,35 +1,35 @@
/* /*
* Copyright (C) OpenTX * Copyright (C) OpenTX
* *
* Based on code named * Based on code named
* th9x - http://code.google.com/p/th9x * th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x * er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x * gruvin9x - http://code.google.com/p/gruvin9x
* *
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "../../opentx.h" #include "../../opentx.h"
#include "../../thirdparty/FatFs/diskio.h" #include "../../thirdparty/FatFs/diskio.h"
#include "../horus/board_horus.h" #include "board_horus.h"
#include "../horus/sdio_sd.h" #include "sdio_sd.h"
#if defined(__cplusplus) && !defined(SIMU) #if defined(__cplusplus) && !defined(SIMU)
extern "C" { extern "C" {
#endif #endif
#include "usbd_msc_mem.h" #include "usbd_msc_mem.h"
#include "../horus/usb_conf.h" #include "usb_conf.h"
/* SD card only when not running bootloader */ /* SD card only when not running bootloader */
#define STORAGE_LUN_NBR 1 #define STORAGE_LUN_NBR 1
@@ -130,7 +130,7 @@ int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_si
return 0; return 0;
} }
uint8_t lunReady[1] ; uint8_t lunReady[STORAGE_LUN_NBR] ;
void usbPluggedIn() void usbPluggedIn()
{ {
+21 -25
View File
@@ -1,23 +1,23 @@
/* /*
* Copyright (C) OpenTX * Copyright (C) OpenTX
* *
* Based on code named * Based on code named
* th9x - http://code.google.com/p/th9x * th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x * er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x * gruvin9x - http://code.google.com/p/gruvin9x
* *
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "../../opentx.h" #include "../../opentx.h"
#include "../../thirdparty/FatFs/diskio.h" #include "../../thirdparty/FatFs/diskio.h"
@@ -171,11 +171,7 @@ int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_si
return 0; return 0;
} }
#if defined(BOOT) uint8_t lunReady[STORAGE_LUN_NBR];
uint8_t lunReady[2] ;
#else
uint8_t lunReady[1] ;
#endif
void usbPluggedIn() void usbPluggedIn()
{ {