Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

74 lines
1.4 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: LgDevice.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of LgDevice.cpp
//----------------------------------------------------------------------------
#include "stdafx.h"
#ifdef __BORLANDC__
#include "..\LgLib\Device\LgDevice.h"
#else
#include "LgDevice.h"
#endif
CLgDevice::CLgDevice()
{
// clear commands processing
m_bReadyForCmd = TRUE;
m_nCmd = CMD_NONE;
m_bCmdExist = FALSE;
}
CLgDevice::~CLgDevice()
{
}
BOOL CLgDevice::DoCmd( INT nCommand )
{
// check availibility
if( !m_bReadyForCmd )
return FALSE;
// prevent commands overlapping
m_bReadyForCmd = FALSE;
// store command id
m_nCmd = nCommand;
return m_bCmdExist = TRUE;
}
INT CLgDevice::GetCmd()
{
// if there is no new command
if( !m_bCmdExist )
return CMD_NONE;
// mark that command taken
m_bCmdExist = FALSE;
// mark that not ready for new messages
m_bReadyForCmd = FALSE;
// return commands
return m_nCmd;
}
void CLgDevice::ReleaseCmd()
{
// ready to process new message
m_bReadyForCmd = TRUE;
}
BOOL CLgDevice::IsReadyForCmd()
{
return m_bReadyForCmd;
}