From 30f31450cec3e86943597b96fb26ce3e4e8a8b17 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sat, 2 Jul 2016 09:56:02 +0200 Subject: [PATCH] Cosmetics --- radio/src/targets/horus/usb_bsp.c | 13 +---- radio/src/targets/horus/usbd_storage_msd.cpp | 48 +++++++++---------- .../src/targets/taranis/usbd_storage_msd.cpp | 46 ++++++++---------- 3 files changed, 47 insertions(+), 60 deletions(-) diff --git a/radio/src/targets/horus/usb_bsp.c b/radio/src/targets/horus/usb_bsp.c index 53657d2d9..6f96a5e0d 100644 --- a/radio/src/targets/horus/usb_bsp.c +++ b/radio/src/targets/horus/usb_bsp.c @@ -100,16 +100,7 @@ void USB_OTG_BSP_DisableInterrupt(USB_OTG_CORE_HANDLE *pdev) */ void USB_OTG_BSP_uDelay (const uint32_t usec) { - uint32_t count = 0; - const uint32_t utime = ((SystemCoreClock/1000000) * usec); - do - { - if ( ++count > utime ) - { - return ; - } - } - while (1); + delay_us(usec); } @@ -121,7 +112,7 @@ void USB_OTG_BSP_uDelay (const uint32_t usec) */ void USB_OTG_BSP_mDelay (const uint32_t msec) { - USB_OTG_BSP_uDelay(msec * 1000); + delay_ms(msec); } diff --git a/radio/src/targets/horus/usbd_storage_msd.cpp b/radio/src/targets/horus/usbd_storage_msd.cpp index f2ef4352f..14113f1ec 100644 --- a/radio/src/targets/horus/usbd_storage_msd.cpp +++ b/radio/src/targets/horus/usbd_storage_msd.cpp @@ -1,35 +1,35 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * 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 - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * 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 + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + /* Includes ------------------------------------------------------------------*/ #include "../../opentx.h" #include "../../thirdparty/FatFs/diskio.h" -#include "../horus/board_horus.h" -#include "../horus/sdio_sd.h" +#include "board_horus.h" +#include "sdio_sd.h" #if defined(__cplusplus) && !defined(SIMU) extern "C" { #endif #include "usbd_msc_mem.h" -#include "../horus/usb_conf.h" +#include "usb_conf.h" /* SD card only when not running bootloader */ #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; } -uint8_t lunReady[1] ; +uint8_t lunReady[STORAGE_LUN_NBR] ; void usbPluggedIn() { diff --git a/radio/src/targets/taranis/usbd_storage_msd.cpp b/radio/src/targets/taranis/usbd_storage_msd.cpp index 285061d8e..c25eca72e 100644 --- a/radio/src/targets/taranis/usbd_storage_msd.cpp +++ b/radio/src/targets/taranis/usbd_storage_msd.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * 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 - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * 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 + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + /* Includes ------------------------------------------------------------------*/ #include "../../opentx.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; } -#if defined(BOOT) -uint8_t lunReady[2] ; -#else -uint8_t lunReady[1] ; -#endif +uint8_t lunReady[STORAGE_LUN_NBR]; void usbPluggedIn() {