private void Main_Load(object sender, EventArgs e) { ProcessCOM = new SerCOM(); // Create Event Handlers ProcessCOM.ProcessLog += new SerCOM.NotifyLog(ProcessLog); ProcessCOM.ProcessData += new SerCOM.NotifyBytes(ProcessRAWData); // Try to connect at startup ProcessCOM.ConnectToDevice(); // Init Prev_DIPSwitch to -1 (because 0 is a valid value) A2A.Prev_DIPSwitch--; }
private void Btn_Fw_Upd_Click(object sender, EventArgs e) { timer1.Enabled = false; if (ProcessCOM.IsConnected) { ProcessCOM.CloseConnection(); } FW_Upd f2 = new FW_Upd(); f2.ShowDialog(); ProcessCOM.IsInitialized = false; ProcessCOM.ConnectToDevice(); timer1.Enabled = true; }