Author Topic: avr-kit  (Read 5245 times)

Offline ratatatata

  • Single posting newcomer
  • *
  • Posts: 5
avr-kit
« on: June 12, 2007, 07:29:47 pm »
hi, i'm an enthusiastic avr-programmer and so i've optimized the gnuavr plugin a bit..

it's not much but usefull in my opinion ;)
i'm new to codeblocks and i would be glad about any feedback, howto do it better, what suckz, what additional features could make avr-programmer's life easier, etc.

it consists of two parts, (1)sourcecode-modifications and (2)a project wizard.
and here's the patch: http://pastebin.ca/564495

just apply it to your code::blocks working copy and after compiling + installing put a logo.png and a wizard.png into the /avr dir of your templates/wizard folder ;)

sourcecode modifications:
  -adding some important options like fpack-struct and -fshort-enums
  -removes the -mmcu options, instead of this $(MCU) and $(F_CPU) is used now
  -makes the gnuavr compiler "WarningsOn", "DebugSymbolsOn" and "OptimizationsOn" compatible
  -adds the possibility to define the command that is execute when you "run" a project (thought for using avrdude)

project wizard:
this wizard asks you for your MCU, the CPU-Frequency, the object format (standard: ihex) the port for avrdude and the programm-device for avrdude.
it registers all variables (MCU, F_CPU, FORMAT, AD_PORT, AD_PROGRAMMER) and sets up two after-build commands to create the object files (program+eeprom) that's needed by avrdude.
now you can create and compile you project and with a slight click on the run button the program is transfered to your -c ;)


now the only left thing i dont like is the fact that an avr-project is set up as "console program" but it is not.. i'd like to see something like "Other" or "Foreign" there, just for optical reasons.

hope you enjoy the "run"->program feature as much as i do.
cu, ratatatata
« Last Edit: June 13, 2007, 07:04:24 pm by ratatatata »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5229
Re: avr-kit
« Reply #1 on: June 12, 2007, 10:34:53 pm »
hi thanks for the changes.
However could you make real patches for it on berlios. Things might get most in the forum.

Just to double check, is there any other avr user who can confirm that list of compiler options being removed ?
I ask now, so that when I remove them, the next day nobody starts complaining about the fact they are gone ;-)

@biblap or Martin : in case you read this. I will take care of the  source code changes, since you guys are more wizard experts can you take care of that part. I will do the source code changes either tomorrow evening or Thursday evening.
« Last Edit: June 12, 2007, 10:36:52 pm by killerbot »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9592
Re: avr-kit
« Reply #2 on: June 12, 2007, 11:16:35 pm »
Just to double check, is there any other avr user who can confirm that list of compiler options being removed ?
The trick is that all those option groups are replaced by single options where a string is replaced that has been setup by the wizard (or in the project options as it is a custom variable). So there is not really a reduction of options. But: I'm not sure if this is quite compatible. I understand why it's done (e.g. not to have a million -mmcu flags) but as it is now the compiler options rely on replacing the macros in the command line computation. I wonder what Yiannis thinks about that...?!

@biblap or Martin : in case you read this. I will take care of the  source code changes, since you guys are more wizard experts can you take care of that part.
Sure thing. I had spotted this topic already... ;-)

With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ratatatata

  • Single posting newcomer
  • *
  • Posts: 5
Re: avr-kit
« Reply #3 on: June 13, 2007, 06:47:47 pm »
hey, thanks for answering :)

However could you make real patches for it on berlios. Things might get most in the forum.
ok i've made a "real" patch, i updated my first post, but to correct wrong things i didnt submit it to berlios yet :)

I understand why it's done (e.g. not to have a million -mmcu flags) but as it is now the compiler options rely on replacing the macros in the command line computation.
yes, if i think about it again it's quite unhandy to have it built in in the compiler.
i've changed it, now the project-wizard adds a compileroption with "-mmcu" && "-DF_CPU". but this brings up another problem.. what if the compiler doesnt support -mmcu?
another solution would be to add a static compiler-option called "custom mcu" and "custom frequency" to the gnuavr compiler and just activate it via wizard, but this would ban custom compilers from the wizard as long as they weren't derived from the gnuavr compiler..

what do you think? :)

ps: i replaced the mcu-selection field + the f_cpu-selection field with an combobox for easier selecting the right values :)

mornevdw

  • Guest
Re: avr-kit
« Reply #4 on: August 28, 2007, 10:47:49 am »
Hi there,

Firstly, thanks for this! It great that you take the time to make life a little easier. ;)

I cant get the actual plug in from the link. :( Do you have a website or alternative download location?

Thanks in advance.

Offline Keyla

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: avr-kit
« Reply #5 on: August 31, 2007, 07:49:10 pm »
Thanks but I just can test it if it is migrated to the Nightly Builds because I have wether a compiling toolchain for CB nether a higher bandwith connection.