Patch #3225 2011-10-26 09:45

scarphin

AVR Template: Enhanced and added more options.
Download
3225-AVR_Template_E.patch (18.0 KB)
Category
Plugin::FeatureAdd
Status
Accepted
Close date
2012-01-24 23:26
Assigned to
danselmi
Index: src/plugins/scriptedwizard/resources/avr/wizard.script
===================================================================
--- src/plugins/scriptedwizard/resources/avr/wizard.script    (revision 7521)
+++ src/plugins/scriptedwizard/resources/avr/wizard.script    (working copy)
@@ -4,6 +4,7 @@
 //
 // Project: Atmel AVR project
 // Author:  Brian Sidebotham
+// Modified: H. Metin OZER
 //
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -12,14 +13,18 @@
 AvrHex <- false;         // produce Hex file from ELF output ?
 AvrSrec <- false;              // produce Motorola S-Record files?
 AvrBin <- false;               // produce Binary image files?
+AvrExt <- false;     // produce extra files .fuse .lock .sig etc...
 AvrLss <- false;         // produce extended list file from ELF output?
 AvrMap <- false;         // produce Symbol Map file from ELF output?
 AvrExtMem <- false;      // Locate .data in on-board SRAM, or external SRAM
 AvrExtMemAddr <- ""      // The external memory address
-AvrSize <- false;        // Run avr-size after the build 
+AvrSize <- false;        // Run avr-size after the build
 AvrF_CPU <- false;       // Define F_CPU?
 AvrF_CPUValue <- _T(""); // F_CPU textual value
- 
+Programmer <- _T("");    // Avrdude 'programmer-id'
+Debugger <- _T("");      // Avarice debugger choice
+DebuggerCon <- _T("");   // Avarice debugger connection type
+
 function BeginWizard()
 {
     local wiz_type = Wizard.GetWizardType();
@@ -33,7 +38,8 @@
         Wizard.AddInfoPage(_T("AtmelAVRIntro"), intro_msg);
         Wizard.AddProjectPathPage();
         Wizard.AddCompilerPage(_T("GNU AVR GCC Compiler"), _T("avr*"), false, true);
-        Wizard.AddPage(_T("processorChoice"));        
+        Wizard.AddPage(_T("processorChoice"));
+        Wizard.AddPage(_T("programmerChoice"));
     }
     else
         print(wiz_type);
@@ -58,10 +64,11 @@
         AvrHex = Wizard.IsCheckboxChecked(_T("checkboxHex"));
         AvrSrec = Wizard.IsCheckboxChecked(_T("checkboxSrec"));
         AvrBin = Wizard.IsCheckboxChecked(_T("checkboxBin"));
+        AvrExt = Wizard.IsCheckboxChecked(_T("checkboxExt"));
         AvrMap = Wizard.IsCheckboxChecked(_T("checkboxMap"));
         AvrLss = Wizard.IsCheckboxChecked(_T("checkboxLss"));
         AvrExtMem = Wizard.IsCheckboxChecked(_T("checkboxExtMem"));
-        AvrExtMemAddr = Wizard.GetTextControlValue(_T("textctrlExtMem"));        
+        AvrExtMemAddr = Wizard.GetTextControlValue(_T("textctrlExtMem"));
         AvrSize = Wizard.IsCheckboxChecked(_T("checkboxAvrSize"));
         AvrF_CPU = Wizard.IsCheckboxChecked(_T("checkboxF_CPU"));
         AvrF_CPUValue = Wizard.GetTextControlValue(_T("textctrlF_CPU"));
@@ -69,37 +76,83 @@
     return true;
 }
 
+
+////////////////////////////////////////////////////////////////////////////////
+// Processor choice page
+////////////////////////////////////////////////////////////////////////////////
+
+function OnLeave_programmerChoice(fwd)
+{
+    if (fwd)
+    {
+        Programmer = Wizard.GetComboboxStringSelection(_T("comboboxProg"));
+        Debugger = Wizard.GetComboboxStringSelection(_T("comboboxDbgr"));
+        DebuggerCon = Wizard.GetComboboxStringSelection(_T("comboboxDbgrCon"));
+    }
+    return true;
+}
+
 function SetupProject(project)
-{   
-    // Linker options 
+{
+    // Linker options
         local lo_map = ::wxString();
         local lo_extmem = ::wxString();
-    
+
     // Post Build steps
     local pb_avrsize = ::wxString();
+
     local pb_eephex = ::wxString();
+    local pb_fusehex = ::wxString();
+    local pb_lockhex = ::wxString();
+    local pb_sighex = ::wxString();
     local pb_hex = ::wxString();
+    local pb_lfshex = ::wxString();
+    local pb_hfshex = ::wxString();
+    local pb_efshex = ::wxString();
+
     local pb_eepbin = ::wxString();
+    local pb_fusebin = ::wxString();
+    local pb_lockbin = ::wxString();
+    local pb_sigbin = ::wxString();
     local pb_bin = ::wxString();
+
     local pb_eepsrec = ::wxString();
-    local pb_srec = ::wxString();    
+    local pb_fusesrec = ::wxString();
+    local pb_locksrec = ::wxString();
+    local pb_sigsrec = ::wxString();
+    local pb_srec = ::wxString();
+
     local pb_lss = ::wxString();
 
         // Post build commands
-        pb_eephex = _T("avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).eep.hex");
-        pb_hex = _T("avr-objcopy -O ihex -R .eeprom -R .eesafe $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).hex");
-        pb_eepbin = _T("avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O binary $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).eep.bin");
-        pb_bin = _T("avr-objcopy -O binary -R .eeprom -R .eesafe $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).bin");
-        pb_eepsrec = _T("avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O srec $(TARGET_OUTP
download for full patch...