private void Form1_Load(object sender, EventArgs e) { this.InitializeComponent(); float num = this.loadINI(); this.initializeGUI(); if (this.loadDeviceFile()) { if (this.toolStripMenuItemManualSelect.Checked) { this.ManualAutoSelectToggle(false); } this.buildDeviceMenu(); if (!this.allowDataEdits) { this.dataGridProgramMemory.ReadOnly = true; this.dataGridViewEEPROM.ReadOnly = true; } PICkitFunctions.ResetBuffers(); this.testConnected = this.checkForTest(); if (this.testConnected) { this.testConnected = this.testMenuBuild(); } this.uartWindow.VddCallback = new DelegateVddCallback(this.SetVddState); if (!this.detectPICkit2(true, true)) { if (this.bootLoad) { return; } if (this.oldFirmware) { FormPICusb.TestMemoryOpen = false; this.timerDLFW.Enabled = true; return; } Thread.Sleep(3000); if (!this.detectPICkit2(true, true)) { return; } } this.partialEnableGUIControls(); PICkitFunctions.ExitUARTMode(); PICkitFunctions.VddOff(); PICkitFunctions.SetVDDVoltage(3.3f, 0.85f); if (this.autoDetectToolStripMenuItem.Checked) { this.lookForPoweredTarget(false); } if (this.searchOnStartup && PICkitFunctions.DetectDevice(16777215, true, this.chkBoxVddOn.Checked)) { this.setGUIVoltageLimits(true); PICkitFunctions.SetVDDVoltage((float)this.numUpDnVDD.Value, 0.85f); this.displayStatusWindow.Text = this.displayStatusWindow.Text + "\nPIC Device Found."; this.fullEnableGUIControls(); } else { for (int i = 0; i < PICkitFunctions.DevFile.Info.NumberFamilies; i++) { if (PICkitFunctions.DevFile.Families[i].FamilyName == this.lastFamily) { PICkitFunctions.SetActiveFamily(i); if (!PICkitFunctions.DevFile.Families[i].PartDetect) { this.buildDeviceSelectDropDown(i); this.comboBoxSelectPart.Visible = true; this.comboBoxSelectPart.SelectedIndex = 0; this.displayDevice.Visible = true; } } } for (int j = 1; j < PICkitFunctions.DevFile.Info.NumberParts; j++) { if ((int)PICkitFunctions.DevFile.PartsList[j].Family == PICkitFunctions.GetActiveFamily()) { PICkitFunctions.DevFile.PartsList[0].VddMax = PICkitFunctions.DevFile.PartsList[j].VddMax; PICkitFunctions.DevFile.PartsList[0].VddMin = PICkitFunctions.DevFile.PartsList[j].VddMin; break; } } this.setGUIVoltageLimits(true); } if (num != 0f && PICkitFunctions.DevFile.Families[PICkitFunctions.GetActiveFamily()].FamilyName == this.lastFamily && !FormPICusb.selfPoweredTarget) { if (num > (float)this.numUpDnVDD.Maximum) { num = (float)this.numUpDnVDD.Maximum; } if (num < (float)this.numUpDnVDD.Minimum) { num = (float)this.numUpDnVDD.Minimum; } this.numUpDnVDD.Value = (decimal)num; PICkitFunctions.SetVDDVoltage((float)this.numUpDnVDD.Value, 0.85f); } this.checkForPowerErrors(); if (FormPICusb.TestMemoryEnabled) { this.toolStripMenuItemTestMemory.Visible = true; if (FormPICusb.TestMemoryOpen) { this.openTestMemory(); } } if (!PICkitFunctions.DevFile.Families[PICkitFunctions.GetActiveFamily()].PartDetect) { this.disableGUIControls(); } this.updateGUI(true); } }