PT630 Programming Reference Guide
Page 50 of 59
------------------------------------------------------------------------------------------------------------------
1.6
Power Management Function ( INT 22H )
Entry
Parameter:
None
Return Value: AX =
0
; awaken by key
1 ;
awaken
by
barcode
scanner
2 ;
awaken
by
RS232
The system will enter HALT power saving mode from this BIOS call, on return the value in
AX register will define the type of device that awakes the system back to ACTIVE mode.
Sample C program with INT22
int get_barcode(char * str_bar)
{
union REGS regs;
struct SREGS sregs;
regs.x.dx=(int)str_bar;
segread(&sregs);
regs.h.ah=0x50;
intdosx(®s,®s,&sregs);
if (regs.x.ax==1)
return(0); /* no data input from barcode port */
else
return(1); /* has data input from barcode port */
}
int get_keyboard()
{
if (kbhit()==0)
return(0); /* no input from key pressing */
return(1); /* has input from keyboard */
}
while ( !get_barcode() && /* check if data input from barcode port */
!get_keyboard() )
/* check if data input from keyboard */
{
int86(0x22,®s,®s);
/* enter stand-by state if no input from
either
barcode
port
or
keyboard
*/
}