Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Corssworks CTL examples

2005-10-17 by rseku

I am testing simplest ever Crossworks CTL examples for builtin  multi 
tasking.
When I went through test 2 for Olimex(LPC2138), I found that button ISR
once energized never stops.I think, that button press event should be 
generated only once, when button is pressed ( I am not certain if LPC is 
working based on Edge or Level interrupt signal)

Example code as follows:
void
buttonPressedISR(void)
{
   count++;
   SetLeds(1);
   ctl_events_set_clear(&e1, 1, 0);
}

Below is a task which is wating for above event:

void
other(void *p)
{
   unsigned leds = 0;
   while (1)
     {
       ctl_events_wait(CTL_EVENT_WAIT_ALL_EVENTS, &e1, 1, 1, 
ctl_get_current_time()+1000);
       ctl_events_set_clear(&e1, 0, 1);
       leds ^= 0xFFFFFFFF;
       SetLeds(leds);
     }
}

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.