- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, so this might seem like a pretty basic level question, but I'm a bit of a newbie.
I have two Low Power Comparators in my design, and in order for these to kick my CPU out of DeepSleep, have these linked to a Global Signal component configured with a combined Low Power Comparator interrupt.
Where I'm having trouble is in determining which of the two LPC's has triggered the interrupt so that I can direct my ISR code to undertake the appropriate task.
I thought a simple "if" statement, using the GetInterruptSource() API, but I'm not actually sure what this API returns and so I'm not sure how to check it and see which of the two LPC's has triggered my interrupt.
Can anyone help me understand how to go about this? I may not actually be approaching this from the correct angle, so if you're sitting here reading this thinking "hmmm, you're making life difficult for yourself there pal!", feel free to gently steer me in the correct direction
Cheers,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like
Value = LP1Comp_GetInterruptSource();
if (Value & LP1Comp_INTR) LPC1_Triggered();
if (Value & LP2Comp_INTR) LPC2_Triggered();
or
Query each of the LPCs with LPComp_GetCompare() to see if it did trigger.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob - all working now!
Cheers,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great! 😉
Bob