refact: ADC, switches and keys
Add "hardware_defs" target to dump hardware defines from hal.h per target Fixed hal.h definitions for switches & ADC inputs Tools to generate hardware definitions from current hal.h generator: add support for EXTx and analog switches WiP Add generated header to hardware_defs target Add support for ADC input direction and index per GPIO port Incredible: it compiles Removed StdPeriph ADC driver Works on QX7 Works on TX16S (VBat missing) Switch driver using generated switches for stm32 targets Switch driver with generated switches for simu Use switch names from switch driver Fixed single conversion handling Fixed horus VBat reading Added switch name Fix warnings about bitfield offsets and GCC 4.4 This is caused by bitfields that cross type boundaries. In this particular case, it happens as the bitfield is not defined the same in `rtc_backup.cpp`. Switches has already been moved to generic driver Jitter measurement for each sample, not just for oversampled values Moved periph clock init to the ADC driver ADC & GPIOs. Add switchInit() to init pins Fix NV14 CMake Fix taranis target Fix NV14 (again) Model audio files: use new interface for switch index Fix X9-lite Fix simu headers Fix getSwitchName() Add support for ADC switches Fix switch warning YAML Test only switches which are defined Conversions tests for QX7 only on QX7 Fix X12S Fix function switch names Enable ADC periph clock before initialising channels NV14: offset inputs for the sticks & fix switches WiP: get rid of VSRCRAW and some more Simu shall use normal ADC driver fix x7 fix nv14 Fix 9x nav fix 212x64 fix xlite fix x9e fix simu lib fix unit tests fix x7 tests PWM stick values should be written directly into adcValues ... just like FlySky sticks. fix x12s fix nv14 Add some support for SPI ADC (only unit tests) Remove `jq` usage fix generate_yaml.py for newer libclang fix pot config fix stick names Some YAML generator improvements Max 16 Pots on COLORLCD Fix some source names Use 10 bits for switches to prevent overflow Removed horus constants for switches & ADC inputs Fix unit tests Fix curve edit Fix libsimulator Fix function switches (tpro) Refine ADC & analog API Moved hardware definitions scripts and templates into own dir cleanup API refine Fix unit tests Mixer: apply calibration only on required inputs Place ADC switches after all other ADC inputs Fix X12S Remove useless TR_POTS_VSRCRAW, TR_SW_VSRCRAW, and TR_VSRCRAW Cleanup redundant generated YAML parsers Fixes Boxer rebase Add boxer to generate-hw-defs.sh Obsolete LUA exports Add boxer ADC_DIRECTION Split generate_hw_defs.py into multiple files Some cleanup (+ LUA switches) Fix AXIS definitions Fixed translation strings declarations Some rebase fixes Remove some useless StdPeriph drivers fix: set pin mode to reset state on usart deinit fix: use canonical names for calibration data fix: ADC driver does not care about unconfigured inputs fix X12S ADC Add support for ADC conversion chaining Better X12S ADC implem Moved X12S ADC driver to HAL/LL Improve ADC driver separation Fixed taranis & nv14 Moved PWM gimbals to HAL/LL Removed useless TR_EXTRA_VSRCRAW Fixed include guards Small fixes Renamed control inputs Moved internal and external module pulse driver def to boards Move more things to the generic_stm32 board Remove STR_VMIXTRIMS Added analog labels Generate main control names Misuse labels / short labels for main controls Backward compatibility: sliders and legacy names New keys driver Let's get rid of StdPeriph headers in simu Add jinja2 to CI workflows Use `grep` instead of `sed` chore: add python jinja2 oto msys setup script Removed more static definitions and use dynamic ones instead Fixes X9E Fix x7 nav too 212 switch display Fix default sliders Removed NUM_STICKS 212 switch display working nicely Surface radio 'stick' replacements fix: switch, trim & rotary pin init Remove old key drivers Removed VKEYS Removed ETX_FOURCC Fixed SURFACE_NAME Removed TR_VSWITCHES & TR_TRIMS_SWITCHES Fix xpot switches Store calibrated analogs in physical order Use getSourceString in drawSource Implement missing YAML read/write Fix isSourceAvailableInInputs() Fix isSourceAvailable() Some surface fixes Fix CLI debug Ported colour UI of analog diagnostics to new ADC API Small fixes Better input mapping Minor tpro fixes Fix trims available Remove TX mode choice on surface radio Rename surface controls Channel order alignement Fix throttle warning Fix checkTrims() Fix pot config casting issue Fix IS_SWITCH_FS() Fixed input mapping Fix fswitch auto-switch Fixed storing / reading function switches in YAML Fix enableVBatBridge() / disableVBatBridge() Fix interesting mode conversion Fix sources issues Fix special funnction list Proper function switch handling 128 GUI improvements Fix compilation Boxer cosmetics 128 hardware screen cosmetic Fix TX12 switches More switches fixes Simplify CPU type handling Fix flash size Fixed page-up / page-down in libopenui
This commit is contained in:
committed by
Malte Langermann
parent
b6dd3a0ef8
commit
2b100e0eb5
@@ -18,12 +18,8 @@ if(PCB STREQUAL X9E)
|
||||
set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module")
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(STICKS "STANDARD" CACHE STRING "Sticks type (STANDARD/HORUS)")
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
set(CPU_TYPE_FULL STM32F407xE)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_x9e)
|
||||
set(FLAVOUR x9e)
|
||||
add_definitions(-DPCBX9E -DPCBX9)
|
||||
add_definitions(-DEEPROM_VARIANT=0x8000)
|
||||
@@ -49,7 +45,6 @@ if(PCB STREQUAL X9E)
|
||||
add_definitions(-DMANUFACTURER_FRSKY)
|
||||
elseif(PCB STREQUAL X9D+)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_x9d)
|
||||
add_definitions(-DPCBX9DP -DPCBX9)
|
||||
add_definitions(-DEEPROM_VARIANT=0)
|
||||
set(GUI_DIR 212x64)
|
||||
@@ -66,13 +61,9 @@ elseif(PCB STREQUAL X9D+)
|
||||
if (${PCBREV} STREQUAL 2019)
|
||||
set(DEFAULT_INTERNAL_MODULE ISRM_PXX2 CACHE STRING "Default internal module")
|
||||
set(FLAVOUR x9d+2019)
|
||||
set(LUA_EXPORT lua_export_x9d+2019)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F407xE)
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
add_definitions(-DRADIO_X9DP2019)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
add_definitions(-DSOFTWARE_VOLUME -DPWR_BUTTON_${PWR_BUTTON} -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
set(STATUS_LEDS YES)
|
||||
set(PXX2 ON)
|
||||
@@ -83,22 +74,15 @@ elseif(PCB STREQUAL X9D+)
|
||||
else()
|
||||
set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module")
|
||||
set(FLAVOUR x9d+)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
set(AUX_SERIAL ON)
|
||||
set(STATUS_LEDS NO)
|
||||
endif()
|
||||
elseif(PCB STREQUAL X9D)
|
||||
set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module")
|
||||
set(FLAVOUR x9d)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
option(HAPTIC "Haptic support" ON) # While the X9D doesn't have haptic OOTB, it can be added
|
||||
set(LUA_EXPORT lua_export_x9d)
|
||||
add_definitions(-DPCBX9D -DPCBX9)
|
||||
add_definitions(-DEEPROM_VARIANT=0)
|
||||
set(GUI_DIR 212x64)
|
||||
@@ -129,11 +113,7 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR t12)
|
||||
set(NAVIGATION_TYPE 9x)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(LUA_EXPORT lua_export_t12)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
add_definitions(-DRADIO_T12)
|
||||
add_definitions(-DRADIO_FAMILY_JUMPER_T12)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4001)
|
||||
@@ -143,12 +123,8 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR tpro)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(ROTARY_ENCODER YES)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(LUA_EXPORT lua_export_tpro)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
add_definitions(-DFUNCTION_SWITCHES)
|
||||
add_definitions(-DRADIO_TPRO)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4005)
|
||||
@@ -159,11 +135,7 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR tlite)
|
||||
set(NAVIGATION_TYPE 9x)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(LUA_EXPORT lua_export_tlite)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
add_definitions(-DRADIO_TLITE)
|
||||
add_definitions(-DRADIO_FAMILY_JUMPER_T12)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4003)
|
||||
@@ -174,12 +146,7 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR tlitef4)
|
||||
set(NAVIGATION_TYPE 9x)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
add_definitions(-DSTM32F407xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
set(LUA_EXPORT lua_export_tlite)
|
||||
add_definitions(-DRADIO_TLITE)
|
||||
add_definitions(-DRADIO_FAMILY_JUMPER_T12)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4003)
|
||||
@@ -190,11 +157,7 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR lr3pro)
|
||||
set(NAVIGATION_TYPE 9x)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(LUA_EXPORT lua_export_lr3pro)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
add_definitions(-DRADIO_LR3PRO)
|
||||
add_definitions(-DRADIO_FAMILY_JUMPER_T12)
|
||||
add_definitions(-DMANUFACTURER_BETAFPV)
|
||||
@@ -204,12 +167,8 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR tx12)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
set(ROTARY_ENCODER YES)
|
||||
set(LUA_EXPORT lua_export_tx12)
|
||||
set(BLUETOOTH NO)
|
||||
set(USB_CHARGER YES)
|
||||
add_definitions(-DRADIO_TX12)
|
||||
@@ -220,13 +179,8 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR tx12mk2)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
add_definitions(-DSTM32F407xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
set(CPU_TYPE_FULL STM32F407xE)
|
||||
set(ROTARY_ENCODER YES)
|
||||
set(LUA_EXPORT lua_export_tx12mk2)
|
||||
set(USB_CHARGER YES)
|
||||
if (NOT BLUETOOTH)
|
||||
set(AUX_SERIAL ON)
|
||||
@@ -241,13 +195,8 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR boxer)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
add_definitions(-DSTM32F407xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
set(CPU_TYPE_FULL STM32F407xE)
|
||||
set(ROTARY_ENCODER YES)
|
||||
set(LUA_EXPORT lua_export_boxer)
|
||||
set(USB_CHARGER YES)
|
||||
add_definitions(-DRADIO_BOXER)
|
||||
add_definitions(-DMANUFACTURER_RADIOMASTER)
|
||||
@@ -262,13 +211,8 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR zorro)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
add_definitions(-DSTM32F407xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
set(CPU_TYPE_FULL STM32F407xE)
|
||||
set(ROTARY_ENCODER YES)
|
||||
set(LUA_EXPORT lua_export_zorro)
|
||||
set(BLUETOOTH NO)
|
||||
set(USB_CHARGER YES)
|
||||
set(AUX_SERIAL ON)
|
||||
@@ -283,12 +227,8 @@ elseif(PCB STREQUAL X7)
|
||||
set(HARDWARE_EXTERNAL_MODULE NO)
|
||||
set(FLAVOUR t8)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
set(ROTARY_ENCODER NO)
|
||||
set(LUA_EXPORT lua_export_t8)
|
||||
set(BLUETOOTH NO)
|
||||
if(RADIOMASTER_RELEASE)
|
||||
set(BIND_KEY YES)
|
||||
@@ -302,17 +242,11 @@ elseif(PCB STREQUAL X7)
|
||||
set(HARDWARE_EXTERNAL_MODULE YES)
|
||||
set(FLAVOUR commando8)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
add_definitions(-DSTM32F407xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
add_definitions(-DSTM32F407xx -DSTM32F40_41xxx)
|
||||
set(CPU_TYPE_FULL STM32F407xE)
|
||||
set(ROTARY_ENCODER NO)
|
||||
set(LUA_EXPORT lua_export_commando8)
|
||||
set(BLUETOOTH NO)
|
||||
set(USE_RTC_CLOCK NO)
|
||||
add_definitions(-DRADIO_COMMANDO8)
|
||||
add_definitions(-DSTICKS_PWM)
|
||||
add_definitions(-DMUTUALLY_EXCLUSIVE_MODULES)
|
||||
add_definitions(-DMANUFACTURER_IFLIGHT)
|
||||
elseif(PCBREV STREQUAL ACCESS)
|
||||
@@ -320,15 +254,11 @@ elseif(PCB STREQUAL X7)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(FLAVOUR x7access)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
set(LUA_EXPORT lua_export_x7access)
|
||||
set(CPU_TYPE_FULL STM32F407xE)
|
||||
add_definitions(-DRADIO_X7ACCESS)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4000)
|
||||
add_definitions(-DPCBREV=${PCBREV})
|
||||
add_definitions(-DPCBX7ACCESS)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
add_definitions(-DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
set(PXX2 ON)
|
||||
set(PXX_FREQUENCY "HIGH")
|
||||
@@ -339,11 +269,7 @@ elseif(PCB STREQUAL X7)
|
||||
set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module")
|
||||
set(FLAVOUR x7)
|
||||
set(NAVIGATION_TYPE x7)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(LUA_EXPORT lua_export_x7)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
add_definitions(-DRADIO_X7)
|
||||
add_definitions(-DEEPROM_VARIANT=0x4000)
|
||||
set(BLUETOOTH YES)
|
||||
@@ -364,12 +290,8 @@ elseif(PCB STREQUAL X9LITE)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(PXX_FREQUENCY "HIGH")
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_x9lite)
|
||||
set(FLAVOUR x9lite)
|
||||
add_definitions(-DBOARD_NAME="x9lite")
|
||||
add_definitions(-DPCBX9LITE -DPCBX9 -DSOFTWARE_VOLUME -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
@@ -391,12 +313,8 @@ elseif(PCB STREQUAL X9LITES)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(PXX_FREQUENCY "HIGH")
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_x9lites)
|
||||
set(FLAVOUR x9lites)
|
||||
add_definitions(-DBOARD_NAME="x9lites")
|
||||
add_definitions(-DPCBX9LITES -DPCBX9LITE -DPCBX9 -DSOFTWARE_VOLUME -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
@@ -420,13 +338,10 @@ elseif(PCB STREQUAL XLITE)
|
||||
set(PXX_FREQUENCY "HIGH" CACHE STRING "PXX frequency (LOW / HIGH)") # always use HIGH except on some prototype boards
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_xlite)
|
||||
set(FLAVOUR xlite)
|
||||
add_definitions(-DPCBXLITE -DSOFTWARE_VOLUME -DSTICKS_PWM)
|
||||
add_definitions(-DPCBXLITE -DSOFTWARE_VOLUME)
|
||||
add_definitions(-DEEPROM_VARIANT=0x2000)
|
||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||
set(PXX2 ON)
|
||||
@@ -445,14 +360,10 @@ elseif(PCB STREQUAL XLITES)
|
||||
set(INTERNAL_MODULE_SERIAL YES)
|
||||
set(PXX_FREQUENCY "HIGH")
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
set(CPU_TYPE_FULL STM32F205xE)
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_xlites)
|
||||
set(FLAVOUR xlites)
|
||||
add_definitions(-DPCBXLITES -DPCBXLITE -DSOFTWARE_VOLUME -DSTICKS_PWM -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
add_definitions(-DPCBXLITES -DPCBXLITE -DSOFTWARE_VOLUME -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
add_definitions(-DEEPROM_VARIANT=0x1000)
|
||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||
set(GUI_DIR 128x64)
|
||||
@@ -469,6 +380,24 @@ elseif(PCB STREQUAL XLITES)
|
||||
add_definitions(-DMANUFACTURER_FRSKY)
|
||||
endif()
|
||||
|
||||
if(CPU_TYPE_FULL STREQUAL STM32F205xE)
|
||||
set(CPU_TYPE STM32F2)
|
||||
add_definitions(-DSTM32F205xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
elseif (CPU_TYPE_FULL STREQUAL STM32F407xE)
|
||||
set(CPU_TYPE STM32F4)
|
||||
add_definitions(-DSTM32F407xx)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F407xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
elseif (CPU_TYPE_FULL STREQUAL STM32F413xG)
|
||||
set(CPU_TYPE STM32F4)
|
||||
add_definitions(-DSTM32F413xx)
|
||||
add_definitions(-DSTM32F40_41xxx -DSTM32F413xx)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f413_flash.ld)
|
||||
else()
|
||||
message( FATAL_ERROR "Unknown CPU_TYPE_FULL" )
|
||||
endif()
|
||||
|
||||
if(NOT PCB STREQUAL PCBXLITE)
|
||||
add_definitions(-DHARDWARE_TRAINER_JACK)
|
||||
endif()
|
||||
@@ -497,17 +426,6 @@ else()
|
||||
# defines existing internal modules
|
||||
set(INTERNAL_MODULES PXX1)
|
||||
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
intmodule_pulses_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(HARDWARE_EXTERNAL_MODULE)
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
targets/common/arm/stm32/extmodule_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ROTARY_ENCODER)
|
||||
@@ -609,13 +527,7 @@ set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
hal/adc_driver.cpp
|
||||
targets/common/arm/loadboot.cpp
|
||||
boards/generic_stm32/module_ports.cpp
|
||||
boards/generic_stm32/aux_ports.cpp
|
||||
boards/generic_stm32/sport_update.cpp
|
||||
boards/generic_stm32/intmodule_heartbeat.cpp
|
||||
targets/common/arm/stm32/stm32_hal_adc.cpp
|
||||
targets/common/arm/stm32/heartbeat_driver.cpp
|
||||
targets/common/arm/stm32/mixer_scheduler_driver.cpp
|
||||
targets/common/arm/stm32/timers_driver.cpp
|
||||
targets/common/arm/stm32/audio_dac_driver.cpp
|
||||
targets/common/arm/stm32/pwr_driver.cpp
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
bool setBindProtocolSelection()
|
||||
{
|
||||
int16_t xPos = calibratedAnalogs[CONVERT_MODE(0)];
|
||||
int16_t yPos = calibratedAnalogs[CONVERT_MODE(1)];
|
||||
int16_t xPos = calibratedAnalogs[ADC_MAIN_LH];
|
||||
int16_t yPos = calibratedAnalogs[ADC_MAIN_LV];
|
||||
|
||||
// Center: D8
|
||||
if (abs(xPos < 50 && abs(yPos) < 50)) {
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "hal/adc_driver.h"
|
||||
#include "hal/switch_driver.h"
|
||||
|
||||
#include "board.h"
|
||||
#include "boards/generic_stm32/module_ports.h"
|
||||
#include "boards/generic_stm32/intmodule_heartbeat.h"
|
||||
@@ -28,7 +31,6 @@
|
||||
|
||||
#include "hal/adc_driver.h"
|
||||
#include "hal/module_port.h"
|
||||
#include "stm32_hal_adc.h"
|
||||
|
||||
#include "../common/arm/stm32/timers_driver.h"
|
||||
|
||||
@@ -45,6 +47,10 @@
|
||||
#include "bluetooth_driver.h"
|
||||
#endif
|
||||
|
||||
#if defined(PWM_STICKS)
|
||||
#include "sticks_pwm_driver.h"
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -54,12 +60,19 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FLYSKY_GIMBAL)
|
||||
#include "flysky_gimbal_driver.h"
|
||||
#if !defined(BOOT)
|
||||
bool UNEXPECTED_SHUTDOWN()
|
||||
{
|
||||
return WAS_RESET_BY_WATCHDOG()
|
||||
|| g_eeGeneral.unexpectedShutdown;
|
||||
}
|
||||
#endif
|
||||
|
||||
HardwareOptions hardwareOptions;
|
||||
|
||||
// adc_driver.cpp
|
||||
extern const etx_hal_adc_driver_t _adc_driver;
|
||||
|
||||
void watchdogInit(unsigned int duration)
|
||||
{
|
||||
IWDG->KR = 0x5555; // Unlock registers
|
||||
@@ -72,7 +85,7 @@ void watchdogInit(unsigned int duration)
|
||||
|
||||
#if !defined(BOOT)
|
||||
|
||||
#if defined(RADIO_TPRO)
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
#include "storage/storage.h"
|
||||
#endif
|
||||
|
||||
@@ -85,9 +98,6 @@ void boardInit()
|
||||
AUDIO_RCC_AHB1Periph |
|
||||
BACKLIGHT_RCC_AHB1Periph |
|
||||
ADC_RCC_AHB1Periph |
|
||||
#if defined(FLYSKY_GIMBAL)
|
||||
FLYSKY_HALL_RCC_AHB1Periph |
|
||||
#endif
|
||||
SD_RCC_AHB1Periph |
|
||||
HAPTIC_RCC_AHB1Periph |
|
||||
INTMODULE_RCC_AHB1Periph |
|
||||
@@ -104,9 +114,6 @@ void boardInit()
|
||||
LCD_RCC_APB1Periph |
|
||||
AUDIO_RCC_APB1Periph |
|
||||
ADC_RCC_APB1Periph |
|
||||
#if defined(FLYSKY_GIMBAL)
|
||||
FLYSKY_HALL_RCC_APB1Periph |
|
||||
#endif
|
||||
BACKLIGHT_RCC_APB1Periph |
|
||||
HAPTIC_RCC_APB1Periph |
|
||||
INTERRUPT_xMS_RCC_APB1Periph |
|
||||
@@ -161,9 +168,7 @@ void boardInit()
|
||||
|
||||
#if defined(STATUS_LEDS)
|
||||
ledInit();
|
||||
#if defined(RADIO_T8) || defined(RADIO_COMMANDO8) || defined(RADIO_TLITE) || \
|
||||
defined(RADIO_TPRO) || defined(RADIO_TX12) || defined(RADIO_TX12MK2) || \
|
||||
defined(RADIO_ZORRO) || defined(RADIO_BOXER)
|
||||
#if defined(MANUFACTURER_RADIOMASTER) || defined(MANUFACTURER_JUMPER) || defined(RADIO_COMMANDO8)
|
||||
ledBlue();
|
||||
#else
|
||||
ledGreen();
|
||||
@@ -171,7 +176,7 @@ void boardInit()
|
||||
#endif
|
||||
|
||||
// Support for FS Led to indicate battery charge level
|
||||
#if defined(RADIO_TPRO)
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
// This is needed to prevent radio from starting when usb is plugged to charge
|
||||
usbInit();
|
||||
// prime debounce state...
|
||||
@@ -179,7 +184,7 @@ void boardInit()
|
||||
|
||||
if (usbPlugged()) {
|
||||
delaysInit();
|
||||
adcInit(&stm32_hal_adc_driver);
|
||||
adcInit(&_adc_driver);
|
||||
getADC();
|
||||
pwrOn(); // required to get bat adc reads
|
||||
storageReadRadioSettings(false); // Needed for bat calibration
|
||||
@@ -208,6 +213,7 @@ void boardInit()
|
||||
#endif
|
||||
|
||||
keysInit();
|
||||
switchInit();
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
rotaryEncoderInit();
|
||||
@@ -215,22 +221,13 @@ void boardInit()
|
||||
|
||||
delaysInit();
|
||||
|
||||
#if NUM_PWMSTICKS > 0
|
||||
sticksPwmInit();
|
||||
delay_ms(20);
|
||||
if (pwm_interrupt_count < 32) {
|
||||
hardwareOptions.sticksPwmDisabled = true;
|
||||
}
|
||||
#if defined(PWM_STICKS)
|
||||
sticksPwmDetect();
|
||||
#endif
|
||||
|
||||
#if defined(FLYSKY_GIMBAL)
|
||||
globalData.flyskygimbals = flysky_gimbal_init();
|
||||
#else
|
||||
globalData.flyskygimbals = false;
|
||||
#endif
|
||||
if (!adcInit(&_adc_driver))
|
||||
TRACE("adcInit failed");
|
||||
|
||||
if (!adcInit(&stm32_hal_adc_driver))
|
||||
TRACE("adcInit failed");
|
||||
lcdInit(); // delaysInit() must be called before
|
||||
audioInit();
|
||||
init2MhzTimer();
|
||||
|
||||
@@ -41,7 +41,11 @@ void rotaryEncoderInit();
|
||||
void rotaryEncoderCheck();
|
||||
#endif
|
||||
|
||||
#define FLASHSIZE 0x80000
|
||||
#if defined(STM32F413xx)
|
||||
#define FLASHSIZE 0x100000 // 1M
|
||||
#else
|
||||
#define FLASHSIZE 0x80000 // 512k
|
||||
#endif
|
||||
#define BOOTLOADER_SIZE 0x8000
|
||||
#define FIRMWARE_ADDRESS 0x08000000
|
||||
|
||||
@@ -133,491 +137,47 @@ uint32_t isBootloaderStart(const uint8_t * buffer);
|
||||
#define TRAINER_CONNECTED() true
|
||||
#endif
|
||||
|
||||
void check_telemetry_exti();
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
|
||||
// Keys driver
|
||||
enum EnumKeys
|
||||
{
|
||||
#if defined(KEYS_GPIO_REG_SHIFT)
|
||||
KEY_SHIFT,
|
||||
#endif
|
||||
#define NUM_FUNCTIONS_SWITCHES 6
|
||||
|
||||
#if defined(KEYS_GPIO_REG_MENU)
|
||||
KEY_MENU,
|
||||
#endif
|
||||
#define DEFAULT_FS_CONFIG \
|
||||
(SWITCH_2POS << 10) + (SWITCH_2POS << 8) + (SWITCH_2POS << 6) + \
|
||||
(SWITCH_2POS << 4) + (SWITCH_2POS << 2) + (SWITCH_2POS << 0)
|
||||
|
||||
KEY_EXIT,
|
||||
KEY_ENTER,
|
||||
#define DEFAULT_FS_GROUPS \
|
||||
(1 << 10) + (1 << 8) + (1 << 6) + (1 << 4) + (1 << 2) + \
|
||||
(1 << 0) // Set all FS to group 1 to act like a 6pos
|
||||
|
||||
#if defined(KEYS_GPIO_REG_DOWN)
|
||||
KEY_DOWN,
|
||||
KEY_UP,
|
||||
#endif
|
||||
#define DEFAULT_FS_STARTUP_CONFIG \
|
||||
((FS_START_PREVIOUS << 10) + (FS_START_PREVIOUS << 8) + \
|
||||
(FS_START_PREVIOUS << 6) + (FS_START_PREVIOUS << 4) + \
|
||||
(FS_START_PREVIOUS << 2) + \
|
||||
(FS_START_PREVIOUS << 0)) // keep last state by default
|
||||
|
||||
#if defined(KEYS_GPIO_REG_RIGHT)
|
||||
KEY_RIGHT,
|
||||
KEY_LEFT,
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PAGE)
|
||||
KEY_PAGE,
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PAGEUP)
|
||||
KEY_PAGEUP,
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PAGEDN)
|
||||
KEY_PAGEDN,
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_REG_SYS)
|
||||
KEY_SYS,
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_REG_MDL)
|
||||
KEY_MODEL,
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_REG_TELE)
|
||||
KEY_TELE,
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PLUS)
|
||||
KEY_PLUS,
|
||||
KEY_MINUS,
|
||||
#endif
|
||||
|
||||
KEY_COUNT,
|
||||
KEY_MAX = KEY_COUNT - 1,
|
||||
|
||||
#if defined(KEYS_GPIO_REG_BIND)
|
||||
KEY_BIND,
|
||||
#endif
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
KEY_PLUS,
|
||||
KEY_MINUS,
|
||||
#endif
|
||||
|
||||
TRM_BASE,
|
||||
TRM_LH_DWN = TRM_BASE,
|
||||
TRM_LH_UP,
|
||||
TRM_LV_DWN,
|
||||
TRM_LV_UP,
|
||||
TRM_RV_DWN,
|
||||
TRM_RV_UP,
|
||||
TRM_RH_DWN,
|
||||
TRM_RH_UP,
|
||||
TRM_LAST = TRM_RH_UP,
|
||||
|
||||
NUM_KEYS
|
||||
};
|
||||
|
||||
#if defined(PCBX9E) && !defined(SIMU)
|
||||
#define KEY_UP KEY_MINUS
|
||||
#define KEY_DOWN KEY_PLUS
|
||||
#define KEY_RIGHT KEY_PLUS
|
||||
#define KEY_LEFT KEY_MINUS
|
||||
#elif defined(NAVIGATION_XLITE)
|
||||
#define KEY_PLUS KEY_RIGHT
|
||||
#define KEY_MINUS KEY_LEFT
|
||||
#elif defined(NAVIGATION_9X)
|
||||
#define KEY_MENU KEY_ENTER
|
||||
#define KEY_MINUS KEY_DOWN
|
||||
#define KEY_PLUS KEY_UP
|
||||
#else
|
||||
#define KEY_UP KEY_PLUS
|
||||
#define KEY_DOWN KEY_MINUS
|
||||
#define KEY_RIGHT KEY_MINUS
|
||||
#define KEY_LEFT KEY_PLUS
|
||||
|
||||
#define NUM_FUNCTIONS_SWITCHES 0
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_SHIFT)
|
||||
#define IS_SHIFT_KEY(index) (index == KEY_SHIFT)
|
||||
#if defined(SIMU)
|
||||
#define IS_SHIFT_PRESSED() (readKeys() & (1 << KEY_SHIFT))
|
||||
#else
|
||||
#define IS_SHIFT_PRESSED() (~KEYS_GPIO_REG_SHIFT & KEYS_GPIO_PIN_SHIFT)
|
||||
#endif
|
||||
#else
|
||||
#define IS_SHIFT_KEY(index) (false)
|
||||
#define IS_SHIFT_PRESSED() (false)
|
||||
#endif
|
||||
|
||||
enum EnumSwitches
|
||||
{
|
||||
SW_SA,
|
||||
SW_SB,
|
||||
SW_SC,
|
||||
SW_SD,
|
||||
SW_SE,
|
||||
SW_SF,
|
||||
SW_SG,
|
||||
SW_SH,
|
||||
SW_SI,
|
||||
SW_SJ,
|
||||
SW_SK,
|
||||
SW_SL,
|
||||
SW_SM,
|
||||
SW_SO,
|
||||
SW_SP,
|
||||
SW_SQ,
|
||||
SW_SR,
|
||||
};
|
||||
#if defined(RADIO_TX12) || defined(RADIO_TX12MK2)
|
||||
#define IS_3POS(x) ((x) != SW_SA && (x) != SW_SD)
|
||||
#elif defined(RADIO_BOXER) || defined(RADIO_ZORRO)
|
||||
#define IS_3POS(x) ((x) == SW_SB || (x) == SW_SC)
|
||||
#else
|
||||
#define IS_3POS(x) ((x) != SW_SF && (x) != SW_SH)
|
||||
#endif
|
||||
enum EnumSwitchesPositions
|
||||
{
|
||||
SW_SA0,
|
||||
SW_SA1,
|
||||
SW_SA2,
|
||||
SW_SB0,
|
||||
SW_SB1,
|
||||
SW_SB2,
|
||||
SW_SC0,
|
||||
SW_SC1,
|
||||
SW_SC2,
|
||||
SW_SD0,
|
||||
SW_SD1,
|
||||
SW_SD2,
|
||||
#if defined(HARDWARE_SWITCH_E)
|
||||
SW_SE0,
|
||||
SW_SE1,
|
||||
SW_SE2,
|
||||
#endif
|
||||
#if defined(HARDWARE_SWITCH_F)
|
||||
SW_SF0,
|
||||
SW_SF1,
|
||||
SW_SF2,
|
||||
#endif
|
||||
#if defined(HARDWARE_SWITCH_G)
|
||||
SW_SG0,
|
||||
SW_SG1,
|
||||
SW_SG2,
|
||||
#endif
|
||||
#if defined(HARDWARE_SWITCH_H)
|
||||
SW_SH0,
|
||||
SW_SH1,
|
||||
SW_SH2,
|
||||
#endif
|
||||
#if defined(RADIO_X9DP2019)
|
||||
SW_SI0,
|
||||
SW_SI1,
|
||||
SW_SI2,
|
||||
#endif
|
||||
#if defined(PCBX7ACCESS)
|
||||
SW_SI0,
|
||||
SW_SI1,
|
||||
SW_SI2,
|
||||
#elif defined(PCBX7) && !defined(RADIO_ZORRO)
|
||||
SW_SI0,
|
||||
SW_SI1,
|
||||
SW_SI2,
|
||||
SW_SJ0,
|
||||
SW_SJ1,
|
||||
SW_SJ2,
|
||||
#endif
|
||||
#if defined(PCBX9E)
|
||||
SW_SI0,
|
||||
SW_SI1,
|
||||
SW_SI2,
|
||||
SW_SJ0,
|
||||
SW_SJ1,
|
||||
SW_SJ2,
|
||||
SW_SK0,
|
||||
SW_SK1,
|
||||
SW_SK2,
|
||||
SW_SL0,
|
||||
SW_SL1,
|
||||
SW_SL2,
|
||||
SW_SM0,
|
||||
SW_SM1,
|
||||
SW_SM2,
|
||||
SW_SN0,
|
||||
SW_SN1,
|
||||
SW_SN2,
|
||||
SW_SO0,
|
||||
SW_SO1,
|
||||
SW_SO2,
|
||||
SW_SP0,
|
||||
SW_SP1,
|
||||
SW_SP2,
|
||||
SW_SQ0,
|
||||
SW_SQ1,
|
||||
SW_SQ2,
|
||||
SW_SR0,
|
||||
SW_SR1,
|
||||
SW_SR2,
|
||||
#endif
|
||||
NUM_SWITCHES_POSITIONS
|
||||
};
|
||||
|
||||
#if defined(PCBXLITES)
|
||||
#define NUM_SWITCHES 6
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 10) + (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 2) + (POT_WITHOUT_DETENT << 0)
|
||||
#elif defined(PCBXLITE)
|
||||
#define NUM_SWITCHES 4
|
||||
#define STORAGE_NUM_SWITCHES 6
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 2) + (POT_WITHOUT_DETENT << 0)
|
||||
#elif defined(RADIO_TLITE) || defined(RADIO_LR3PRO)
|
||||
#define NUM_SWITCHES 4
|
||||
#define STORAGE_NUM_SWITCHES 8
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (0)
|
||||
#elif defined(RADIO_TPRO)
|
||||
#define NUM_SWITCHES 10
|
||||
#define NUM_FUNCTIONS_SWITCHES 6
|
||||
#define NUM_REGULAR_SWITCHES (NUM_SWITCHES - NUM_FUNCTIONS_SWITCHES)
|
||||
#define STORAGE_NUM_SWITCHES 10
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 6) + (SWITCH_TOGGLE << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_FS_CONFIG (SWITCH_2POS << 10) + (SWITCH_2POS << 8) + (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_2POS << 2) + (SWITCH_2POS << 0)
|
||||
#define DEFAULT_FS_GROUPS (1 << 10) + (1 << 8) + (1 << 6) + (1 << 4) + (1 << 2) + (1 << 0) // Set all FS to group 1 to act like a 6pos
|
||||
#define DEFAULT_FS_STARTUP_CONFIG ((FS_START_PREVIOUS << 10) + (FS_START_PREVIOUS << 8) + (FS_START_PREVIOUS << 6) + (FS_START_PREVIOUS << 4) + (FS_START_PREVIOUS << 2) + (FS_START_PREVIOUS << 0)) // keep last state by default
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(RADIO_FAMILY_JUMPER_T12)
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 10) + (SWITCH_2POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITHOUT_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(RADIO_TX12)
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_3POS << 10) + (SWITCH_3POS << 8) + (SWITCH_TOGGLE << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_TOGGLE << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2);
|
||||
#elif defined(RADIO_TX12MK2)
|
||||
#define NUM_SWITCHES 6
|
||||
#define STORAGE_NUM_SWITCHES 8
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_3POS << 10) + (SWITCH_3POS << 8) + (SWITCH_TOGGLE << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_TOGGLE << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2);
|
||||
#elif defined(RADIO_BOXER)
|
||||
#define NUM_SWITCHES 6
|
||||
#define STORAGE_NUM_SWITCHES 8
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 10) + (SWITCH_2POS << 8) + (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_2POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2) + (POT_MULTIPOS_SWITCH << 4);
|
||||
#elif defined(RADIO_ZORRO)
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 14) + (SWITCH_TOGGLE << 12) + (SWITCH_2POS << 10) + (SWITCH_2POS << 8) + (SWITCH_TOGGLE << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_TOGGLE << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITHOUT_DETENT << 2);
|
||||
#elif defined(RADIO_T8) || defined(RADIO_COMMANDO8)
|
||||
#define NUM_SWITCHES 4
|
||||
#define STORAGE_NUM_SWITCHES 8
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_2POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (0)
|
||||
#elif defined(PCBX7ACCESS)
|
||||
#define NUM_SWITCHES 7
|
||||
#define STORAGE_NUM_SWITCHES 8
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 10) + (SWITCH_2POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(PCBX7)
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 10) + (SWITCH_2POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(PCBX9LITES)
|
||||
#define NUM_SWITCHES 7
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 12) + (SWITCH_TOGGLE << 10) + (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0); // S1 = pot with detent
|
||||
#elif defined(PCBX9LITE)
|
||||
#define NUM_SWITCHES 5
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0); // S1 = pot with detent
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_SWITCHES 18 // yes, it's perfect like that !
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 14) + (SWITCH_3POS << 12) + (SWITCH_2POS << 10) + (SWITCH_3POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#define DEFAULT_SLIDERS_CONFIG (SLIDER_WITH_DETENT << 3) + (SLIDER_WITH_DETENT << 2) + (SLIDER_WITH_DETENT << 1) + (SLIDER_WITH_DETENT << 0)
|
||||
#elif defined(RADIO_X9DP2019)
|
||||
#define NUM_SWITCHES 9
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 16) + (SWITCH_TOGGLE << 14) + (SWITCH_3POS << 12) + (SWITCH_2POS << 10) + (SWITCH_3POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#define DEFAULT_SLIDERS_CONFIG (SLIDER_WITH_DETENT << 1) + (SLIDER_WITH_DETENT << 0)
|
||||
#elif defined(PCBX9D) || defined(PCBX9DP)
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES 9
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 14) + (SWITCH_3POS << 12) + (SWITCH_2POS << 10) + (SWITCH_3POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#define DEFAULT_SLIDERS_CONFIG (SLIDER_WITH_DETENT << 1) + (SLIDER_WITH_DETENT << 0)
|
||||
#endif
|
||||
|
||||
#if !defined(NUM_FUNCTIONS_SWITCHES)
|
||||
#define NUM_FUNCTIONS_SWITCHES 0
|
||||
#endif
|
||||
|
||||
#define STORAGE_NUM_SWITCHES_POSITIONS (STORAGE_NUM_SWITCHES * 3)
|
||||
|
||||
void keysInit();
|
||||
uint32_t switchState(uint8_t index);
|
||||
uint32_t readKeys();
|
||||
uint32_t readTrims();
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
extern uint8_t fsPreviousState;
|
||||
void evalFunctionSwitches();
|
||||
void setFSStartupPosition();
|
||||
void fsLedOff(uint8_t);
|
||||
void fsLedOn(uint8_t);
|
||||
uint8_t getFSLogicalState(uint8_t index);
|
||||
uint8_t getFSPhysicalState(uint8_t index);
|
||||
#endif
|
||||
|
||||
#define TRIMS_PRESSED() (readTrims())
|
||||
#define KEYS_PRESSED() (readKeys())
|
||||
|
||||
// ADC driver
|
||||
enum Analogs {
|
||||
STICK1,
|
||||
STICK2,
|
||||
STICK3,
|
||||
STICK4,
|
||||
POT_FIRST,
|
||||
POT1 = POT_FIRST,
|
||||
#if defined(PCBX9LITE)
|
||||
POT_LAST = POT1,
|
||||
#elif defined(RADIO_BOXER)
|
||||
POT2,
|
||||
POT3,
|
||||
POT_LAST = POT3,
|
||||
#elif defined(PCBXLITE) || defined(PCBX7)
|
||||
POT2,
|
||||
POT_LAST = POT2,
|
||||
#elif defined(PCBX9E)
|
||||
POT2,
|
||||
POT3,
|
||||
POT4,
|
||||
POT_LAST = POT4,
|
||||
SLIDER1,
|
||||
SLIDER2,
|
||||
SLIDER3,
|
||||
SLIDER4,
|
||||
#else
|
||||
POT2,
|
||||
POT3,
|
||||
POT_LAST = POT3,
|
||||
SLIDER1,
|
||||
SLIDER2,
|
||||
#endif
|
||||
TX_VOLTAGE,
|
||||
TX_RTC_VOLTAGE,
|
||||
NUM_ANALOGS
|
||||
};
|
||||
|
||||
#define HAS_TX_RTC_VOLTAGE
|
||||
|
||||
#if defined(PCBX9LITE)
|
||||
#define NUM_POTS 1
|
||||
#define NUM_SLIDERS 0
|
||||
#define STORAGE_NUM_POTS 1
|
||||
#define STORAGE_NUM_SLIDERS 0
|
||||
#elif defined(RADIO_T8) || defined(RADIO_TLITE) || defined(RADIO_COMMANDO8) || defined(RADIO_LR3PRO)
|
||||
#define NUM_POTS 0
|
||||
#define NUM_SLIDERS 0
|
||||
#define STORAGE_NUM_POTS 2
|
||||
#define STORAGE_NUM_SLIDERS 0
|
||||
#elif defined(RADIO_BOXER)
|
||||
#define NUM_POTS 3 // S1 + S2 + 6POS
|
||||
#define NUM_SLIDERS 0
|
||||
#define STORAGE_NUM_POTS 3
|
||||
#define STORAGE_NUM_SLIDERS 0
|
||||
#elif defined(PCBXLITE) || defined(PCBX7)
|
||||
#define NUM_POTS 2
|
||||
#define NUM_SLIDERS 0
|
||||
#define STORAGE_NUM_POTS 2
|
||||
#define STORAGE_NUM_SLIDERS 0
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_POTS 4
|
||||
#define NUM_SLIDERS 4
|
||||
#define STORAGE_NUM_POTS 4
|
||||
#define STORAGE_NUM_SLIDERS 4
|
||||
#elif defined(PCBX9DP)
|
||||
#define NUM_POTS 3
|
||||
#define NUM_SLIDERS 2
|
||||
#define STORAGE_NUM_POTS 3
|
||||
#define STORAGE_NUM_SLIDERS 2
|
||||
#else
|
||||
#define NUM_POTS 3 // TODO X9D has only 2 pots
|
||||
#define NUM_SLIDERS 2
|
||||
#define STORAGE_NUM_POTS 3
|
||||
#define STORAGE_NUM_SLIDERS 2
|
||||
#endif
|
||||
|
||||
#define NUM_XPOTS STORAGE_NUM_POTS
|
||||
#define NUM_TRIMS 4
|
||||
#define NUM_MOUSE_ANALOGS 0
|
||||
#define STORAGE_NUM_MOUSE_ANALOGS 0
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
#define NUM_TRIMS_KEYS 4
|
||||
#else
|
||||
#define NUM_TRIMS_KEYS (NUM_TRIMS * 2)
|
||||
#endif
|
||||
|
||||
#if defined(STICKS_PWM)
|
||||
#define NUM_PWMSTICKS 4
|
||||
#define STICKS_PWM_ENABLED() (!hardwareOptions.sticksPwmDisabled)
|
||||
void sticksPwmInit();
|
||||
void sticksPwmRead(uint16_t * values);
|
||||
extern volatile uint32_t pwm_interrupt_count; // TODO => reusable buffer (boot section)
|
||||
#else
|
||||
#define STICKS_PWM_ENABLED() false
|
||||
bool getFSLedState(uint8_t index);
|
||||
#endif
|
||||
|
||||
PACK(typedef struct {
|
||||
uint8_t pcbrev:2;
|
||||
uint8_t sticksPwmDisabled:1;
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
|
||||
extern HardwareOptions hardwareOptions;
|
||||
|
||||
#if !defined(PXX2)
|
||||
#define IS_PXX2_INTERNAL_ENABLED() (false)
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (true)
|
||||
#elif !defined(PXX1) || defined(PCBXLITES) || defined(PCBX9LITE)
|
||||
#define IS_PXX2_INTERNAL_ENABLED() (true)
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (false)
|
||||
#elif defined(INTERNAL_MODULE_PXX1)
|
||||
#define IS_PXX2_INTERNAL_ENABLED() (false)
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (true)
|
||||
#else
|
||||
// TODO #define PXX2_PROBE
|
||||
// TODO #define IS_PXX2_INTERNAL_ENABLED() (hardwareOptions.pxx2Enabled)
|
||||
#define IS_PXX2_INTERNAL_ENABLED() (true)
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (true)
|
||||
#endif
|
||||
|
||||
enum CalibratedAnalogs {
|
||||
CALIBRATED_STICK1,
|
||||
CALIBRATED_STICK2,
|
||||
CALIBRATED_STICK3,
|
||||
CALIBRATED_STICK4,
|
||||
CALIBRATED_POT_FIRST,
|
||||
CALIBRATED_POT_LAST = CALIBRATED_POT_FIRST + NUM_POTS - 1,
|
||||
CALIBRATED_SLIDER_FIRST,
|
||||
CALIBRATED_SLIDER_LAST = CALIBRATED_SLIDER_FIRST + NUM_SLIDERS - 1,
|
||||
NUM_CALIBRATED_ANALOGS
|
||||
};
|
||||
|
||||
#if defined(PCBX9D)
|
||||
#define IS_POT(x) ((x)>=POT_FIRST && (x)<=POT2) // POT3 is only defined in software
|
||||
#else
|
||||
#define IS_POT(x) ((x)>=POT_FIRST && (x)<=POT_LAST)
|
||||
#endif
|
||||
|
||||
#define IS_SLIDER(x) ((x)>POT_LAST && (x)<TX_VOLTAGE)
|
||||
|
||||
extern uint16_t adcValues[NUM_ANALOGS];
|
||||
|
||||
// Battery driver
|
||||
#if defined(PCBX9E)
|
||||
// NI-MH 9.6V
|
||||
@@ -668,6 +228,7 @@ uint32_t pwrCheck();
|
||||
void pwrOn();
|
||||
void pwrOff();
|
||||
bool pwrPressed();
|
||||
bool pwrOffPressed();
|
||||
#if defined(PWR_BUTTON_PRESS)
|
||||
#define STARTUP_ANIMATION
|
||||
uint32_t pwrPressedDuration();
|
||||
@@ -675,11 +236,7 @@ uint32_t pwrPressedDuration();
|
||||
void pwrResetHandler();
|
||||
#define pwrForcePressed() false
|
||||
|
||||
#if defined(SIMU)
|
||||
#define UNEXPECTED_SHUTDOWN() false
|
||||
#else
|
||||
#define UNEXPECTED_SHUTDOWN() (WAS_RESET_BY_WATCHDOG() || g_eeGeneral.unexpectedShutdown)
|
||||
#endif
|
||||
bool UNEXPECTED_SHUTDOWN();
|
||||
|
||||
// Backlight driver
|
||||
#define BACKLIGHT_DISABLE() backlightDisable()
|
||||
@@ -747,19 +304,6 @@ uint8_t isBacklightEnabled();
|
||||
// Debug driver
|
||||
void debugPutc(const char c);
|
||||
|
||||
// Telemetry driver
|
||||
// void telemetryPortInit(uint32_t baudrate, uint8_t mode);
|
||||
// void telemetryPortSetDirectionInput();
|
||||
// void telemetryPortSetDirectionOutput();
|
||||
// void sportSendByte(uint8_t byte);
|
||||
// void sportSendByteLoop(uint8_t byte);
|
||||
// void sportStopSendByteLoop();
|
||||
// void sportSendBuffer(const uint8_t * buffer, uint32_t count);
|
||||
// bool sportGetByte(uint8_t * byte);
|
||||
// void telemetryClearFifo();
|
||||
// extern uint32_t telemetryErrors;
|
||||
|
||||
|
||||
// Audio driver
|
||||
void audioInit() ;
|
||||
void audioEnd() ;
|
||||
@@ -825,10 +369,6 @@ void ledOff();
|
||||
void ledRed();
|
||||
void ledGreen();
|
||||
void ledBlue();
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
void fsLedOff(uint8_t);
|
||||
void fsLedOn(uint8_t);
|
||||
#endif
|
||||
|
||||
// LCD driver
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E)
|
||||
@@ -898,8 +438,6 @@ void setTopBatteryState(int state, uint8_t blinking);
|
||||
void setTopBatteryValue(uint32_t volts);
|
||||
#endif
|
||||
|
||||
#define USART_FLAG_ERRORS (USART_FLAG_ORE | USART_FLAG_NE | USART_FLAG_FE | USART_FLAG_PE)
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
#define TELEMETRY_FIFO_SIZE 128
|
||||
#else
|
||||
|
||||
@@ -22,27 +22,14 @@
|
||||
#include "stm32_hal_ll.h"
|
||||
#include "stm32_hal.h"
|
||||
#include "stm32_i2c_driver.h"
|
||||
#include "stm32_gpio_driver.h"
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
#include "hal/eeprom_driver.h"
|
||||
|
||||
static int enable_wp_clock(GPIO_TypeDef *GPIOx)
|
||||
{
|
||||
if (GPIOx == GPIOB)
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
else if (GPIOx == GPIOD)
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
else if (GPIOx == GPIOF)
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void init_wp_pin()
|
||||
{
|
||||
enable_wp_clock(EEPROM_WP_GPIO);
|
||||
stm32_gpio_enable_clock(EEPROM_WP_GPIO);
|
||||
|
||||
LL_GPIO_InitTypeDef pinInit;
|
||||
LL_GPIO_StructInit(&pinInit);
|
||||
|
||||
+760
-710
File diff suppressed because it is too large
Load Diff
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* 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 "intmodule_pulses_driver.h"
|
||||
|
||||
#include "hal.h"
|
||||
#include "board.h"
|
||||
#include "timers_driver.h"
|
||||
|
||||
#if defined(INTMODULE_TIMER)
|
||||
|
||||
static stm32_pulse_dma_tc_cb_t _int_timer_DMA_TC_Callback;
|
||||
|
||||
const stm32_pulse_timer_t intmoduleTimer = {
|
||||
.GPIOx = INTMODULE_TX_GPIO,
|
||||
.GPIO_Pin = INTMODULE_TX_GPIO_PIN,
|
||||
.GPIO_Alternate = INTMODULE_TX_GPIO_AF,
|
||||
.TIMx = INTMODULE_TIMER,
|
||||
.TIM_Freq = INTMODULE_TIMER_FREQ,
|
||||
.TIM_Channel = INTMODULE_TIMER_Channel,
|
||||
.TIM_IRQn = INTMODULE_TIMER_IRQn,
|
||||
.DMAx = INTMODULE_TIMER_DMA,
|
||||
.DMA_Stream = INTMODULE_TIMER_DMA_STREAM,
|
||||
.DMA_Channel = INTMODULE_TIMER_DMA_CHANNEL,
|
||||
.DMA_IRQn = INTMODULE_TIMER_DMA_STREAM_IRQn,
|
||||
.DMA_TC_CallbackPtr = &_int_timer_DMA_TC_Callback,
|
||||
};
|
||||
|
||||
// Make sure the timer channel is supported
|
||||
static_assert(__STM32_PULSE_IS_TIMER_CHANNEL_SUPPORTED(INTMODULE_TIMER_Channel),
|
||||
"Unsupported timer channel");
|
||||
|
||||
// Make sure the DMA channel is supported
|
||||
static_assert(__STM32_PULSE_IS_DMA_STREAM_SUPPORTED(INTMODULE_TIMER_DMA_STREAM),
|
||||
"Unsupported DMA stream");
|
||||
|
||||
#if !defined(INTMODULE_TIMER_DMA_IRQHandler)
|
||||
#error "Missing INTMODULE_TIMER_DMA_IRQHandler definition"
|
||||
#endif
|
||||
|
||||
extern "C" void INTMODULE_TIMER_DMA_IRQHandler()
|
||||
{
|
||||
stm32_pulse_dma_tc_isr(&intmoduleTimer);
|
||||
}
|
||||
|
||||
#if !defined(INTMODULE_TIMER_IRQHandler)
|
||||
#error "Missing INTMODULE_TIMER_IRQHandler definition"
|
||||
#endif
|
||||
|
||||
extern "C" void INTMODULE_TIMER_IRQHandler()
|
||||
{
|
||||
stm32_pulse_tim_update_isr(&intmoduleTimer);
|
||||
}
|
||||
|
||||
#endif // INTMODULE_TIMER
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "stm32_pulse_driver.h"
|
||||
|
||||
// used in module_ports.cpp
|
||||
extern const stm32_pulse_timer_t intmoduleTimer;
|
||||
@@ -1,333 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* 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 "board.h"
|
||||
|
||||
uint32_t readKeys()
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
if (~KEYS_GPIO_REG_ENTER & KEYS_GPIO_PIN_ENTER)
|
||||
result |= 1 << KEY_ENTER;
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_MENU)
|
||||
if (~KEYS_GPIO_REG_MENU & KEYS_GPIO_PIN_MENU)
|
||||
result |= 1 << KEY_MENU;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_PAGE)
|
||||
if (~KEYS_GPIO_REG_PAGE & KEYS_GPIO_PIN_PAGE)
|
||||
result |= 1 << KEY_PAGE;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_PAGEUP)
|
||||
if (~KEYS_GPIO_REG_PAGEUP & KEYS_GPIO_PIN_PAGEUP)
|
||||
result |= 1 << KEY_PAGEUP;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_PAGEDN)
|
||||
if (~KEYS_GPIO_REG_PAGEDN & KEYS_GPIO_PIN_PAGEDN)
|
||||
result |= 1 << KEY_PAGEDN;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_SYS)
|
||||
if (~KEYS_GPIO_REG_SYS & KEYS_GPIO_PIN_SYS)
|
||||
result |= 1 << KEY_SYS;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_MDL)
|
||||
if (~KEYS_GPIO_REG_MDL & KEYS_GPIO_PIN_MDL)
|
||||
result |= 1 << KEY_MODEL;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_TELE)
|
||||
if (~KEYS_GPIO_REG_TELE & KEYS_GPIO_PIN_TELE)
|
||||
result |= 1 << KEY_TELE;
|
||||
#endif
|
||||
|
||||
if (~KEYS_GPIO_REG_EXIT & KEYS_GPIO_PIN_EXIT)
|
||||
result |= 1 << KEY_EXIT;
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_PLUS)
|
||||
if (~KEYS_GPIO_REG_PLUS & KEYS_GPIO_PIN_PLUS)
|
||||
result |= 1 << KEY_PLUS;
|
||||
if (~KEYS_GPIO_REG_MINUS & KEYS_GPIO_PIN_MINUS)
|
||||
result |= 1 << KEY_MINUS;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_LEFT)
|
||||
if (~KEYS_GPIO_REG_LEFT & KEYS_GPIO_PIN_LEFT)
|
||||
result |= 1 << KEY_LEFT;
|
||||
if (~KEYS_GPIO_REG_RIGHT & KEYS_GPIO_PIN_RIGHT)
|
||||
result |= 1 << KEY_RIGHT;
|
||||
if (~KEYS_GPIO_REG_UP & KEYS_GPIO_PIN_UP)
|
||||
result |= 1 << KEY_UP;
|
||||
if (~KEYS_GPIO_REG_DOWN & KEYS_GPIO_PIN_DOWN)
|
||||
result |= 1 << KEY_DOWN;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_SHIFT)
|
||||
if (~KEYS_GPIO_REG_SHIFT & KEYS_GPIO_PIN_SHIFT)
|
||||
result |= 1 << KEY_SHIFT;
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_BIND)
|
||||
if (~KEYS_GPIO_REG_BIND & KEYS_GPIO_PIN_BIND)
|
||||
result |= 1 << KEY_BIND;
|
||||
#endif
|
||||
// if (result != 0) TRACE("readKeys(): result=0x%02x", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t readTrims()
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
if (~TRIMS_GPIO_REG_LHL & TRIMS_GPIO_PIN_LHL)
|
||||
result |= 0x01;
|
||||
if (~TRIMS_GPIO_REG_LHR & TRIMS_GPIO_PIN_LHR)
|
||||
result |= 0x02;
|
||||
if (~TRIMS_GPIO_REG_LVD & TRIMS_GPIO_PIN_LVD)
|
||||
result |= 0x04;
|
||||
if (~TRIMS_GPIO_REG_LVU & TRIMS_GPIO_PIN_LVU)
|
||||
result |= 0x08;
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
if (IS_SHIFT_PRESSED())
|
||||
result = ((result & 0x03) << 6) | ((result & 0x0c) << 2);
|
||||
#else
|
||||
if (~TRIMS_GPIO_REG_RVD & TRIMS_GPIO_PIN_RVD)
|
||||
result |= 0x10;
|
||||
if (~TRIMS_GPIO_REG_RVU & TRIMS_GPIO_PIN_RVU)
|
||||
result |= 0x20;
|
||||
if (~TRIMS_GPIO_REG_RHL & TRIMS_GPIO_PIN_RHL)
|
||||
result |= 0x40;
|
||||
if (~TRIMS_GPIO_REG_RHR & TRIMS_GPIO_PIN_RHR)
|
||||
result |= 0x80;
|
||||
#endif
|
||||
|
||||
// TRACE("readTrims(): result=0x%02x", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool trimDown(uint8_t idx)
|
||||
{
|
||||
return readTrims() & (1 << idx);
|
||||
}
|
||||
|
||||
bool keyDown()
|
||||
{
|
||||
return readKeys() || readTrims();
|
||||
}
|
||||
|
||||
#if defined(PCBX9E)
|
||||
#define ADD_2POS_CASE(x) \
|
||||
case SW_S ## x ## 2: \
|
||||
xxx = SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \
|
||||
break; \
|
||||
case SW_S ## x ## 0: \
|
||||
xxx = ~SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \
|
||||
break
|
||||
#else
|
||||
#define ADD_2POS_CASE(x) \
|
||||
case SW_S ## x ## 0: \
|
||||
xxx = SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \
|
||||
break; \
|
||||
case SW_S ## x ## 2: \
|
||||
xxx = ~SWITCHES_GPIO_REG_ ## x & SWITCHES_GPIO_PIN_ ## x ; \
|
||||
break
|
||||
#endif
|
||||
|
||||
#define ADD_3POS_CASE(x, i) \
|
||||
case SW_S ## x ## 0: \
|
||||
xxx = (SWITCHES_GPIO_REG_ ## x ## _H & SWITCHES_GPIO_PIN_ ## x ## _H); \
|
||||
if (IS_CONFIG_3POS(i)) { \
|
||||
xxx = xxx && (~SWITCHES_GPIO_REG_ ## x ## _L & SWITCHES_GPIO_PIN_ ## x ## _L); \
|
||||
} \
|
||||
break; \
|
||||
case SW_S ## x ## 1: \
|
||||
xxx = (SWITCHES_GPIO_REG_ ## x ## _H & SWITCHES_GPIO_PIN_ ## x ## _H) && (SWITCHES_GPIO_REG_ ## x ## _L & SWITCHES_GPIO_PIN_ ## x ## _L); \
|
||||
break; \
|
||||
case SW_S ## x ## 2: \
|
||||
xxx = (~SWITCHES_GPIO_REG_ ## x ## _H & SWITCHES_GPIO_PIN_ ## x ## _H); \
|
||||
if (IS_CONFIG_3POS(i)) { \
|
||||
xxx = xxx && (SWITCHES_GPIO_REG_ ## x ## _L & SWITCHES_GPIO_PIN_ ## x ## _L); \
|
||||
} \
|
||||
break
|
||||
|
||||
#if !defined(BOOT)
|
||||
#include "opentx.h"
|
||||
|
||||
uint32_t switchState(uint8_t index)
|
||||
{
|
||||
uint32_t xxx = 0;
|
||||
|
||||
switch (index) {
|
||||
|
||||
#if defined(RADIO_TX12) || defined(RADIO_TX12MK2) || defined(RADIO_BOXER) || defined(RADIO_ZORRO) || defined(RADIO_T8) || defined(RADIO_COMMANDO8)
|
||||
ADD_2POS_CASE(A);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_3POS_CASE(C, 2);
|
||||
#elif defined(RADIO_TLITE) || defined(RADIO_TPRO) || defined(RADIO_LR3PRO)
|
||||
ADD_3POS_CASE(A, 0);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_2POS_CASE(C);
|
||||
ADD_2POS_CASE(D);
|
||||
#else
|
||||
ADD_3POS_CASE(A, 0);
|
||||
ADD_3POS_CASE(B, 1);
|
||||
ADD_3POS_CASE(C, 2);
|
||||
#endif
|
||||
#if defined(PCBX9LITES)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_2POS_CASE(E);
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_2POS_CASE(G);
|
||||
#elif defined(PCBX9LITE)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_2POS_CASE(E);
|
||||
#elif defined(PCBXLITES)
|
||||
ADD_3POS_CASE(D, 3);
|
||||
ADD_2POS_CASE(E);
|
||||
ADD_2POS_CASE(F);
|
||||
// no SWG and SWH on XLITES
|
||||
#elif defined(PCBXLITE)
|
||||
ADD_3POS_CASE(D, 3);
|
||||
// no SWE, SWF, SWG and SWH on XLITE
|
||||
#elif defined(PCBX7ACCESS)
|
||||
ADD_3POS_CASE(D, 3);
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_2POS_CASE(H);
|
||||
ADD_2POS_CASE(I);
|
||||
// no SWJ on XLITE
|
||||
#elif defined(RADIO_ZORRO)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_2POS_CASE(E);
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_2POS_CASE(G);
|
||||
ADD_2POS_CASE(H);
|
||||
#elif defined(RADIO_TX12MK2)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_3POS_CASE(E, 4);
|
||||
ADD_3POS_CASE(F, 5);
|
||||
#elif defined(RADIO_BOXER)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_2POS_CASE(E);
|
||||
ADD_2POS_CASE(F);
|
||||
#elif defined(RADIO_TX12) || defined(RADIO_ZORRO)
|
||||
ADD_2POS_CASE(D);
|
||||
ADD_3POS_CASE(E, 4);
|
||||
ADD_3POS_CASE(F, 5);
|
||||
ADD_2POS_CASE(I);
|
||||
ADD_2POS_CASE(J);
|
||||
#elif defined(RADIO_T8) || defined(RADIO_COMMANDO8)
|
||||
ADD_2POS_CASE(D);
|
||||
#elif defined(RADIO_TLITE) || defined(RADIO_LR3PRO)
|
||||
// Only 4 switches
|
||||
#elif defined(RADIO_TPRO)
|
||||
ADD_2POS_CASE(E);
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_2POS_CASE(G);
|
||||
ADD_2POS_CASE(H);
|
||||
ADD_2POS_CASE(I);
|
||||
ADD_2POS_CASE(J);
|
||||
#elif defined(PCBX7)
|
||||
ADD_3POS_CASE(D, 3);
|
||||
#if defined(RADIO_T12)
|
||||
ADD_2POS_CASE(G);
|
||||
#else
|
||||
ADD_2POS_CASE(F);
|
||||
#endif
|
||||
ADD_2POS_CASE(H);
|
||||
ADD_2POS_CASE(I);
|
||||
ADD_2POS_CASE(J);
|
||||
#else
|
||||
ADD_3POS_CASE(D, 3);
|
||||
ADD_3POS_CASE(E, 4);
|
||||
ADD_2POS_CASE(F);
|
||||
ADD_3POS_CASE(G, 6);
|
||||
ADD_2POS_CASE(H);
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_X9DP2019)
|
||||
ADD_2POS_CASE(I);
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9E)
|
||||
ADD_3POS_CASE(I, 8);
|
||||
ADD_3POS_CASE(J, 9);
|
||||
ADD_3POS_CASE(K, 10);
|
||||
ADD_3POS_CASE(L, 11);
|
||||
ADD_3POS_CASE(M, 12);
|
||||
ADD_3POS_CASE(N, 13);
|
||||
ADD_3POS_CASE(O, 14);
|
||||
ADD_3POS_CASE(P, 15);
|
||||
ADD_3POS_CASE(Q, 16);
|
||||
ADD_3POS_CASE(R, 17);
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// TRACE("switch %d => %d", index, xxx);
|
||||
return xxx;
|
||||
}
|
||||
#endif
|
||||
|
||||
void keysInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
|
||||
#if defined(KEYS_GPIOA_PINS)
|
||||
INIT_KEYS_PINS(GPIOA);
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIOB_PINS)
|
||||
INIT_KEYS_PINS(GPIOB);
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIOC_PINS)
|
||||
INIT_KEYS_PINS(GPIOC);
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIOD_PINS)
|
||||
INIT_KEYS_PINS(GPIOD);
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIOE_PINS)
|
||||
INIT_KEYS_PINS(GPIOE);
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIOF_PINS)
|
||||
INIT_KEYS_PINS(GPIOF);
|
||||
#endif
|
||||
|
||||
#if defined(KEYS_GPIOG_PINS)
|
||||
INIT_KEYS_PINS(GPIOG);
|
||||
#endif
|
||||
}
|
||||
@@ -56,7 +56,9 @@ void ledInit()
|
||||
}
|
||||
|
||||
#if defined(FUNCTION_SWITCHES)
|
||||
constexpr uint32_t fsLeds[] = {FSLED_GPIO_PIN_1, FSLED_GPIO_PIN_2, FSLED_GPIO_PIN_3, FSLED_GPIO_PIN_4, FSLED_GPIO_PIN_5, FSLED_GPIO_PIN_6};
|
||||
constexpr uint32_t fsLeds[] = {FSLED_GPIO_PIN_1, FSLED_GPIO_PIN_2,
|
||||
FSLED_GPIO_PIN_3, FSLED_GPIO_PIN_4,
|
||||
FSLED_GPIO_PIN_5, FSLED_GPIO_PIN_6};
|
||||
|
||||
void fsLedOff(uint8_t index)
|
||||
{
|
||||
@@ -67,6 +69,11 @@ void fsLedOn(uint8_t index)
|
||||
{
|
||||
GPIO_FSLED_GPIO_ON(FSLED_GPIO, fsLeds[index]);
|
||||
}
|
||||
|
||||
bool getFSLedState(uint8_t index)
|
||||
{
|
||||
return (FSLED_GPIO->ODR & fsLeds[index]);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ledOff()
|
||||
|
||||
@@ -0,0 +1,575 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file startup_stm32f413xx.s
|
||||
* @author MCD Application Team
|
||||
* @brief STM32F413xx Devices vector table for GCC based toolchains.
|
||||
* This module performs:
|
||||
* - Set the initial SP
|
||||
* - Set the initial PC == Reset_Handler,
|
||||
* - Set the vector table entries with the exceptions ISR address
|
||||
* - Branches to main in the C library (which eventually
|
||||
* calls main()).
|
||||
* After Reset the Cortex-M4 processor is in Thread mode,
|
||||
* priority is Privileged, and the Stack is set to Main.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
.syntax unified
|
||||
.cpu cortex-m4
|
||||
.fpu softvfp
|
||||
.thumb
|
||||
|
||||
.global g_pfnVectors
|
||||
.global Default_Handler
|
||||
|
||||
/* start address for the initialization values of the .data section.
|
||||
defined in linker script */
|
||||
.word _sidata
|
||||
/* start address for the .data section. defined in linker script */
|
||||
.word _sdata
|
||||
/* end address for the .data section. defined in linker script */
|
||||
.word _edata
|
||||
/* start address for the .bss section. defined in linker script */
|
||||
.word _sbss
|
||||
/* end address for the .bss section. defined in linker script */
|
||||
.word _ebss
|
||||
/* stack used for SystemInit_ExtMemCtl; always internal RAM used */
|
||||
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor first
|
||||
* starts execution following a reset event. Only the absolutely
|
||||
* necessary set is performed, after which the application
|
||||
* supplied main() routine is called.
|
||||
* @param None
|
||||
* @retval : None
|
||||
*/
|
||||
|
||||
.section .text.Reset_Handler
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
bl pwrResetHandler /*jump to WDT reset handler where soft power control pin is turned on as soon as possible */
|
||||
|
||||
/* Copy the data segment initializers from flash to SRAM */
|
||||
ldr r0, =_sdata
|
||||
ldr r1, =_edata
|
||||
ldr r2, =_sidata
|
||||
movs r3, #0
|
||||
b LoopCopyDataInit
|
||||
|
||||
CopyDataInit:
|
||||
ldr r4, [r2, r3]
|
||||
str r4, [r0, r3]
|
||||
adds r3, r3, #4
|
||||
|
||||
LoopCopyDataInit:
|
||||
adds r4, r0, r3
|
||||
cmp r4, r1
|
||||
bcc CopyDataInit
|
||||
|
||||
/* Zero fill the bss segment. */
|
||||
ldr r2, =_sbss
|
||||
ldr r4, =_ebss
|
||||
movs r3, #0
|
||||
b LoopFillZerobss
|
||||
|
||||
FillZerobss:
|
||||
str r3, [r2]
|
||||
adds r2, r2, #4
|
||||
|
||||
LoopFillZerobss:
|
||||
cmp r2, r4
|
||||
bcc FillZerobss
|
||||
|
||||
/*Paint Main Stack */
|
||||
ldr r2, = _main_stack_start
|
||||
PaintMainStack:
|
||||
movs r3, #0x55555555
|
||||
str r3, [r2], #4
|
||||
LoopPaintMainStack:
|
||||
ldr r3, = _estack
|
||||
cmp r2, r3
|
||||
bcc PaintMainStack
|
||||
|
||||
/* Call the clock system initialization function.*/
|
||||
bl SystemInit
|
||||
/* Call static constructors */
|
||||
bl __libc_init_array
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bx lr
|
||||
.size Reset_Handler, .-Reset_Handler
|
||||
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor receives an
|
||||
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||
* the system state for examination by a debugger.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
.section .text.Default_Handler,"ax",%progbits
|
||||
Default_Handler:
|
||||
Infinite_Loop:
|
||||
b Infinite_Loop
|
||||
.size Default_Handler, .-Default_Handler
|
||||
/******************************************************************************
|
||||
*
|
||||
* The minimal vector table for a Cortex M3. Note that the proper constructs
|
||||
* must be placed on this to ensure that it ends up at physical address
|
||||
* 0x0000.0000.
|
||||
*
|
||||
*******************************************************************************/
|
||||
.section .isr_vector,"a",%progbits
|
||||
.type g_pfnVectors, %object
|
||||
.size g_pfnVectors, .-g_pfnVectors
|
||||
|
||||
g_pfnVectors:
|
||||
.word _estack
|
||||
.word Reset_Handler
|
||||
.word NMI_Handler
|
||||
.word HardFault_Handler
|
||||
.word MemManage_Handler
|
||||
.word BusFault_Handler
|
||||
.word UsageFault_Handler
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word SVC_Handler
|
||||
.word DebugMon_Handler
|
||||
.word 0
|
||||
.word PendSV_Handler
|
||||
.word SysTick_Handler
|
||||
|
||||
/* External Interrupts */
|
||||
.word WWDG_IRQHandler /* Window WatchDog */
|
||||
.word PVD_IRQHandler /* PVD through EXTI Line detection */
|
||||
.word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */
|
||||
.word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */
|
||||
.word FLASH_IRQHandler /* FLASH */
|
||||
.word RCC_IRQHandler /* RCC */
|
||||
.word EXTI0_IRQHandler /* EXTI Line0 */
|
||||
.word EXTI1_IRQHandler /* EXTI Line1 */
|
||||
.word EXTI2_IRQHandler /* EXTI Line2 */
|
||||
.word EXTI3_IRQHandler /* EXTI Line3 */
|
||||
.word EXTI4_IRQHandler /* EXTI Line4 */
|
||||
.word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */
|
||||
.word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */
|
||||
.word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */
|
||||
.word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */
|
||||
.word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */
|
||||
.word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */
|
||||
.word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */
|
||||
.word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */
|
||||
.word CAN1_TX_IRQHandler /* CAN1 TX */
|
||||
.word CAN1_RX0_IRQHandler /* CAN1 RX0 */
|
||||
.word CAN1_RX1_IRQHandler /* CAN1 RX1 */
|
||||
.word CAN1_SCE_IRQHandler /* CAN1 SCE */
|
||||
.word EXTI9_5_IRQHandler /* External Line[9:5]s */
|
||||
.word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */
|
||||
.word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */
|
||||
.word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */
|
||||
.word TIM1_CC_IRQHandler /* TIM1 Capture Compare */
|
||||
.word TIM2_IRQHandler /* TIM2 */
|
||||
.word TIM3_IRQHandler /* TIM3 */
|
||||
.word TIM4_IRQHandler /* TIM4 */
|
||||
.word I2C1_EV_IRQHandler /* I2C1 Event */
|
||||
.word I2C1_ER_IRQHandler /* I2C1 Error */
|
||||
.word I2C2_EV_IRQHandler /* I2C2 Event */
|
||||
.word I2C2_ER_IRQHandler /* I2C2 Error */
|
||||
.word SPI1_IRQHandler /* SPI1 */
|
||||
.word SPI2_IRQHandler /* SPI2 */
|
||||
.word USART1_IRQHandler /* USART1 */
|
||||
.word USART2_IRQHandler /* USART2 */
|
||||
.word USART3_IRQHandler /* USART3 */
|
||||
.word EXTI15_10_IRQHandler /* External Line[15:10]s */
|
||||
.word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */
|
||||
.word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */
|
||||
.word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */
|
||||
.word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */
|
||||
.word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */
|
||||
.word TIM8_CC_IRQHandler /* TIM8 Capture Compare */
|
||||
.word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */
|
||||
.word FSMC_IRQHandler /* FSMC */
|
||||
.word SDIO_IRQHandler /* SDIO */
|
||||
.word TIM5_IRQHandler /* TIM5 */
|
||||
.word SPI3_IRQHandler /* SPI3 */
|
||||
.word UART4_IRQHandler /* UART4 */
|
||||
.word UART5_IRQHandler /* UART5 */
|
||||
.word TIM6_DAC_IRQHandler /* TIM6, DAC1 and DAC2 */
|
||||
.word TIM7_IRQHandler /* TIM7 */
|
||||
.word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */
|
||||
.word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */
|
||||
.word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */
|
||||
.word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */
|
||||
.word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */
|
||||
.word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter0 */
|
||||
.word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter1 */
|
||||
.word CAN2_TX_IRQHandler /* CAN2 TX */
|
||||
.word CAN2_RX0_IRQHandler /* CAN2 RX0 */
|
||||
.word CAN2_RX1_IRQHandler /* CAN2 RX1 */
|
||||
.word CAN2_SCE_IRQHandler /* CAN2 SCE */
|
||||
.word OTG_FS_IRQHandler /* USB OTG FS */
|
||||
.word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */
|
||||
.word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */
|
||||
.word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */
|
||||
.word USART6_IRQHandler /* USART6 */
|
||||
.word I2C3_EV_IRQHandler /* I2C3 event */
|
||||
.word I2C3_ER_IRQHandler /* I2C3 error */
|
||||
.word CAN3_TX_IRQHandler /* CAN3 TX */
|
||||
.word CAN3_RX0_IRQHandler /* CAN3 RX0 */
|
||||
.word CAN3_RX1_IRQHandler /* CAN3 RX1 */
|
||||
.word CAN3_SCE_IRQHandler /* CAN3 SCE */
|
||||
.word 0 /* Reserved */
|
||||
.word 0 /* Reserved */
|
||||
.word RNG_IRQHandler /* RNG */
|
||||
.word FPU_IRQHandler /* FPU */
|
||||
.word UART7_IRQHandler /* UART7 */
|
||||
.word UART8_IRQHandler /* UART8 */
|
||||
.word SPI4_IRQHandler /* SPI4 */
|
||||
.word SPI5_IRQHandler /* SPI5 */
|
||||
.word 0 /* Reserved */
|
||||
.word SAI1_IRQHandler /* SAI1 */
|
||||
.word UART9_IRQHandler /* UART9 */
|
||||
.word UART10_IRQHandler /* UART10 */
|
||||
.word 0 /* Reserved */
|
||||
.word 0 /* Reserved */
|
||||
.word QUADSPI_IRQHandler /* QuadSPI */
|
||||
.word 0 /* Reserved */
|
||||
.word 0 /* Reserved */
|
||||
.word FMPI2C1_EV_IRQHandler /* FMPI2C1 Event */
|
||||
.word FMPI2C1_ER_IRQHandler /* FMPI2C1 Error */
|
||||
.word LPTIM1_IRQHandler /* LPTIM1 */
|
||||
.word DFSDM2_FLT0_IRQHandler /* DFSDM2 Filter0 */
|
||||
.word DFSDM2_FLT1_IRQHandler /* DFSDM2 Filter1 */
|
||||
.word DFSDM2_FLT2_IRQHandler /* DFSDM2 Filter2 */
|
||||
.word DFSDM2_FLT3_IRQHandler /* DFSDM2 Filter3 */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||
* As they are weak aliases, any function with the same name will override
|
||||
* this definition.
|
||||
*
|
||||
*******************************************************************************/
|
||||
.weak NMI_Handler
|
||||
.thumb_set NMI_Handler,Default_Handler
|
||||
|
||||
.weak HardFault_Handler
|
||||
.thumb_set HardFault_Handler,Default_Handler
|
||||
|
||||
.weak MemManage_Handler
|
||||
.thumb_set MemManage_Handler,Default_Handler
|
||||
|
||||
.weak BusFault_Handler
|
||||
.thumb_set BusFault_Handler,Default_Handler
|
||||
|
||||
.weak UsageFault_Handler
|
||||
.thumb_set UsageFault_Handler,Default_Handler
|
||||
|
||||
.weak SVC_Handler
|
||||
.thumb_set SVC_Handler,Default_Handler
|
||||
|
||||
.weak DebugMon_Handler
|
||||
.thumb_set DebugMon_Handler,Default_Handler
|
||||
|
||||
.weak PendSV_Handler
|
||||
.thumb_set PendSV_Handler,Default_Handler
|
||||
|
||||
.weak SysTick_Handler
|
||||
.thumb_set SysTick_Handler,Default_Handler
|
||||
|
||||
.weak WWDG_IRQHandler
|
||||
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||
|
||||
.weak PVD_IRQHandler
|
||||
.thumb_set PVD_IRQHandler,Default_Handler
|
||||
|
||||
.weak TAMP_STAMP_IRQHandler
|
||||
.thumb_set TAMP_STAMP_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_WKUP_IRQHandler
|
||||
.thumb_set RTC_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak FLASH_IRQHandler
|
||||
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||
|
||||
.weak RCC_IRQHandler
|
||||
.thumb_set RCC_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI0_IRQHandler
|
||||
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI1_IRQHandler
|
||||
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI2_IRQHandler
|
||||
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI3_IRQHandler
|
||||
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI4_IRQHandler
|
||||
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream0_IRQHandler
|
||||
.thumb_set DMA1_Stream0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream1_IRQHandler
|
||||
.thumb_set DMA1_Stream1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream2_IRQHandler
|
||||
.thumb_set DMA1_Stream2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream3_IRQHandler
|
||||
.thumb_set DMA1_Stream3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream4_IRQHandler
|
||||
.thumb_set DMA1_Stream4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream5_IRQHandler
|
||||
.thumb_set DMA1_Stream5_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream6_IRQHandler
|
||||
.thumb_set DMA1_Stream6_IRQHandler,Default_Handler
|
||||
|
||||
.weak ADC_IRQHandler
|
||||
.thumb_set ADC_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_TX_IRQHandler
|
||||
.thumb_set CAN1_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_RX0_IRQHandler
|
||||
.thumb_set CAN1_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_RX1_IRQHandler
|
||||
.thumb_set CAN1_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_SCE_IRQHandler
|
||||
.thumb_set CAN1_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI9_5_IRQHandler
|
||||
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_BRK_TIM9_IRQHandler
|
||||
.thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_UP_TIM10_IRQHandler
|
||||
.thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_TRG_COM_TIM11_IRQHandler
|
||||
.thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_CC_IRQHandler
|
||||
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM2_IRQHandler
|
||||
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM3_IRQHandler
|
||||
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM4_IRQHandler
|
||||
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_EV_IRQHandler
|
||||
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_ER_IRQHandler
|
||||
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_EV_IRQHandler
|
||||
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_ER_IRQHandler
|
||||
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI1_IRQHandler
|
||||
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI2_IRQHandler
|
||||
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART1_IRQHandler
|
||||
.thumb_set USART1_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART2_IRQHandler
|
||||
.thumb_set USART2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART3_IRQHandler
|
||||
.thumb_set USART3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI15_10_IRQHandler
|
||||
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_Alarm_IRQHandler
|
||||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_FS_WKUP_IRQHandler
|
||||
.thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_BRK_TIM12_IRQHandler
|
||||
.thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_UP_TIM13_IRQHandler
|
||||
.thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_TRG_COM_TIM14_IRQHandler
|
||||
.thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_CC_IRQHandler
|
||||
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream7_IRQHandler
|
||||
.thumb_set DMA1_Stream7_IRQHandler,Default_Handler
|
||||
|
||||
.weak FSMC_IRQHandler
|
||||
.thumb_set FSMC_IRQHandler,Default_Handler
|
||||
|
||||
.weak SDIO_IRQHandler
|
||||
.thumb_set SDIO_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM5_IRQHandler
|
||||
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI3_IRQHandler
|
||||
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART4_IRQHandler
|
||||
.thumb_set UART4_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART5_IRQHandler
|
||||
.thumb_set UART5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM6_DAC_IRQHandler
|
||||
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM7_IRQHandler
|
||||
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream0_IRQHandler
|
||||
.thumb_set DMA2_Stream0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream1_IRQHandler
|
||||
.thumb_set DMA2_Stream1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream2_IRQHandler
|
||||
.thumb_set DMA2_Stream2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream3_IRQHandler
|
||||
.thumb_set DMA2_Stream3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream4_IRQHandler
|
||||
.thumb_set DMA2_Stream4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DFSDM1_FLT0_IRQHandler
|
||||
.thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DFSDM1_FLT1_IRQHandler
|
||||
.thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_TX_IRQHandler
|
||||
.thumb_set CAN2_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_RX0_IRQHandler
|
||||
.thumb_set CAN2_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_RX1_IRQHandler
|
||||
.thumb_set CAN2_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_SCE_IRQHandler
|
||||
.thumb_set CAN2_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_FS_IRQHandler
|
||||
.thumb_set OTG_FS_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream5_IRQHandler
|
||||
.thumb_set DMA2_Stream5_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream6_IRQHandler
|
||||
.thumb_set DMA2_Stream6_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream7_IRQHandler
|
||||
.thumb_set DMA2_Stream7_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART6_IRQHandler
|
||||
.thumb_set USART6_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C3_EV_IRQHandler
|
||||
.thumb_set I2C3_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C3_ER_IRQHandler
|
||||
.thumb_set I2C3_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN3_TX_IRQHandler
|
||||
.thumb_set CAN3_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN3_RX0_IRQHandler
|
||||
.thumb_set CAN3_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN3_RX1_IRQHandler
|
||||
.thumb_set CAN3_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN3_SCE_IRQHandler
|
||||
.thumb_set CAN3_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak RNG_IRQHandler
|
||||
.thumb_set RNG_IRQHandler,Default_Handler
|
||||
|
||||
.weak FPU_IRQHandler
|
||||
.thumb_set FPU_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART7_IRQHandler
|
||||
.thumb_set UART7_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART8_IRQHandler
|
||||
.thumb_set UART8_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI4_IRQHandler
|
||||
.thumb_set SPI4_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI5_IRQHandler
|
||||
.thumb_set SPI5_IRQHandler,Default_Handler
|
||||
|
||||
.weak SAI1_IRQHandler
|
||||
.thumb_set SAI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART9_IRQHandler
|
||||
.thumb_set UART9_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART10_IRQHandler
|
||||
.thumb_set UART10_IRQHandler,Default_Handler
|
||||
|
||||
.weak QUADSPI_IRQHandler
|
||||
.thumb_set QUADSPI_IRQHandler,Default_Handler
|
||||
|
||||
.weak FMPI2C1_EV_IRQHandler
|
||||
.thumb_set FMPI2C1_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak FMPI2C1_ER_IRQHandler
|
||||
.thumb_set FMPI2C1_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak LPTIM1_IRQHandler
|
||||
.thumb_set LPTIM1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DFSDM2_FLT0_IRQHandler
|
||||
.thumb_set DFSDM2_FLT0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DFSDM2_FLT1_IRQHandler
|
||||
.thumb_set DFSDM2_FLT1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DFSDM2_FLT2_IRQHandler
|
||||
.thumb_set DFSDM2_FLT2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DFSDM2_FLT3_IRQHandler
|
||||
.thumb_set DFSDM2_FLT3_IRQHandler,Default_Handler
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
**
|
||||
** @file : LinkerScript.ld
|
||||
**
|
||||
** @brief : Linker script for STM32F413VGTx Device from STM32F4 series
|
||||
** 1024Kbytes FLASH
|
||||
** 320Kbytes RAM
|
||||
**
|
||||
** Set heap size, stack size and stack location according
|
||||
** to application requirements.
|
||||
**
|
||||
** Set memory bank area and size if external memory is used
|
||||
**
|
||||
** Target : STMicroelectronics STM32
|
||||
**
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Entry Point */
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
|
||||
_heap_end = 0x20050000; /* end of 320K SRAM */
|
||||
|
||||
_Min_Heap_Size = 0 ; /* required amount of heap */
|
||||
_Min_Stack_Size = 0x400 ; /* required amount of stack */
|
||||
|
||||
_Main_Stack_Size = 1024; /* required amount of stack for interrupt stack (Main stack) */
|
||||
|
||||
/* Main stack end */
|
||||
_main_stack_start = _estack - _Main_Stack_Size;
|
||||
|
||||
/* Memories definition */
|
||||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
|
||||
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
|
||||
}
|
||||
|
||||
/* Sections */
|
||||
SECTIONS
|
||||
{
|
||||
/* The program code and other data into "FLASH" Rom type memory */
|
||||
.text :
|
||||
{
|
||||
FILL(0xFFFF)
|
||||
|
||||
CREATE_OBJECT_SYMBOLS
|
||||
|
||||
KEEP(*(.bootloader)) /* Bootloader code */
|
||||
|
||||
. = 0x8000; /* Set the start of the main program */
|
||||
_stext = .; /* Provide the name for the start of this section */
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
KEEP(*(.fwversiondata))
|
||||
*(.text) /* .text sections (code) */
|
||||
*(.text*) /* .text* sections (code) */
|
||||
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||
*(.glue_7) /* glue arm to thumb code */
|
||||
*(.glue_7t) /* glue thumb to arm code */
|
||||
*(.eh_frame)
|
||||
*(.data.__global_locale)
|
||||
|
||||
KEEP (*(.init))
|
||||
KEEP (*(.fini))
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .; /* define a global symbols at end of code */
|
||||
} >FLASH
|
||||
|
||||
.ARM.extab : {
|
||||
. = ALIGN(4);
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
.ARM : {
|
||||
. = ALIGN(4);
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
.preinit_array :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array*))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
.init_array :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
.fini_array :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array*))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
/* Used by the startup to initialize data */
|
||||
_sidata = LOADADDR(.data);
|
||||
|
||||
/* Initialized data sections into "RAM" Ram type memory */
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sdata = .; /* create a global symbol at data start */
|
||||
*(.data) /* .data sections */
|
||||
*(.data*) /* .data* sections */
|
||||
*(.RamFunc) /* .RamFunc sections */
|
||||
*(.RamFunc*) /* .RamFunc* sections */
|
||||
|
||||
. = ALIGN(4);
|
||||
_edata = .; /* define a global symbol at data end */
|
||||
|
||||
} >RAM AT> FLASH
|
||||
|
||||
/* Uninitialized data section into "RAM" Ram type memory */
|
||||
. = ALIGN(4);
|
||||
.bss :
|
||||
{
|
||||
/* This is used by the startup in order to initialize the .bss section */
|
||||
_sbss = .; /* define a global symbol at bss start */
|
||||
__bss_start__ = _sbss;
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
_ebss = .; /* define a global symbol at bss end */
|
||||
__bss_end__ = _ebss;
|
||||
} >RAM
|
||||
|
||||
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
|
||||
._user_heap_stack :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
PROVIDE ( end = . );
|
||||
PROVIDE ( _end = . );
|
||||
. = . + _Min_Heap_Size;
|
||||
. = . + _Min_Stack_Size;
|
||||
. = ALIGN(8);
|
||||
} >RAM
|
||||
|
||||
/* Remove information from the compiler libraries */
|
||||
/DISCARD/ :
|
||||
{
|
||||
libc.a ( * )
|
||||
libm.a ( * )
|
||||
libgcc.a ( * )
|
||||
}
|
||||
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
}
|
||||
Reference in New Issue
Block a user