36 #include "esos_pc_stdio.h"
48 volatile uint32_t u32_T2Count;
49 volatile uint32_t u32_T3Count;
50 static uint8_t psz_T2Is[]=
"T2 is ";
51 static uint8_t psz_T3Is[]=
"T3 is ";
52 static uint8_t psz_Enabled[]=
"enabled.";
53 static uint8_t psz_Disabled[]=
"disabled.";
54 static uint8_t psz_CRNL[3]= {0x0D, 0x0A, 0};
56 struct stTask* pst_MyTasks[3];
89 if ((u8_Char >=
'a') && (u8_Char <=
'z') )
90 u8_Char = u8_Char -
'a' +
'A';
139 #define LOCAL_BUFFER_LEN 16
142 static uint8_t au8_Char[LOCAL_BUFFER_LEN+4];
150 for (u8_i=0; u8_i<LOCAL_BUFFER_LEN; u8_i++) {
151 if ((au8_Char[u8_i] >=
'A') && (au8_Char[u8_i] <=
'Z') )
152 au8_Char[u8_i] = au8_Char[u8_i] -
'A' +
'a';
167 static uint32_t u32_RandomNumber;
168 static uint32_t u32_count;
172 u32_RandomNumber = 0;
175 U32_Temp._uint32_t = u32_RandomNumber;
199 static uint32_t u32_RandomNumber;
200 static uint8_t u8_RandomNumber;
209 U32_Temp._uint32_t = u32_RandomNumber;
230 static uint32_t u32_RandomNumber;
231 static uint8_t u8_RandomNumber;
240 U32_Temp._uint32_t = u32_RandomNumber;
265 static uint32_t u32_RandomNumber;
266 static uint8_t u8_RandomNumber;
275 U32_Temp._uint32_t = u32_RandomNumber;
276 u8_RandomNumber = U32_Temp.
u8LoLsb;
327 if ( u8_Char ==
'1') {
331 }
else if (u8_Char ==
'2') {
335 }
else if (u8_Char ==
'3') {
339 }
else if (u8_Char ==
'Q') {
342 ESOS_TASK_KILL(pst_MyTasks[0] );
343 }
else if (u8_Char ==
'W') {
346 ESOS_TASK_KILL(pst_MyTasks[1] );
347 }
else if (u8_Char ==
'E') {
350 ESOS_TASK_KILL(pst_MyTasks[2] );
351 }
else if (u8_Char ==
'A') {
354 ESOS_TASK_INIT( pst_MyTasks[0] );
355 }
else if (u8_Char ==
'S') {
358 ESOS_TASK_INIT( pst_MyTasks[1] );
359 }
else if (u8_Char ==
'D') {
362 ESOS_TASK_INIT( pst_MyTasks[2] );
363 }
else if (u8_Char ==
'Z') {
366 ESOS_TASK_WAKE(pst_MyTasks[0] );
367 }
else if (u8_Char ==
'X') {
370 ESOS_TASK_WAKE(pst_MyTasks[1] );
371 }
else if (u8_Char ==
'C') {
374 ESOS_TASK_WAKE(pst_MyTasks[2] );
375 }
else if (u8_Char ==
' ') {
381 for (u8_i=0; u8_i<3; u8_i++) {
385 if (ESOS_TASK_IS_SLEEPING(pst_MyTasks[u8_i])) {
388 if (ESOS_TASK_IS_KILLED(pst_MyTasks[u8_i])) {
391 if (__ESOS_TASK_IS_CALLED(pst_MyTasks[u8_i])) {
394 if (ESOS_TASK_IS_ENDED(pst_MyTasks[u8_i])) {
397 if (ESOS_TASK_IS_WAITING(pst_MyTasks[u8_i])) {
434 if (pst_MyTasks[0]->pfn != random_1 ) u8_i |=
BIT0;
435 if (pst_MyTasks[1]->pfn != random_2 ) u8_i |=
BIT1;
436 if (pst_MyTasks[2]->pfn != random_3 ) u8_i |=
BIT2;
441 if ( u8_i &&
BIT0 ) {
446 if ( u8_i &&
BIT1 ) {
451 if ( u8_i &&
BIT2 ) {
540 __esos_hw_PutString( HELLO_MSG );