Bsongis/gui refactoring for x7 d (#3701)
* [X7D] New board added * Cosmetics
This commit is contained in:
@@ -72,9 +72,9 @@ if(MULTIMODULE)
|
||||
add_definitions(-DMULTIMODULE)
|
||||
set(SRC ${SRC} pulses/multi_arm.cpp telemetry/spektrum.cpp)
|
||||
endif()
|
||||
add_definitions(-DCPUARM)
|
||||
add_definitions(-DCPUARM -DVIRTUAL_INPUTS)
|
||||
add_definitions(-DTELEMETRY_FRSKY -DTELEMETRY_FRSKY_SPORT -DFRSKY_HUB -DGPS -DPXX -DDSM2)
|
||||
add_definitions(-DBOLD_FONT -DBATTGRAPH -DTHRTRACE)
|
||||
add_definitions(-DBOLD_FONT -DBATTGRAPH -DTHRTRACE -DGAUGES)
|
||||
include_directories(${COOS_DIR} ${COOS_DIR}/kernel ${COOS_DIR}/portable)
|
||||
foreach(LANGUAGE ${TTS_LANGUAGES})
|
||||
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
|
||||
@@ -104,8 +104,8 @@ set(TARGET_SRC
|
||||
adc_driver.cpp
|
||||
trainer_driver.cpp
|
||||
audio_driver.cpp
|
||||
serial2_driver.cpp
|
||||
telemetry_driver.cpp
|
||||
${SERIAL2_DRIVER}
|
||||
)
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
|
||||
@@ -2,8 +2,7 @@ set(LUA "NO" CACHE STRING "Lua scripts (YES/NO/NO_MODEL_SCRIPTS)")
|
||||
set(USB "JOYSTICK" CACHE STRING "USB option (JOYSTICK/MASSSTORAGE/SERIAL)")
|
||||
set(ARCH ARM)
|
||||
set(STM32USB_DIR ${THIRDPARTY_DIR}/STM32_USB-Host-Device_Lib_V2.1.0/Libraries)
|
||||
add_definitions(-DCPUSTM32)
|
||||
add_definitions(-DSBUS -DCROSSFIRE)
|
||||
add_definitions(-DSTM32 -DLUA_INPUTS -DVARIO -DSBUS -DCROSSFIRE)
|
||||
include_directories(${RADIO_SRC_DIRECTORY}/targets/common/arm/stm32)
|
||||
include_directories(${STM32USB_DIR}/STM32_USB_OTG_Driver/inc)
|
||||
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Core/inc)
|
||||
@@ -20,6 +19,7 @@ set(STM32USB_SRC
|
||||
)
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
../common/arm/stm32/delays.cpp
|
||||
../common/arm/stm32/usb_bsp.c
|
||||
../common/arm/stm32/usbd_desc.c
|
||||
../common/arm/stm32/usbd_usr.cpp
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <OsConfig.h>
|
||||
#include "board.h"
|
||||
#if defined(STM32F2)
|
||||
#include "dwt.h" // the old ST library that we use does not define DWT register for STM32F2xx
|
||||
#endif
|
||||
|
||||
#define SYSTEM_TICKS_1US ((CFG_CPU_FREQ + 500000) / 1000000) // number of system ticks in 1us
|
||||
#define SYSTEM_TICKS_01US ((CFG_CPU_FREQ + 5000000) / 10000000) // number of system ticks in 0.1us (rounding needed for sys frequencies that are not multiple of 10MHz)
|
||||
|
||||
void delaysInit(void)
|
||||
{
|
||||
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
|
||||
DWT->CYCCNT = 0;
|
||||
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
|
||||
}
|
||||
|
||||
void delay_01us(uint16_t nb)
|
||||
{
|
||||
volatile uint32_t dwtStart = DWT->CYCCNT;
|
||||
volatile uint32_t dwtTotal = (SYSTEM_TICKS_01US * nb) - 10;
|
||||
while((DWT->CYCCNT - dwtStart) < dwtTotal);
|
||||
}
|
||||
|
||||
void delay_us(uint16_t nb)
|
||||
{
|
||||
volatile uint32_t dwtStart = DWT->CYCCNT;
|
||||
volatile uint32_t dwtTotal = (SYSTEM_TICKS_1US * nb) - 10;
|
||||
while((DWT->CYCCNT - dwtStart) < dwtTotal);
|
||||
}
|
||||
|
||||
void delay_ms(uint32_t ms)
|
||||
{
|
||||
while(ms--) {
|
||||
delay_us(1000);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries)
|
||||
include_directories(${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/inc)
|
||||
include_directories(${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Include)
|
||||
include_directories(${STM32LIB_DIR}/CMSIS/include)
|
||||
add_definitions(-DSTM32F2)
|
||||
set(STM32LIB_SRC
|
||||
${STM32LIB_SRC}
|
||||
CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
||||
|
||||
Reference in New Issue
Block a user