File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,20 @@ static inline void handle_interrupt_in(uint32_t channel) {
37
37
uint8_t pin_num = (pin_names [channel ] & (0x0f << PIN_SHIFT )) >> PIN_SHIFT ;
38
38
uint8_t trigger_event = trigger_events [channel ];
39
39
40
- if (trigger_event == 1 ) {
41
- // Rising edge.
40
+ if (trigger_event == 1 )
42
41
irq_handler (channel_ids [channel ], IRQ_RISE );
43
- }
44
- else if (trigger_event == 2 ) {
45
- // Low, therefore falling edge...
42
+ else if (trigger_event == 2 )
46
43
irq_handler (channel_ids [channel ], IRQ_FALL );
47
- }
48
44
else {
49
- // This is supposed to be triggered by both cases...
50
- irq_handler (channel_ids [channel ], IRQ_RISE );
45
+ // In order to get an idea of which kind of event it is,
46
+ // We need to read the logic level of the pin...
47
+
48
+ uint8_t logic = (port_reg -> DATA & (1 << pin_num )) >> pin_num ;
49
+
50
+ if (logic == 1 )
51
+ irq_handler (channel_ids [channel ], IRQ_RISE );
52
+ else
53
+ irq_handler (channel_ids [channel ], IRQ_FALL );
51
54
}
52
55
53
56
// Clear the interrupt...
You can’t perform that action at this time.
0 commit comments