//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 08/10/2003 // PROJECT: // SUBSYSTEM: // FILE: watchdog.cpp // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Source file of watchdog.cpp //---------------------------------------------------------------------------- #include "stdafx.h" #include "WatchDog.h" #ifdef WATCHDOG_ENABLED void CWatchDog::Update( DWORD dwTime ) { #ifdef WATCHDOG_TEST_BY_REBOOT return; #endif if( !m_bInitiated ) return; if( (dwTime - m_dwTime) < 18 ) return; m_dwTime = dwTime; switch( m_eType ) { default: case WT_UNKNOWN: break; case WT_COREMODULE_4DXE: // update watchdog counter asm { mov ah, 0xC3 mov al, 1 // enable mov bx, 60 // 60 sec int 0x15 } break; case WT_TRI_M: // enabled only watchdog timer 1 and reload it asm { mov AL,0x10 mov DX,ZFLINDEX out DX,AL mov DX,ZFLDATA8 // read port 0x10 in AL,DX and AL,0xEF // clear WD1 reload bit out DX,AL or AL,0x10 // set WD1 reload bit out DX,AL } break; } // Destroy(); } #endif // WATCHDOG_ENABLED