1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 21:35:44 +03:00
Commit graph

116 commits

Author SHA1 Message Date
Bruce Luckcuck
e4c357a02b Prevent calls to presistent object functions for unsupported MCU
Fixes for #8619
2019-07-30 10:00:58 -04:00
jflyper
b33c671e3d Clear reset reason also upon button initiated EEPROM reset 2019-07-28 22:56:39 +09:00
jflyper
542146c702 Motor code refactor (Phase 1) 2019-07-17 01:33:39 +09:00
mikeller
da93c07432 Refactored SD card initialisation to contain SD card detection initialisation. 2019-07-14 17:09:35 +12:00
Dominic Clifton
8d78e15a4b Fix use of sdcard.cardDetectPin before it is initialised.
* de-duplicate some SDIO/SPI sd-card detection code.
* ensure detectionInverted is set to false for SDIO case where
`cardDetectTag` is not configured.
2019-07-10 17:09:03 +02:00
Michael Keller
6130dc3b9e
Move motorConfig_s and motorDevConfig_s to pg/motor (#8498)
Move motorConfig_s and motorDevConfig_s to pg/motor
2019-06-30 12:59:31 +12:00
jflyper
0e63596abd Move motorConfig_s, motorDevConfig_s and associated PG handling into pg/motor.[ch] 2019-06-29 20:03:54 +09:00
Dominic Clifton
9054cd45bf Move HAL_Init call for F3/F4/F7/H7.
* HAL_Delay() was being used before HAL_Init() was called.
* Brings it in-line with ST examples which follow this call order:
CubeMX generated code goes startup_xxx.s (asm) -> SystemInit(), then
main(), HAL_Init(), SystemClock_Config()

Boot-tested on:
* SPRacingF4NEO
* SPRacingF7DUAL
* SPRacingH7ZERO
2019-06-28 12:33:54 +02:00
Michael Keller
01788322b6
Merge pull request #8462 from mikeller/fix_stats_dispatch
Fixed dispatch initialisation for persistent statistics.
2019-06-25 02:17:31 +12:00
functionpointer
7cb34205b3 [VTX] vtxTable factory flag and full integration of vtxTable (#8380)
Moved vtxtable frequency mode implementation into `vtx_common.c`.
This makes the implementation available for all vtx types and allows
for some code deduplication (see point below)

Removed band and channel tracking from tramp and rtc6705.
The hardware underlying both only support frequency mode and
the tracking is now done in `vtx_common.c` using the new factory flag.

Deleted vtxStringXXX. to continue supporting builds without
`USE_VTX_TABLE`, new infrastructure was created in
`drivers/vtx_table.c`, which loads fixed tables into vtxTableXXX
when built witout `USE_VTX_TABLE`. Individual vtx implementations no
longer need to load any band/channel tables. They only need to load
their individual power tables when built without `USE_VTX_TABLE`.
Additionally this allows for the next point:

Fully integrated vtxTableXXX and removed the old and no longer needed
indirection of frequency and power tables in `vtxDevice_t`.

Removed VTX_SETTINGS_* constants from `vtx_common.h` and replaced them
with the vtxtable equivalent.

rtc6705 implementation now uses power values from vtxtable instead of
using indices directly. It also stops using index 0. This makes it
consistent with other vtx implementations and is more user configurable.
It also cleans up `telemetry\srxl.c` which had to have a special case for rtc6705.

Finally, frequency entries in the vtxtable can now be marked as empty
by setting their frequency to 0. Betaflight will never allow a blocked
channel to be selected. This is useful for vtxtable index mode
(FACTORY flag set) where manufacturer-defined bands can be truncated
to ensure compliance with local laws and regulations.
2019-06-24 12:28:46 +02:00
mikeller
c6c4c3adf9 Fixed dispatch initialisation for persistent statistics. 2019-06-23 19:56:45 +12:00
Steffen Windoffer
41875af760 remove dead i2c overclock code 2019-06-18 16:47:16 +02:00
Dominic Clifton
9c274240d8 Allow SDCARD to be used for config/eeprom storage.
* On boot SPI or SDIO is initialised.
* Filesystem is initialised (including creation of blackbox freespace
file)
* Empty config file is created if it doesn't exist, or read if it does.
* If config is invalid/empty then config file is written to, then read
back and verified.

Enable as follows.

target.h:

target.c:
uint8_t eepromData[EEPROM_SIZE];

Changes:
- Replace boolean init flags with single initFlags variables.
- Avoid unused variable warnings.
2019-06-14 07:58:33 +12:00
Dominic Clifton
45f8168b60 Prevent the system from booting when EEPROM_IN_FLASH is used and the
flash chip is not detected.

This will ensure that the flash config partition will always be present
when requested.
2019-06-13 09:16:29 +02:00
Dominic Clifton
cf1ce1a67b Support load/save configuration to external flash
Fixes to 6a3e7d8e6 as the flash partition code had changed during
the merge to master.
2019-06-13 09:16:29 +02:00
Dominic Clifton
92999681e3 Add flash partitioning system 2019-05-18 21:39:08 +09:00
Dominic Clifton
0dc47f21e9 Prevent flashfs from initializing in absence of a flash device 2019-05-12 22:01:34 +09:00
Michael Keller
a8e9dd94e8
[FLASH] Allow flash initialisation without flashfs support. (#8238)
[FLASH] Allow flash initialisation without flashfs support.
2019-05-11 23:42:21 +12:00
Michael Keller
3054780cee
[H7] Enable SDCard/SDIO using HAL driver (#8227)
[H7] Enable SDCard/SDIO using HAL driver
2019-05-11 23:37:08 +12:00
Michael Keller
ce5411f851
[H7] Enable SPI with resurrected HAL-based driver from v3.1.7 (#8199)
[H7] Enable SPI with resurrected HAL-based driver from v3.1.7
2019-05-11 23:36:27 +12:00
Dominic Clifton
8b131090c0 [H7] - QuadSPI support
- Initial cut

- QuadSPI - Update before flash w25n01g driver QSPI change

- QuadSPI add missing resource names.

- Config and setup code for QSPI bank 2 (doesn't work yet)

- QSPI Support BK2 only using CS pin via software

- Fix inclusion of platform.h

- Fixes per PR comment
2019-05-11 01:59:43 +09:00
jflyper
82c978a828 [H7] Enable SPI with resurrected HAL-based driver from v3.1.7 2019-05-10 10:53:12 +09:00
jflyper
ffb9497d8a [H7] Enable SDCard/SDIO using HAL driver 2019-05-09 21:01:59 +09:00
Dominic Clifton
3b8ce12ffe Allow flash initialisation without flashfs support.
There are reasons to enable flash hardware support other than just
flashfs.  e.g. config storage, debugging, etc.
2019-05-09 14:21:47 +09:00
Michael Keller
011aeb66a6
Moved 'rpm_filter' into 'flight'. (#8186)
Moved 'rpm_filter' into 'flight'.
2019-05-07 00:40:48 +12:00
Michael Keller
d9382ad012
Add new basic feature conditionals (#8175)
Add new basic feature conditionals
2019-05-06 19:07:11 +12:00
Michael Keller
d259831cca
Allow EEPROM reset without power cycling in DEBUG build (#8174)
Allow EEPROM reset without power cycling in DEBUG build
2019-05-06 19:06:54 +12:00
Dominic Clifton
8e5c1dd7a3 RTC6705 resource cleanup. 2019-05-06 01:23:43 +02:00
mikeller
5141bbfa94 Moved 'rpm_filter' into 'flight'. 2019-05-06 00:10:31 +12:00
jflyper
cf219cd8a6 Add and handle USE_TIMER 2019-05-05 19:42:52 +09:00
jflyper
45b7fa8095 Add and handle USE_PWM_OUTPUT 2019-05-05 18:05:13 +09:00
jflyper
7df2828053 Allow EEPROM reset without power cycling in DEBUG build 2019-05-05 15:11:11 +09:00
Thorsten Laux
f1e9c9f19a invert csum in telemetry 2019-05-02 14:18:19 +02:00
Michael Keller
65603e49a2
Merge pull request #7621 from betaflight/bf-allow-compilation-with-no-serial-ports
Allow compilation of the printf code when no serial ports are used.
2019-04-14 21:31:31 +12:00
Michael Keller
5a67eb8c1e
Merge pull request #7626 from hydra/bf-move-memory-section-initialisation
Move memory section initialisation earlier into the init sequence.
2019-04-14 21:26:34 +12:00
Bruce Luckcuck
81c226e769 Periodically try to activate DSHOT telemetry if enabled but not working
If DSHOT telemetry is enabled but one or more ESC's are not supplying valid telemetry packets, then send the DSHOT command to enable telemetry once a second while disarmed until all ESC's are supplying telemetry.

Addresses the issue of the flight controller booting without the ESC's powered. In this case the initial command at boot to enable bidirectional telemetry will be missed by the ESC since they're not powered. If the battery is subsequently plugged in the ESC's will default to bidirectional telemetry disabled.

This change will detect that ESC's are not supplying telemetry and attempt to preiodically enable them.
2019-03-17 17:45:08 -04:00
Hans Christian Olaussen
3597e899c9 Move enabling of caches for F7
Moves cache enabling from SystemInit() to init() as it is not recommended to enable caches before entering main function.
2019-03-10 20:11:26 +01:00
Dominic Clifton
672c906067 Extract serial-related code from printf.c 2019-03-06 11:15:32 +01:00
Dominic Clifton
91d6a1cc8d Move memory section initialisation earlier into the init sequence.
Allows startup-code/libs/etc to be moved into different memory regions.
2019-03-06 10:32:04 +01:00
mikeller
acf759b82e Fixed detection of brushless / brushed motors. 2019-03-03 13:01:04 +13:00
Bruce Luckcuck
30672a37c5 Refactor OSD element display code
Remove the giant `select` block that contained all the code to generate the elements and transition them to individual functions called only when the element is active. Simplifies the code and results in a performance improvement as it's not necessary to fall through the large `select` statement for every element that will be drawn. The individual functions and the element to function mapping are moved to a new `osd_elements.c` file.

Moved the OSD related code files to a new `osd/` directory.

Also pre-analyze the active elements and only process those that are active. This also saves processing as it's not necessary to loop through all 50 or so elements when only a couple are active.

Various other cleanup and removal of stale or unnecessary code.

In the default configuration the element drawing phase of the OSD task is reduced from ~51us to ~35us - resulting in about a 30% decrease in processing time.
2019-02-21 14:03:25 -05:00
mikeller
9f8cafbf8b Fixed initialisation problem with LED_STRIP. 2019-02-08 12:29:57 +13:00
jflyper
96fc6dc934 CLI parser for vtxtable 2019-02-06 15:24:02 +09:00
Michael Keller
7393d5fdac
Merge pull request #7529 from jflyper/bfdev-stronger-USE_ACC
[REFACTOR] More application of USE_ACC
2019-02-06 10:08:49 +13:00
mikeller
e121e1e92b Separated LED_STRIP parameter groups, separated out LED_STRIP status mode code. 2019-02-05 08:39:42 +13:00
jflyper
cc0e689bb5 Add USE_ACC conditionals 2019-02-04 20:37:43 +09:00
mikeller
210e90249e Fixed up reference in the driver layer. 2019-02-03 11:04:34 +13:00
mikeller
38e1ce04df Reorganised interfaces, putting them where they are used. 2019-01-27 13:38:22 +13:00
mikeller
18496fe745 Fixed unit tests using 'ledstrip.c'. 2019-01-21 01:01:05 +13:00
Michael Keller
7eedfff428
Merge pull request #7415 from jflyper/bfdev-change-call-timing-of-vtxInit-after-device-parameter-init
[VTX] Follow-up to #7285 vtx changes
2019-01-19 14:23:18 +13:00