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.

166 lines
4.0 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright ?2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: Main.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of Main.cpp
  13. //----------------------------------------------------------------------------
  14. #include <dos.h>
  15. #include <stdio.h>
  16. #include <conio.h>
  17. #include <string.h>
  18. #include <ctype.h>
  19. #include "Board.h"
  20. #include "Comm485.h"
  21. #include "Kernel.h"
  22. #include "Shadow.h"
  23. #include "Screen.h"
  24. /*!
  25. Checks type of PC-104 Board
  26. Reading BSR into \a CHID then
  27. if \a CHID one of following:
  28. \b 0x31504d44 then board is \b Vortex86SX
  29. \b 0x32504d44 then board is \b Vortex86DX
  30. \b 0x33504d44 then board is \b Vortex86MX
  31. in any match returning \b true
  32. */
  33. #include <crt0.h>
  34. int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
  35. bool g_bShowErrors = true;
  36. bool g_bDelayErrors = true;
  37. bool g_bHideFogError = true;
  38. //bool g_bIsVortex = false;
  39. //bool g_UI_Debug = false;
  40. //bool g_bWorkEnable = false;
  41. //bool g_bIsDMABoard = false;
  42. uint8_t g_bNoBlackTargets = 0;
  43. DWORD g_dwStartupTime = 0;
  44. uint8_t g_bFlashDriveID = 2; // Disk - C:
  45. #if defined( COMPILE_3DSCANER ) | defined( COMPILE_RTSCANER )
  46. bool g_bBoardReceiverMode = true;
  47. #else
  48. bool g_bBoardReceiverMode = false;
  49. #endif
  50. #ifdef COMPILE_AS_GETFILE
  51. bool g_bWatchDogEnable = false;
  52. #else
  53. #ifdef ALS_300
  54. bool g_bWatchDogEnable = false; // ALS 300 is too slow for board reset TO DO: change Watchdog init for ALS_300
  55. #else
  56. #ifdef NO_WDT2_INIT
  57. #ifdef WATCHDOG_ENABLED
  58. bool g_bWatchDogEnable = true;
  59. #else
  60. bool g_bWatchDogEnable = false;
  61. #endif
  62. #else
  63. #ifdef WATCHDOG_ENABLED
  64. bool g_bWatchDogEnable = true;
  65. #else
  66. bool g_bWatchDogEnable = false;
  67. #endif
  68. #endif
  69. #endif
  70. #endif
  71. #ifdef STORE_FIRST_SAF
  72. bool g_bSAFFreezEnable = false;
  73. bool g_bSAFFileEnable = false;
  74. #endif
  75. #ifdef LGS_REDUCED_PRF
  76. int16_t LGS_PRF_REDUCE_RATIO = 1;
  77. int16_t LGS_MAX_DETECTOR_DISTANCE = 30;
  78. #endif
  79. /*!
  80. \arg argc Passed agruments count.
  81. \arg argv Array of strings vith arguments passed to the Application.
  82. \details The parameters that may be passed:
  83. \li \b h, \b h, \b v, \b V or \b ? Version output and return from Application
  84. \li \b u or \b U Hide all errors
  85. \li \b f or \b F UnHide Fog errors
  86. \li \b z or \b Z Disable delay error output
  87. \li \b u or \b D Debug output enabled
  88. All parameters to be passed mast have prefix \b / or \b - or \b \\ and space between combined parameters
  89. */
  90. int main( int argc, char * argv[] ){
  91. textmode(64);
  92. CBoard * pBoard = CBoard::getInstance();
  93. CKernel * g_Kernel = CKernel::getInstance();
  94. if ( argc > 1 ) {
  95. switch( argv[1][0] ){
  96. case '-': case '\\': case '/':
  97. switch( argv[1][1] ){
  98. case 'h': case 'H': case 'v': case 'V': case '?':
  99. printf( "Software version <%s>\n", g_Kernel->getSoftwareVersion() );
  100. return 0;
  101. case 'u': case 'U':
  102. g_bShowErrors = false;
  103. break;
  104. case 'f': case 'F':
  105. g_bHideFogError = false;
  106. break;
  107. case 'z': case 'Z':
  108. g_bShowErrors = true;
  109. g_bHideFogError = false;
  110. g_bDelayErrors = false;
  111. break;
  112. //case 'd': case 'D':
  113. // g_UI_Debug = true;
  114. // break;
  115. case 'b': case 'B':
  116. g_bBoardReceiverMode = true;
  117. break;
  118. case 'w': case 'W':
  119. g_bWatchDogEnable = false;
  120. break;
  121. };
  122. break;
  123. };
  124. };
  125. #ifdef DEBUG_GRAPH_SCREEN
  126. if( !g_Screen.Create() ){
  127. printf( "Can't create screen\n" );
  128. return -1;
  129. } else if (g_UI_Debug) printf("Done\n");
  130. #endif
  131. if( !g_Kernel->Create() ) {
  132. #ifdef DEBUG
  133. printf("Error in Kernel Create\n\n");
  134. #endif
  135. return -1;
  136. }
  137. bool bRestart = g_Kernel->Run();
  138. #ifdef DEBUG_GRAPH_SCREEN
  139. g_Screen.Destroy();
  140. #endif
  141. g_Kernel->Destroy();
  142. pBoard->Destroy();
  143. return 0;
  144. };