From 415b8c65ff282fadc6bb5629c301448a8259dc5c Mon Sep 17 00:00:00 2001 From: Rutherther Date: Thu, 19 Dec 2024 10:01:36 +0100 Subject: [PATCH] feat(arm07): add exti both edges interrupt function --- arm07/include/exti.h | 1 + arm07/src/exti.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arm07/include/exti.h b/arm07/include/exti.h index 31d9a44..4b7d7ad 100644 --- a/arm07/include/exti.h +++ b/arm07/include/exti.h @@ -24,6 +24,7 @@ void exti_external_interrupt(exti_t* exti, uint8_t gpio); // Only 21 positions are now supported. This is too hard for other ones. void exti_rising_interrupt(exti_t* exti); void exti_falling_interrupt(exti_t* exti); +void exti_both_edges_interrupt(exti_t *exti); void exti_disable_interrupt(exti_t* exti); void exti_enable_interrupt(exti_t *exti); diff --git a/arm07/src/exti.c b/arm07/src/exti.c index aa71083..09d8649 100644 --- a/arm07/src/exti.c +++ b/arm07/src/exti.c @@ -21,7 +21,11 @@ void exti_external_interrupt(exti_t *exti, uint8_t gpio) { void exti_rising_interrupt(exti_t *exti) { reg_write_bits_pos(&exti->exti->RTSR, 1, exti->line, 1); reg_write_bits_pos(&exti->exti->FTSR, 0, exti->line, 1); - reg_write_bits_pos(&exti->exti->IMR, 1, exti->line, 1); +} + +void exti_both_edges_interrupt(exti_t *exti) { + reg_write_bits_pos(&exti->exti->RTSR, 1, exti->line, 1); + reg_write_bits_pos(&exti->exti->FTSR, 1, exti->line, 1); } void exti_falling_interrupt(exti_t *exti) { -- 2.48.1