diff options
author | DrZlo13 <who.just.the.doctor@gmail.com> | 2021-01-28 15:30:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 15:30:31 +0300 |
commit | cf1c8fb2239cea509a1b6b7c72302549b0b159f7 (patch) | |
tree | 19f08938fe6e03b296e09c88f179013479d88dac /applications/input | |
parent | a7951ade6943e0087f52d36b41395d6f96b6ee70 (diff) |
[FL-85][FL-446][FL-720] Dallas key blanks and OneWire lib rework (#313)
* 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
Diffstat (limited to 'applications/input')
-rw-r--r-- | applications/input/input.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/applications/input/input.c b/applications/input/input.c index 8b522d02..00e0f7b8 100644 --- a/applications/input/input.c +++ b/applications/input/input.c @@ -18,6 +18,8 @@ static InputState input_state = { false, }; +static void exti_input_callback(void* _pin, void* _ctx); + void input_task(void* p) { uint32_t state_bits = 0; uint8_t debounce_counters[INPUT_COUNT]; @@ -38,6 +40,8 @@ void input_task(void* p) { furi_record_create("input_state", &input_state_record); furi_record_create("input_events", &input_events_record); + api_interrupt_add(exti_input_callback, InterruptTypeExternalInterrupt, NULL); + // we ready to work initialized = true; @@ -103,7 +107,10 @@ void input_task(void* p) { } } -void HAL_GPIO_EXTI_Callback(uint16_t pin) { +static void exti_input_callback(void* _pin, void* _ctx) { + // interrupt manager get us pin constant, so... + uint32_t pin = (uint32_t)_pin; + #ifdef APP_NFC if(pin == NFC_IRQ_Pin) { nfc_isr(); @@ -121,4 +128,4 @@ void HAL_GPIO_EXTI_Callback(uint16_t pin) { if(!initialized) return; signal_event(&event); -} +}
\ No newline at end of file |