For DOS Protected Mode version of sensor core software
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.
|
|
//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright ?2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: Main.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of Main.cpp
//----------------------------------------------------------------------------
#include <dos.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
#include "Board.h"
#include "Comm485.h"
#include "Kernel.h"
#include "Shadow.h"
#include "Screen.h"
/*!
Checks type of PC-104 Board Reading BSR into \a CHID then if \a CHID one of following: \b 0x31504d44 then board is \b Vortex86SX \b 0x32504d44 then board is \b Vortex86DX \b 0x33504d44 then board is \b Vortex86MX
in any match returning \b true
*/
#include <crt0.h>
int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
bool g_bShowErrors = true;bool g_bDelayErrors = true;bool g_bHideFogError = true;uint8_t g_bNoBlackTargets = 0;uint64_t g_qwStartupTime = 0;uint8_t g_bFlashDriveID = 2; // Disk - C:
#if defined( COMPILE_3DSCANER ) | defined( COMPILE_RTSCANER )
bool g_bBoardReceiverMode = true;#else
bool g_bBoardReceiverMode = false;#endif
#ifdef COMPILE_AS_GETFILE
bool g_bWatchDogEnable = false;#else
#ifdef ALS_300
bool g_bWatchDogEnable = false; // ALS 300 is too slow for board reset TO DO: change Watchdog init for ALS_300
#else
#ifdef NO_WDT2_INIT
#ifdef WATCHDOG_ENABLED
bool g_bWatchDogEnable = true; #else
bool g_bWatchDogEnable = false; #endif
#else
#ifdef WATCHDOG_ENABLED
bool g_bWatchDogEnable = true; #else
bool g_bWatchDogEnable = false; #endif
#endif
#endif
#endif
#ifdef STORE_FIRST_SAF
bool g_bSAFFreezEnable = false; bool g_bSAFFileEnable = false;#endif
#ifdef LGS_REDUCED_PRF
int16_t LGS_PRF_REDUCE_RATIO = 1; int16_t LGS_MAX_DETECTOR_DISTANCE = 30;#endif
/*!
\arg argc Passed agruments count. \arg argv Array of strings vith arguments passed to the Application. \details The parameters that may be passed: \li \b h, \b h, \b v, \b V or \b ? Version output and return from Application \li \b u or \b U Hide all errors \li \b f or \b F UnHide Fog errors \li \b z or \b Z Disable delay error output \li \b u or \b D Debug output enabled All parameters to be passed mast have prefix \b / or \b - or \b \\ and space between combined parameters*/
int main( int argc, char * argv[] ){ textmode(64);
CBoard * pBoard = CBoard::getInstance(); CKernel * g_Kernel = CKernel::getInstance(); if ( argc > 1 ) { switch( argv[1][0] ){ case '-': case '\\': case '/': switch( argv[1][1] ){ case 'h': case 'H': case 'v': case 'V': case '?': printf( "Software version <%s>\n", g_Kernel->getSoftwareVersion() ); return 0; case 'u': case 'U': g_bShowErrors = false; break; case 'f': case 'F': g_bHideFogError = false; break; case 'z': case 'Z': g_bShowErrors = true; g_bHideFogError = false; g_bDelayErrors = false; break; //case 'd': case 'D':
// g_UI_Debug = true;
// break;
case 'b': case 'B': g_bBoardReceiverMode = true; break; case 'w': case 'W': g_bWatchDogEnable = false; break; }; break; }; };
#ifdef DEBUG_GRAPH_SCREEN
if( !g_Screen.Create() ){ printf( "Can't create screen\n" ); return -1; } else if (g_UI_Debug) printf("Done\n");#endif
if( !g_Kernel->Create() ) {#ifdef DEBUG
printf("Error in Kernel Create\n\n");#endif
return -1; }
bool bRestart = g_Kernel->Run();
#ifdef DEBUG_GRAPH_SCREEN
g_Screen.Destroy();#endif
g_Kernel->Destroy();
pBoard->Destroy();
return 0;};
|