1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 11:59:58 +03:00
Commit graph

51 commits

Author SHA1 Message Date
Steve Evans
87c8847c13 New SPI API supporting DMA
Call targetConfiguration() once before config is loaded and again afterwards in case the config needs to be changed to load from SD card etc

Drop SPI clock during binding

Remove debug

Add per device SPI DMA enable

Fix sdioPinConfigure() declaration warning

Reduce clock speed during SPI RX initialisation
2021-07-25 12:40:25 +12:00
Dominic Clifton
e0f2b89828 Indicate failure when CONFIG_IN_SDCARD is used and no SD card is
inserted.
2021-05-08 14:20:29 +02:00
jflyper
65e8a0dce7 G4 system files update 2020-10-02 17:15:31 +09:00
jflyper
e4d7c4e152 [G4][SYSTEM] Basic & build files 2020-09-30 18:20:05 +09:00
mikeller
cd27b63b89 Exclude SWD pins from being initialised as pull up if unused. 2020-01-28 10:52:21 +13:00
Michael Keller
ff04f0d37e
Merge pull request #9406 from jflyper/bfdev-g4-persistent
[G4] Persistent object support
2020-01-25 20:04:36 +13:00
jflyper
49cf92f5e6 [G4] Persistent object support 2020-01-23 15:00:34 +09:00
jflyper
a88d5470eb Add unused pin state traverse and initialization facility 2020-01-21 12:18:43 +09:00
Dominic Clifton
d016aa2fc4 DSHOT - Use cycle counting instead of recording timestamp in dshot motor_DMA_IRQHandler.
It turns out that two calls to micros() and the calculation of
directionChangeDurationUs took 581 cycles, vs 396 cycles without the
calls to micros() and deferred calculation of the duration which is only
needed in the CLI.

This brings the time down from around 7 microseconds to 5.5 microseconds
on an F3 at 72Mhz.

This makes the difference between 100% invalid telemetry and 4% invalid
telemetry on the first motor on the F3.

Squashed commits:
* Remove the forward declaration for `pwmDshotSetDirectionInput` and make
it static.
* Remove unneeded forward declaration of `motor_DMA_IRQHandler`.
* Remove duplication in DMA IRQ Handler.
  Doesn't affect resulting code but improves readability.
