![Keil RTX51 Скачать руководство пользователя страница 50](http://html1.mh-extra.com/html/keil/rtx51/rtx51_manual_3913946050.webp)
50
Application Examples
6
•
Task 4 Lights
: controls the traffic light phases while the clock time is
in the active time range (between the start and end times).
•
Task 5 Button
: reads the pedestrian push button and sends signals to
the lights task.
•
Task 6 Quit
: checks for an ESC character in the serial stream. If one
is encountered, this task terminates a previously specified display
command.
SERIAL.C
implements an interrupt driven serial interface. This file contains the
functions
putchar
and
getkey
. The high
-
level I/O functions
printf
and
getline
call these basic I/O routines. The traffic light application will also
operate without using interrupt driven serial I/O. but will not perform as
well.
GETLINE.C
is the command line editor for characters received from the serial port.
This source file is also used by the MEASURE application.
TRAFFIC.C
/*****************************************************************************
*/
/*
*/
/* TRAFFIC.C: Traffic Light Controller using the C51 Compiler
*/
/*
*/
/*****************************************************************************
*/
code char menu[] =
"\n"
"+***** TRAFFIC LIGHT CONTROLLER using C51 and RTX-51 tiny *****+\n"
"| This program is a simple Traffic Light Controller. Between |\n"
"| start time and end time the system controls a traffic light |\n"
"| with pedestrian self-service. Outside of this time range |\n"
"| the yellow caution lamp is blinking. |\n"
"+ command -+ syntax -----+ function ---------------------------+\n"
"| Display | D | display times |\n"
"| Time | T hh:mm:ss | set clock time |\n"
"| Start | S hh:mm:ss | set start time |\n"
"| End | E hh:mm:ss | set end time |\n"
"+----------+-------------+-------------------------------------+\n";
#include <reg52.h> /* special function registers 8052
*/
#include <rtx51tny.h> /* RTX-51 tiny functions & defines
*/
#include <stdio.h> /* standard I/O .h-file
*/
#include <ctype.h> /* character functions
*/
#include <string.h> /* string and memory functions
*/
Содержание RTX51
Страница 4: ......
Страница 6: ......
Страница 20: ......
Страница 24: ......
Страница 39: ...RTX Tiny 39 4...
Страница 40: ......
Страница 44: ...44 RTX51 Tiny Specifications 5...
Страница 68: ...RTX51 TINY REAL TIME OPERATING SYSTEM User s Guide 2 95...