We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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; }
Do you really think anyone is going to be able to look at that and make any sense of it??
The forum gives clear instructions on what to do when posting source code:
www.danlhenry.com/.../keil_code.png
If you can miss clear instructions like that, it must be quite likely that you've also missed important details in the documentation of your RTOS - so your first step should be to go back and study them carefully...
1) Exactly why should "and" be used for bold text?
2) Exactly what does the summary have with your code or problem?
3) Do you think that programs should work if they get through the compiler without errors and warnings?