using System.IO.Ports; using CPF; using System.Threading; 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; //Main Function public static void Main() { Initialize(); //DisableFLBB(); cpfConsole.welcomeMessage(); cpfConsole.printPrompt(); while (true) { cpfConsole.readUntilLN(); Thread.Sleep(20); } } private static void DisableFLBB() { //Turn off the FLBB CPF.FLBB.init(); FLBB.sendStopCmd(); } private static void Initialize() { #if (GEN2) mbBoard = MotherBoard.Instance; mbBoard.Enable12V(); mbBoard.Enable5V(); #endif // Initialize Gadgeteer Hardware for Standard Configuration InitTests.InitGadgeteerForUnitTesting(); CPF.Program.InitStorageVolumes(); //btConsole = new BTConsole(); //btConsole.OpenConsolePort(); InitConsole(); //Let the Gt console output engr logs EngrLogger.SendConsoleLine += cpfConsole.SendLine; EngrLogger.init(cpfState); } private static void InitConsole() { #if GEN2 mbBoard.EnableChannelPower(2); #endif cpfConsole = new CpfConsole(new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One)); } } }