Good evening,
i'm having problems with sending a mail from an interrupt to a task. I'm using the LPC1769 (Cortex-M3). The os_mbx_wait-function just waits forever, although the isr_mbx_send() is multiply called (checked with debugger)! If I send a mail from another task it works well - seems as if the isr_mbx_send() is not working correctly.
My Code is looking like this:
.. os_mbx_declare(pwm_in_mail, 20); void pwm_in_init(void) { os_mbx_init(pwm_in_mail, sizeof(pwm_in_mail)); os_tsk_create (pwm_in_task, 2); .. } void EINT3_IRQHandler() { U32 mail; .. mail = (channel->id << 16) | channel->pulse_width; if(isr_mbx_check(pwm_in_mail) != 0) isr_mbx_send(pwm_in_mail, (void*)mail); } __task void pwm_in_task(void) { U32 mail_data, channel, time; for(;;) { os_mbx_wait(pwm_in_mail, (void*)&mail_data, 0xFFFF); channel = mail_data >> 16; time = mail_data & 0xFFFF; if(channel == PWM_IN_CHANNEL_1) pwm_set(PWM_CHANNEL_1, time); } }
thx for your help! regards, Sascha Albrecht