9.8.1.2.2 Workflow

  1. Read in the current external interrupt channel state to see if an edge has been detected.
    if (extint_chan_is_detected(BUTTON_0_EIC_LINE)) {
    
  2. Read in the new physical button state and mirror it on the board LED.
    // Do something in response to EXTINT edge detection
    bool button_pin_state = port_pin_get_input_level(BUTTON_0_PIN);
    port_pin_set_output_level(LED_0_PIN, button_pin_state);
    
  3. Clear the detection state of the external interrupt channel so that it is ready to detect a future falling edge.
    extint_chan_clear_detected(BUTTON_0_EIC_LINE);