mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-21 02:03:18 +00:00
68a3f6b4b7
* Add F5 target, lp5562 driver and api-hal-light. Update api-usage, switch to F5 by default. * API HAL: add i2c and hardware version api. Dolphin: show hardware version. * OTP version generator and flashing utility. * Assets script: fix code formatting * Backport F5 changes to F4 * F4: disable insomnia, prevent damage to BLE RX path * F5 HAL API Light: remove magic delay to fix magic BLE * Dolphin: HW target validation on start * invert RSSI indication in sub-1 * API HAL: rename board to body in version api * Gpio tester: detach and release viewport on exit Co-authored-by: aanper <mail@s3f.ru>
36 lines
No EOL
1,001 B
C
36 lines
No EOL
1,001 B
C
#include "api-hal/api-interrupt-mgr.h"
|
|
#include <main.h>
|
|
|
|
extern void api_interrupt_call(InterruptType type, void* hw);
|
|
|
|
/* interrupts */
|
|
|
|
/* Comparator trigger event */
|
|
void HAL_COMP_TriggerCallback(COMP_HandleTypeDef* hcomp) {
|
|
api_interrupt_call(InterruptTypeComparatorTrigger, hcomp);
|
|
}
|
|
|
|
/* Timer input capture event */
|
|
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef* htim) {
|
|
api_interrupt_call(InterruptTypeTimerCapture, htim);
|
|
}
|
|
|
|
/* Output compare event */
|
|
void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef* htim) {
|
|
api_interrupt_call(InterruptTypeTimerOutputCompare, htim);
|
|
}
|
|
|
|
/* Timer update event */
|
|
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim) {
|
|
api_interrupt_call(InterruptTypeTimerUpdate, htim);
|
|
|
|
// handle HAL ticks
|
|
if(htim->Instance == TIM17) {
|
|
HAL_IncTick();
|
|
}
|
|
}
|
|
|
|
/* External interrupt event */
|
|
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
|
api_interrupt_call(InterruptTypeExternalInterrupt, (void*)(uint32_t)GPIO_Pin);
|
|
} |