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().
Fixes the `Waiting for Data` problem in configurator when:
- Clicking on `Save and Reboot` button
- Clicking on `Flash Firmware` button
When the system reboots after programming the new firmware it still
needs a connect/disconnect cycle to work normal. This cannot be solved
since the bootloader is a fixed program in ROM.
Fix is for F1 targets and only tested on naze boards.
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.
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.
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.
- NVIC priorities are moved to separate file, all values are replaced wit symbolic names. Priorities should be the same.
- tiny change in DMA initialization
series development board.
These boards can be picked up for less than $11, coupled with a 10DOF
sensor board they make a great development platform or cheap expandable
FC.
Pretty much all pins are available to be used, unlike on the less
capable and more expensive OLIMEXINO.
Applied same to SOFT_I2C driver (but the pin config is compile-time #define)
Conflicts:
src/board.h
src/drv_i2c.h
src/drv_system.c
src/main/drivers/bus_i2c_soft.c
src/main/drivers/bus_i2c_stm32f10x.c