Hi friends I wrote the code for the ARM RTOS now the no warnings and no errors but the output is not coming
i am doing 2 task task1:buzzer_operation(); task2:ADC_operation();
could you please tell me where i am going wrong in this code my code is here
#include<lpc214x.h> #include"adc.h" #include"buzzer.h" /* Include type and function declarations for RTX */ #include <RTL.h> #include <RTX_Config.h> /* id1, id2 will contain task identifications at run-time */ OS_TID id1, id2;
/* Forward reference. */ __task void tsk1 (void); __task void tsk2 (void);
__task void tsk1 (void) { /* Obtain own system task identification number */ id1 = os_tsk_self (); /* Assign system identification number of task2 to id2 */ id2 = os_tsk_create (tsk2, 0); for (;;) { /* do-this */ buzzer(); /* Indicate to task2 completion of do-this */ os_evt_set (0x0004, id2); /* Wait for completion of do-that (0xffff means no time-out)*/ os_evt_wait_or (0x0004, 0xffff); /* Wait now for 50 ms */ os_dly_wait (5); } }
__task void tsk2 (void) { for (;;) { ADC(); /* Wait for completion of do-this (0xffff means no time-out) */ os_evt_wait_or (0x0004, 0xffff); /* do-that */ /* Pause for 20 ms until signaling event to task1 */ os_dly_wait (2); /* Indicate to task1 completion of do-that */ os_evt_set (0x0004, id1); } }
int main (void) { os_sys_init (tsk1); return 0; }