Beispiel #1
0
        // Open fuse selector window
        // Credits:
        // Simone Chifari (Fuse selector)
        private void btnFuseSelector_Click(object sender, EventArgs e)
        {
            // Make sure MCU is valid
            if (mcu == null)
            {
                return;
            }

            // Get fuse values
            string[] fuses = { txtLFuse.Text, txtHFuse.Text, txtEFuse.Text, txtLock.Text };

            // Remove 0x
            for (int i = 0; i < fuses.Length; i++)
            {
                fuses[i] = fuses[i].ToLower().Replace("0x", "");
            }

            // Open fuse selector form
            FormFuseSelector f = new FormFuseSelector();

            string[] newFuses = f.editFuseAndLocks(mcu, fuses);

            if (newFuses != null)
            {
                // Add 0x back on
                for (int i = 0; i < newFuses.Length; i++)
                {
                    newFuses[i] = "0x" + newFuses[i];
                }

                // Set fuse values
                txtLFuse.Text = newFuses[0];
                txtHFuse.Text = newFuses[1];
                txtEFuse.Text = newFuses[2];
                txtLock.Text  = newFuses[3];
            }
        }
Beispiel #2
0
        // Open fuse selector window
        // Credits:
        // Simone Chifari (Fuse selector)
        private void btnFuseSelector_Click(object sender, EventArgs e)
        {
            // Make sure MCU is valid
            if (mcu == null)
                return;

            // Get fuse values
            string[] fuses = { txtLFuse.Text, txtHFuse.Text, txtEFuse.Text, txtLock.Text };

            // Remove 0x
            for (int i = 0; i < fuses.Length; i++)
                fuses[i] = fuses[i].ToLower().Replace("0x", "");

            // Open fuse selector form
            FormFuseSelector f = new FormFuseSelector();
            string[] newFuses = f.editFuseAndLocks(mcu, fuses);

            if (newFuses != null)
            {
                // Add 0x back on
                for (int i = 0; i < newFuses.Length; i++)
                    newFuses[i] = "0x" + newFuses[i];

                // Set fuse values
                txtLFuse.Text = newFuses[0];
                txtHFuse.Text = newFuses[1];
                txtEFuse.Text = newFuses[2];
                txtLock.Text = newFuses[3];
            }
        }