
PT-20 Programming Guide
System
Two time variables are declared by the system, which can be used for counting time. As they
are updated by system clock, Don’t write to them.
· extern volatile unsigned long sys_msec; // in unit of 5 ms
· extern volatile unsigned long sys_sec; // in unit of 1 second
These two variables are cleared to 0 upon power up.
This function will shut down the system.When power on, the system will
resume or restart itself, depending on the system setting.
void SysDelay(unsigned int ulTime);
SysDelay(6000);//delay 6 seconds.
The function can delay system, its unit is millisecond.
Set power on for resume or restart.
void SetPowerOnState(int slState);
SetPowerOnState(0);//Power on for resume.
This function can set power on status for resume or restart.
slState for 0:Set power on resume.
slState for 1:Set power on restart.
int GetPowerOnState(void);
if (GetPowerOnState())
_printf_color(COLOR_BLACK, “Power on for restart:”);
Kommentare zu diesen Handbüchern