using System.IO.Ports; using CPF; using System.Threading; using GHI.IO.Storage; using MFUnitTest; using UnitTests; namespace CPFUnitTests { class Program { public static BTConsole btConsole; public static StructQueue sQueue = new StructQueue(); public static StateBase[] cpfState = new StateBase[(int)CPFStates.cpfStatesLength]; private static MotherBoard mbBoard; private static CpfConsole cpfConsole; private static SDStorage sdStorage; //Main Function public static void Main() { Initialize(); // UNIT TESTS // //TestManager.RunTest(typeof(UnitTest_MotherBoard_uSD)); //TestManager.RunTest(typeof(UnitTest_MotherBoard_EnergyMonitor)); //TestManager.RunTest(typeof(UnitTest_MotherBoard_GPS)); //TestManager.RunTest(typeof(UnitTest_MotherBoard_I2CSlots)); //TestManager.RunTest(typeof(UnitTestIridium)); TestManager.RunTest(typeof(UT_BuoyancyEngine.BEUnitTests)); bool keepGoing = false; if (keepGoing) { TestManager.RunTest(typeof(UnitTest_PSB_SN2)); //DisableFLBB(); InitConsole(); cpfConsole.welcomeMessage(); cpfConsole.printPrompt(); while (true) { cpfConsole.readUntilLN(); Thread.Sleep(20); } } } private static void DisableFLBB() { //Turn off the FLBB //CPF.WetlabsFLBB2K.init(); //WetlabsFLBB2K.sendStopCmd(); } //private static SDCard sdCard = new SDCard(); private static void Initialize() { mbBoard = MotherBoard.Instance; mbBoard.Enable12V(); mbBoard.Enable5V(); sdStorage = SDStorage.Instance; GHI.Processor.Watchdog.Disable(); //Let the Gt console output engr logs //EngrLogger.InitStorageVolumes(); EngrLogger.init(null); EngrLogger.CurrentState = "ConsoleOnly"; } private static void InitConsole() { mbBoard.EnableChannelPower(1); cpfConsole = new CpfConsole(new SerialPort("COM1", 115200, Parity.None, 8, StopBits.One)); EngrLogger.SendConsoleLine += cpfConsole.SendLine; } } }