Files refactoring + costmetics (#5552)
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "definitions.h"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(CPUARM)
|
||||
#define blkid_t uint16_t
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 62
|
||||
|
||||
@@ -90,7 +90,7 @@ else()
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../../../../targets/${TARGET_DIR}/sdram_driver.c
|
||||
../../../../../targets/${TARGET_DIR}/sdio_sd.c
|
||||
../../../../../targets/common/arm/stm32/sdio_sd.c
|
||||
../../../../../targets/${TARGET_DIR}/haptic_driver.cpp
|
||||
../../../../../gui/${GUI_DIR}/bitmapbuffer.cpp
|
||||
../../../../../syscalls.c
|
||||
|
||||
+249
-1002
File diff suppressed because it is too large
Load Diff
@@ -155,24 +155,6 @@ typedef struct
|
||||
__IO uint8_t Reserved2; /*!< always 1 */
|
||||
} SD_CID;
|
||||
|
||||
/**
|
||||
* @brief SD Card Status
|
||||
*/
|
||||
// typedef struct
|
||||
// {
|
||||
// __IO uint8_t DAT_BUS_WIDTH;
|
||||
// __IO uint8_t SECURED_MODE;
|
||||
// __IO uint16_t SD_CARD_TYPE;
|
||||
// __IO uint32_t SIZE_OF_PROTECTED_AREA;
|
||||
// __IO uint8_t SPEED_CLASS;
|
||||
// __IO uint8_t PERFORMANCE_MOVE;
|
||||
// __IO uint8_t AU_SIZE;
|
||||
// __IO uint16_t ERASE_SIZE;
|
||||
// __IO uint8_t ERASE_TIMEOUT;
|
||||
// __IO uint8_t ERASE_OFFSET;
|
||||
// } SD_CardStatus;
|
||||
|
||||
|
||||
/**
|
||||
* @brief SD Card information
|
||||
*/
|
||||
@@ -197,16 +179,11 @@ SD_Error SD_Init(void);
|
||||
SDTransferState SD_GetStatus(void);
|
||||
uint8_t SD_Detect(void);
|
||||
SD_Error SD_PowerOFF(void);
|
||||
// SD_Error SD_GetCardStatus(SD_CardStatus *cardstatus);
|
||||
SD_Error SD_ReadBlock(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize);
|
||||
SD_Error SD_ReadMultiBlocks(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize, uint32_t NumberOfBlocks);
|
||||
// SD_Error SD_ReadMultiBlocksFIXED(uint8_t *readbuff, uint32_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
|
||||
SD_Error SD_WriteBlock(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize);
|
||||
SD_Error SD_WriteMultiBlocks(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize, uint32_t NumberOfBlocks);
|
||||
// SD_Error SD_WriteMultiBlocksFIXED(uint8_t *writebuff, uint32_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
|
||||
SDTransferState SD_GetTransferState(void);
|
||||
// SD_Error SD_Erase(uint32_t startaddr, uint32_t endaddr);
|
||||
// SD_Error SD_SendSDStatus(uint32_t *psdstatus);
|
||||
SD_Error SD_WaitReadOperation(uint32_t timeout);
|
||||
SD_Error SD_WaitWriteOperation(uint32_t timeout);
|
||||
|
||||
@@ -126,12 +126,12 @@ set(TARGET_SRC
|
||||
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
sdio_sd.c
|
||||
${LCD_DRIVER}
|
||||
backlight_driver.cpp
|
||||
pwr_driver.cpp
|
||||
sdram_driver.c
|
||||
startup_stm32f42_43xxx.s
|
||||
../common/arm/stm32/sdio_sd.c
|
||||
../common/arm/loadboot.cpp
|
||||
)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "diskio.h"
|
||||
#include <string.h>
|
||||
#include "opentx.h"
|
||||
#include "sdio_sd.h"
|
||||
#include "targets/common/arm/stm32/sdio_sd.h"
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/* Lock / unlock functions */
|
||||
|
||||
@@ -35,7 +35,7 @@ extern "C" {
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
#if defined(STM32F4)
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h"
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h"
|
||||
@@ -95,7 +95,7 @@ extern "C" {
|
||||
|
||||
#define LUA_MEM_MAX (0) // max allowed memory usage for complete Lua (in bytes), 0 means unlimited
|
||||
|
||||
#if defined(PCBX9E)
|
||||
#if defined(STM32F4)
|
||||
#define PERI1_FREQUENCY 42000000
|
||||
#define PERI2_FREQUENCY 84000000
|
||||
#else
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
# TODO if the files order is different (these 2 SRC sections exchanged), the bootloader hangs for 20s in USB init. Why?
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(PCB STREQUAL X9E)
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../common/arm/stm32/f4/system_stm32f4xx.c
|
||||
../../../${STM32LIB_DIR}/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
|
||||
../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
||||
../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
||||
../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
||||
../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c
|
||||
../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/misc.c
|
||||
)
|
||||
else()
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../common/arm/stm32/f2/system_stm32f2xx.c
|
||||
../../../${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
||||
../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
||||
../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
||||
../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
||||
../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c
|
||||
../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/misc.c
|
||||
)
|
||||
endif()
|
||||
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../../gui/${GUI_DIR}/lcd.cpp
|
||||
../../../gui/${GUI_DIR}/fonts.cpp
|
||||
../../../keys.cpp
|
||||
../../../strhelpers.cpp
|
||||
../../../stamp.cpp
|
||||
../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_core.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd_int.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_Device_Library/Core/src/usbd_core.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_Device_Library/Core/src/usbd_ioreq.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_Device_Library/Core/src/usbd_req.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
|
||||
../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
|
||||
../../../${FATFS_DIR}/ff.c
|
||||
../../../${FATFS_DIR}/option/ccsbcs.c
|
||||
../${LCD_DRIVER}
|
||||
../backlight_driver.cpp
|
||||
../keys_driver.cpp
|
||||
../i2c_driver.cpp
|
||||
../flash_driver.cpp
|
||||
../diskio.cpp
|
||||
../../common/arm/stm32/usbd_usr.cpp
|
||||
../../common/arm/stm32/usbd_storage_msd.cpp
|
||||
../../common/arm/stm32/delays.cpp
|
||||
../../common/arm/stm32/usbd_desc.c
|
||||
../../common/arm/stm32/usb_bsp.c
|
||||
../../common/arm/stm32/usb_driver.cpp
|
||||
../pwr_driver.cpp
|
||||
init.c
|
||||
boot.cpp
|
||||
)
|
||||
|
||||
remove_definitions(-DLUA -DDEBUG)
|
||||
add_definitions(-DBOOT)
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-mcpu=${MCU} -mthumb -nostartfiles -lm -T${RADIO_SRC_DIRECTORY}/targets/taranis/stm32_ramboot.ld -Wl,-Map=bootloader.map,--cref,--no-warn-mismatch,--gc-sections")
|
||||
|
||||
add_executable(bootloader ${BOOTLOADER_SRC})
|
||||
add_dependencies(bootloader ${BITMAPS_TARGET} firmware_translations)
|
||||
|
||||
add_custom_command(
|
||||
TARGET bootloader POST_BUILD
|
||||
COMMAND arm-none-eabi-objcopy -O binary bootloader.elf bootloader.bin
|
||||
)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
add_custom_command(
|
||||
TARGET bootloader POST_BUILD
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/bin2lbm.py bootloader.bin bootloader.lbm
|
||||
)
|
||||
endif()
|
||||
|
||||
PrintTargetReport("bootloader")
|
||||
Reference in New Issue
Block a user