* Use an inline function to read DWT->CYCCNT.
* Remove unneeded forward declarations from cli.c now that the correct
header is included.
* Update DWT unlock method.
2019-08-29 20:01:20 +02:00
AJ Christensen
45e8d74255 Fix BOATLOADER_ defines typo
* Missed in review, sorry!
* A-oooga I'm a boat
2019-06-25 07:30:50 +12:00
mikeller
5cf42f40b6 Add booting into the flash boot loader as an option. 2019-06-16 14:46:38 +12: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
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
jflyper
85cd4df2ea Refactor / rename PERSISTENT_OBJECT_BOOTLOADER_REQUEST to PERSISTENT_OBJECT_RESET_REASON 2019-02-04 19:06:19 +09:00
Bruce Luckcuck
065ce24d4d Change MSC boot mode to use persistence layer and unify with bootloader
Replaced the existing `PERSISTENT_OBJECT_BOOTLOADER_REQUEST` that was bootloader specific, with `PERSISTENT_OBJECT_BOOTMODE_REQUEST` that can be shared by any required boot mode based on it's contents. Currently supports bootloader and MSC, but is extensible for additional future needs. The previous hardcoded memory address usage for MSC boot was removed.
2019-01-13 19:45:22 -05:00
jflyper
14bbc3ac07 Code cleanup, remove old code and debug artifacts 2018-12-04 23:03:44 +09:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
Andrey Mironov
aede46288b Reworked reboot flags for F4 partially (#5193) 2018-04-04 01:08:36 +12:00
mikeller
655c5fabc9 Improved arming disabled reason beeps. 2018-01-13 18:08:06 +13:00
mikeller
67acc6c7ec Added beeps to indicate the reason for arming being disabled. 2017-07-04 01:38:04 +12:00
jflyper
2c7970a9ed Revive visual indication of gyro detection failure 2017-06-30 14:33:35 +09:00
Martin Budden
23f158913e Moved time functions out of system.h into time.h 2017-05-26 14:03:28 +01:00
Martin Budden
1c08319ef9 Updates as per iNav 2017-01-31 14:20:26 +01:00
borisbstyle
e289f354a6 Merge pull request #1264 from jflyper/fix-micros-final
Fix micros using COUNTFLAG
2016-10-09 00:52:44 +02:00
jflyper
59e78fcd8e Fix micros using COUNTFLAG
Current micros() may return past time when called from ISR or elevated BASEPRI context. This is because a call to the SysTick interrupt handler sysTick_Hanlder(), which is responsible for 1ms rollover is blocked in these contexts.

This PR introduces microsISR() that is guranteed to return correct time in these contexts. Legacy micros() was also modified to call microISR() in these contexts.

The microISR() uses SysTick's COUNTFLAG to detect a pending rollover and use it to compensate the return value on its own. Actual rollover to sysTickUptime variable is still handled in the sysTick_Hanlder().
2016-10-04 01:45:23 +09:00
Martin Budden
4d03791cbc Removed unused EXTI_CALLBACK_HANDLER_COUNT 2016-09-13 23:16:05 +01:00
Martin Budden
1c997abaaf Moved function declarations out of main. Tidied drivers. 2016-08-02 15:11:35 +01:00
blckmn
72a6e701eb Fixed build issue for F1, and added dfu CLI command (for restart in DFU mode) 2016-07-03 07:44:35 +10:00
Martin Budden
97fe5afd6c Converted tabs to spaces. 2016-06-27 19:26:02 +01:00
blckmn
d20597997b Missed EXTI_CALLBACK_HANDLER_COUNT (not defined in F4 targets) 2016-06-10 18:53:13 +10:00
blckmn
948f2c6362 Removing some more target / platform specific code out of main.c and simplifying initialisation of system 2016-06-10 18:42:16 +10:00
blckmn
928609e2bb Moving EXTI to new io
Updated i2c to use new io
2016-06-03 20:21:10 +10:00
Dominic Clifton
4da387e93d More cleanup of MPU driver code. Support MPU INT on CC3D and Naze32
Rev6.

MPU6050 Correction From merge
2015-10-16 10:40:54 +02:00
Dominic Clifton
678c0413cb Relocate and use some of the common MPU code from MPU6000 into
accgyro_mpu.c.
2015-10-02 15:43:44 +01:00
Dominic Clifton
a9c775b03d Delete unused FAILURE_MODE_COUNT value. 2015-09-18 20:33:17 +01:00
Dominic Clifton
c6f5b98a79 Improve failure LED status flashing. Now users can identify and report
hardware failures by counting the number of long flashes.

Fix up sensor read API so that code that uses sensors can detect
malfunctions.

If a failure mode occurs in a debug mode the code reboots the system
rather than rebooting to the bootloader.
2015-09-12 01:33:19 +01:00
Konstantin Sharlaimov
bd6297f0cc Switch to cleaner way of detecting a soft-reset on STM32F103 based targets using RCC->CSR register. 2015-06-26 21:55:46 +01:00
Dominic Clifton
6d5b44df7a Fix boot failure on Flip32+ Deluxe Acro.
The problem was the MPU6050 EXTI handler was not registered due to baro
detection taking the only callback handler slot.  When the MPU6050 EXTI
was configured the interrupt flag was never cleared which results in the
CPU being starved.
2015-04-16 20:26:20 +01:00
Dominic Clifton
c11c25514b SPRACING32/NAZE32 - Add support for MPU6050 data ready interrupt.
Currently the interrupt handler is unused.  Later it can be used as a
potential source for watchdog checking or to syncronize the system
around new acc/gyro data availability.

Verified on Naze32 rev 3/4/5 and SPRacingF3 targets.
2015-04-11 19:18:11 +01:00
Michael Jakob
1be3e8e550 Added detection of soft reset and swich of bind mode
after first hard reset (power on) if hardware bind plug is not
configured. Now completly tested.
2014-12-17 23:15:32 +00:00
Kyle Manna
c806046181 perms: Remove execute bit on source files
* Remove the execute bit on source files.
* No functional change.
2014-11-26 10:13:29 -06:00
Dominic Clifton
6f3aa6fb86 Add extra MSP commands to allow settings to be made via a GUI in
addition to setting via the CLI.

Note: MSP_CONFIG from baseflight
bc68d89983d762d35cc1cf5e3fa0c2cf03287b70 will not be supported because
more specific commands exist in cleanflight.

MSP_MISC and MSP_CONFIG are good examples of single responsibility
violations.
2014-10-17 01:33:47 +01:00
Dominic Clifton
8ef70abaa0 NAZE32 - Add hardware revision detection. 2014-10-15 20:59:06 +01:00
Dominic Clifton
d60183d91d Normalize all the line endings 2014-09-15 23:40:17 +01:00
Dominic Clifton
e867af8c4b Correct project name in GPL notices. 2014-06-05 00:47:47 +01:00
Dominic Clifton
0bbcd6570f Updated source files to include the GPL v3 notices. Include a copy of
the GPL v3.
2014-06-04 16:48:23 +01:00
Dominic Clifton
32622da0ab Continuation of extracting peripheral configuration into drivers. 2014-06-04 14:53:34 +01:00