Skip to content

Commit

Permalink
stm32:exti: Add EXTI_TRIGGER_NONE and support it in exti_set_trigger
Browse files Browse the repository at this point in the history
Allow resetting/clearing exti triggers.
  • Loading branch information
Stelios Mavridis authored and Stelios Mavridis committed Apr 20, 2024
1 parent bb4c5d7 commit dbc7738
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/libopencm3/stm32/common/exti_common_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ enum exti_trigger_type {
EXTI_TRIGGER_RISING,
EXTI_TRIGGER_FALLING,
EXTI_TRIGGER_BOTH,
EXTI_TRIGGER_NONE,
};

BEGIN_DECLS
Expand Down
4 changes: 4 additions & 0 deletions lib/stm32/common/exti_common_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ void exti_set_trigger(uint32_t extis, enum exti_trigger_type trig)
EXTI_RTSR |= extis;
EXTI_FTSR |= extis;
break;
case EXTI_TRIGGER_NONE:
EXTI_RTSR &= ~extis;
EXTI_FTSR &= ~extis;
break;
}
}

Expand Down

0 comments on commit dbc7738

Please sign in to comment.