Skip to content

Commit

Permalink
Fix EXTI configuration setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeceStevens committed Oct 27, 2018
1 parent ff115fa commit ed4fbd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions f4/src/exti.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ pub enum EXTITrigger {
macro_rules! exti {
($exti_line:ident, $mr:ident, $tr:ident) => {
pub mod $exti_line {
use stm32f40x::EXTI;
use stm32f40x::{EXTI, SYSCFG};
use super::EXTITrigger;

pub fn configure(exti: &mut EXTI, trigger: EXTITrigger) {
pub fn configure(syscfg: &mut SYSCFG, exti: &mut EXTI, trigger: EXTITrigger) {
// TODO: Find correct GPIO bus to select with `bits`
syscfg.exticr4.modify( |_, w| unsafe { w.$exti_line().bits(0x00) });
exti.imr.modify(|_, w| w.$mr().set_bit());
match trigger {
EXTITrigger::Rising => {
Expand Down

0 comments on commit ed4fbd2

Please sign in to comment.