Keil RTX51 Manual page 53

Table of Contents

Advertisement

RTX TINY
unsigned char args;
*/
rtime.sec = 0;
*/
args = sscanf (buffer, "%bd:%bd:%bd",
*/
*/
if (rtime.hour > 23
*/
rtime.sec > 59
printf ("\n*** ERROR: INVALID TIME FORMAT\n");
return (0);
}
return (1);
}
#define ESC
*/
bit
escape;
*/
/*****************************************************************************
*/
/*
*/
/*****************************************************************************
*/
get_escape () _task_ GET_ESC
while (1)
*/
if (_getkey () == ESC)
*/
if (escape)
*/
os_send_signal (COMMAND);
*/
}
}
}
/*****************************************************************************
*/
/*
Task 1 'command': command processor */
/*****************************************************************************
*/
command () _task_ COMMAND
unsigned char i;
printf (menu);
*/
while (1)
*/
printf ("\nCommand: ");
*/
&rtime.hour,
&rtime.min,
&rtime.sec);
||
rtime.min > 59
||
args < 2
0x1B
Task 6 'get_escape': check if ESC (escape character) was entered
{
{
escape = 1;
{
{
{
/* number of arguments
/* preset second
/* scan input line for
/* hour, minute and second
||
/* check for valid inputs
||
args == EOF)
{
/* ESCAPE character code
/* flag: mark ESCAPE character entered
/* set flag if ESC entered
/* if escape flag send signal
/* to task 'command'
/* display command menu
/* display prompt
53
/* endless loop
6
/* endless loop

Advertisement

Table of Contents
loading

Table of Contents