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.

162 lines
3.8 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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. uint8_t g_bNoBlackTargets = 0;
  39. uint64_t g_qwStartupTime = 0;
  40. uint8_t g_bFlashDriveID = 2; // Disk - C:
  41. #if defined( COMPILE_3DSCANER ) | defined( COMPILE_RTSCANER )
  42. bool g_bBoardReceiverMode = true;
  43. #else
  44. bool g_bBoardReceiverMode = false;
  45. #endif
  46. #ifdef COMPILE_AS_GETFILE
  47. bool g_bWatchDogEnable = false;
  48. #else
  49. #ifdef ALS_300
  50. bool g_bWatchDogEnable = false; // ALS 300 is too slow for board reset TO DO: change Watchdog init for ALS_300
  51. #else
  52. #ifdef NO_WDT2_INIT
  53. #ifdef WATCHDOG_ENABLED
  54. bool g_bWatchDogEnable = true;
  55. #else
  56. bool g_bWatchDogEnable = false;
  57. #endif
  58. #else
  59. #ifdef WATCHDOG_ENABLED
  60. bool g_bWatchDogEnable = true;
  61. #else
  62. bool g_bWatchDogEnable = false;
  63. #endif
  64. #endif
  65. #endif
  66. #endif
  67. #ifdef STORE_FIRST_SAF
  68. bool g_bSAFFreezEnable = false;
  69. bool g_bSAFFileEnable = false;
  70. #endif
  71. #ifdef LGS_REDUCED_PRF
  72. int16_t LGS_PRF_REDUCE_RATIO = 1;
  73. int16_t LGS_MAX_DETECTOR_DISTANCE = 30;
  74. #endif
  75. /*!
  76. \arg argc Passed agruments count.
  77. \arg argv Array of strings vith arguments passed to the Application.
  78. \details The parameters that may be passed:
  79. \li \b h, \b h, \b v, \b V or \b ? Version output and return from Application
  80. \li \b u or \b U Hide all errors
  81. \li \b f or \b F UnHide Fog errors
  82. \li \b z or \b Z Disable delay error output
  83. \li \b u or \b D Debug output enabled
  84. All parameters to be passed mast have prefix \b / or \b - or \b \\ and space between combined parameters
  85. */
  86. int main( int argc, char * argv[] ){
  87. textmode(64);
  88. CBoard * pBoard = CBoard::getInstance();
  89. CKernel * g_Kernel = CKernel::getInstance();
  90. if ( argc > 1 ) {
  91. switch( argv[1][0] ){
  92. case '-': case '\\': case '/':
  93. switch( argv[1][1] ){
  94. case 'h': case 'H': case 'v': case 'V': case '?':
  95. printf( "Software version <%s>\n", g_Kernel->getSoftwareVersion() );
  96. return 0;
  97. case 'u': case 'U':
  98. g_bShowErrors = false;
  99. break;
  100. case 'f': case 'F':
  101. g_bHideFogError = false;
  102. break;
  103. case 'z': case 'Z':
  104. g_bShowErrors = true;
  105. g_bHideFogError = false;
  106. g_bDelayErrors = false;
  107. break;
  108. //case 'd': case 'D':
  109. // g_UI_Debug = true;
  110. // break;
  111. case 'b': case 'B':
  112. g_bBoardReceiverMode = true;
  113. break;
  114. case 'w': case 'W':
  115. g_bWatchDogEnable = false;
  116. break;
  117. };
  118. break;
  119. };
  120. };
  121. #ifdef DEBUG_GRAPH_SCREEN
  122. if( !g_Screen.Create() ){
  123. printf( "Can't create screen\n" );
  124. return -1;
  125. } else if (g_UI_Debug) printf("Done\n");
  126. #endif
  127. if( !g_Kernel->Create() ) {
  128. #ifdef DEBUG
  129. printf("Error in Kernel Create\n\n");
  130. #endif
  131. return -1;
  132. }
  133. bool bRestart = g_Kernel->Run();
  134. #ifdef DEBUG_GRAPH_SCREEN
  135. g_Screen.Destroy();
  136. #endif
  137. g_Kernel->Destroy();
  138. pBoard->Destroy();
  139. return 0;
  140. };