mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-21 10:13:10 +00:00
cf1c8fb223
* sepate one wire class * TM2004 writer * app mode write ds1990 * test another blanks protocol * new ibutton slave * one wire states * tim1 capture compare and update interrupts * interrupt mgr, new timers IRQ * discard HAL_TIM_PeriodElapsedCallback from main * add exti_14 line * add external interrupt callback * use int mgr in input * better interrupt managment * add interrupt callback enable and disable fns * properly init app * changed timings * rename one wire classes * use new owb classes * properly remove interrupts * new blanks writer * remove unused tests * new core includes * extern c guard * fix api_interrupt_remove usage * remove debug info, new way to detect blanks writing * remove copy constructor * change keys template * fix app sources recipe
36 lines
No EOL
984 B
C
36 lines
No EOL
984 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, GPIO_Pin);
|
|
} |