/*
=============================================================================
Function:
Parameters:
Return:
Exit:
Description:
=============================================================================
*/
int open_drawer(int drawer)
{
int data = 0; | /* Chipset register data */ |
int status = 0; | /* Cash drawer status signal */ |
/* Get current cash drawer status. */ status = is_open();
if( status ) {
printf("\nCash Register is already open.\n"); return(1);
}
/* Toggle cash drawer signals - low pulse. */ data = _inp(GP_LVL3);
if( drawer == DRAWER1 ) data &= ~GPIO_2;
if( drawer == DRAWER2 ) data &= ~GPIO_3;
_outp(GP_LVL3,data); Sleep(50);
if( drawer == DRAWER1 ) data = GPIO_2;
if( drawer == DRAWER2 ) data = GPIO_3;
_outp(GP_LVL3,data); return(1);
}
void Sleep(clock_t t)
{
clock_t t2;
t2 = t + clock(); while( t2 > clock() );
}
Elo TouchSystems 17A2 User Guide 46