Exemplo n.º 1
0
        private void btnReadEeprom_Click(object sender, EventArgs e)
        {
            saveFileDlg.DefaultExt = "bin";
            saveFileDlg.Filter = "Bin file (*.bin)|*.bin|All files (*.*)|*.*";
            DialogResult res = saveFileDlg.ShowDialog();

            if (res == DialogResult.OK)
            {
                tbLog.Clear();
                cmd_path = Directory.GetCurrentDirectory() + "\\avrdude";
                cmd_command = "avrdude.exe";
                cmd_args = "-c " + Properties.Settings.Default.AvrDude_Device + " -p m64 -U eeprom:r:" + saveFileDlg.FileName + ":r";

                tbLog.Text = "EXEC: " + cmd_path + "\\" + cmd_command + " " + cmd_args + "\r\n";
                ExecuteCommand();
                if (cmd_ok)
                {
                    if (tbLog.Text.Contains("error"))
                    {
                        MessageBox.Show("Could not read from transmitter...", "ERROR!!!");
                    }
                    else
                    {
                        loadedEeprom = new Eeprom(saveFileDlg.FileName);
                        LoadRadioConfig();
                    }
                }
                else
                {
                    MessageBox.Show("Could not read from transmitter...", "ERROR!!!");
                    loadedEeprom = null;
                }
            }
        }
Exemplo n.º 2
0
        private void btnLoadEeprom_Click(object sender, EventArgs e)
        {
            openFileDlg.DefaultExt = "bin";
            openFileDlg.Filter = "Bin file (*.bin)|*.bin|All files (*.*)|*.*";
            DialogResult res = openFileDlg.ShowDialog();

            if (res == DialogResult.OK)
            {
                tbLog.Clear();

                loadedEeprom = new Eeprom(openFileDlg.FileName);
                LoadRadioConfig();
                tbLog.Text = "Loaded Eeprom from: " + openFileDlg.FileName;
            }
        }