1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00
Commit graph

54 commits

Author SHA1 Message Date
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
jflyper
80c1cfa6db Call vtxInit after device parameters are initialized 2019-01-18 01:20:35 +09:00
Bruce Luckcuck
4da9b75c8f Fix compilation errors if USE_BLACKBOX is not defined 2019-01-15 10:08:15 -05:00
Bruce Luckcuck
0ed1fbc609 Fix boot loop if mass storage mode init fails
The logic already performed a reboot if mass storage init failed, but it never reset the boot vector value so it continued to contain the `MSC_MAGIC` value leading to a boot loop.

Also fixed fixed the F7 version of `mscWaitForButton()` as it was using the F4 vector.
2019-01-12 18:23:03 -05:00
Thorsten Laux
7859e6d540 Add dshot command queue and limit max notch filter frequency 2019-01-12 12:25:30 +01:00
Thorsten Laux
8d4ed72e13 rpm telemetry based notch filter 2019-01-07 13:36:01 +01:00
Thorsten Laux
816da6cbf5 Dshot erpm telemetry on the signal line 2019-01-03 14:42:52 +01:00
Michael Keller
131e32c142
Merge pull request #7246 from mikeller/move_mco_init
Moved 'mcoInit()' to after 'OverclockRebootIfNecessary()' to have it execute only once.
2018-12-22 12:16:26 +13:00
mikeller
4a62a006ca Moved 'mcoInit()' to after 'OverclockRebootIfNecessary()' to have it execute only once. 2018-12-19 17:45:11 +13:00
jflyper
feab0bcb81 Speed up the first boot on generic firmware 2018-12-19 16:56:31 +13:00
Bruce Luckcuck
b8085b170e MSC on-board flash: Persist RTC across reboot and use as file timestamp
Adds support to persist the RTC (if set) across the reboot if entering mass storage mode for on-board flash. The value is then used as the timestamp for the files exposed in the virtual FAT32 filesystem. The files will then have reasonable creation dates when copied to the host computer.

If the RTC is not set (or supported), then the default timestamp of 2018-01-01 will be used (unchanged from previous).

Included some improvements to the RTC functions and exposed the `tz_offsetMinutes` in the `timeConfig` PG. Support already existed for timezone offsets but the parameter wasn't exposed to the user and couldn't be set.

Move timezone offset up a layer as a parameter to systemResetToMsc()
Adds support for specifying a custom timezone offset from both the CLI and MSP calls to enter mass storage mode.

Added an option timezone offset minutes to the CLI `msc` command. If no parameter is specified then the default as specified by `timezone_offset_minutes` will be used. So to reboot into mass storage mode and force the file timestamps to be in UTC, use `msc 0`.

Added reboot message `MSP_REBOOT_MSC_UTC` to support rebooting into mass storage mode and forcing the timestamps to use UTC time (0 offset). The Configurator will need to be modified to use this message for operating systems that expect UTC times for FAT file systems (like Linux).
2018-12-17 19:40:51 -05:00
jflyper
9ea1428d11 Introduce per device pin pre-init 2018-12-13 11:15:26 +09:00
mikeller
c8e484df94 Renamed USE_FLASH to USE_FLASH_CHIP for clarity. 2018-11-25 13:47:31 +13:00