This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions,
flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.
Hello,
I'm trying to detect rising edge with one handler and falling edge with another handler.
Is it possible with the BL4S200 API?
With the code next, only the photocell_up_isr() is called on falling edge!
// Rising handler
root void photocell_up_isr()
{
photocell_up_count++;
// Turn off all interrupt flags serviced by this handler
RSB_CLEAR_ALL_IRQ(photocell_up_handle);
}
// Falling handler
root void photocell_down_isr()
{
photocell_down_count++;
// Turn off all interrupt flags serviced by this handler
RSB_CLEAR_ALL_IRQ(photocell_down_handle);
}
void photocell_init()
{
int result;
photocell_up_count = 0;
photocell_down_count = 0;
photocell_up_handle = addISR(PHOTOCELL_1, BL_INPUT_BLOCK, 0, photocell_up_isr);
photocell_down_handle = addISR(PHOTOCELL_1, BL_INPUT_BLOCK, 0, photocell_down_isr);
result = setExtInterrupt(PHOTOCELL_1, BL_IRQ_RISE, photocell_up_handle);
result = setExtInterrupt(PHOTOCELL_1, BL_IRQ_FALL, photocell_down_handle);
result = enableISR(photocell_up_handle, 1);
result = enableISR(photocell_down_handle, 1);
}
Thank you for your comment.
Jean-Yves
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )