Skip to content

Changing trigger level in attach interrupt during runtime #199

Closed
@joverbee

Description

@joverbee

Current behaviour in Winterrupts.c assumes we perform attachinterrupt(pin,ISR,mode) only once after reset. However if you want to dynamically change the trigger mode, this leads to wrong behaviour:
e.g first starting with RISING and then FALLING leads actually to BOTH because the mode bits are ORed into the register.

I assume putting this in front of the switch(mode) in attachinterrupt solves the issue

EIC->CONFIG[config].reg &=~ (EIC_CONFIG_SENSE0_Msk << pos); //reset sense mode
  switch (mode) 

However I totally fail to explain my setup that it should recompile this file and use my own version rather than the default one? Any help would be appreciated...its driving me crazy (I seem to always get stuck for hours on include issues...aaargh)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions