#include <rtl.h>
os_mbx_declare (mailbox1, 20);
void timer1 (void) __irq {
..
if (isr_mbx_check (&mailbox1) != 0) {
isr_mbx_send (&mailbox1, msg);
}
..
}
Example for sending more than one message from ISR:
#include <rtl.h>
os_mbx_declare (mailbox1, 20);
void timer1 (void) __irq {
int i,free;
..
free = isr_mbx_check (&mailbox1);
for (i = 0; i < 16; i++) {
if (free > 0) {
free--;
isr_mbx_send (&mailbox1, msg);
}
}
..
}
|