Code::Blocks Forums

User forums => Embedded development => Topic started by: invexceptn on April 16, 2013, 11:20:34 am

Title: F_CPU not visible/changeable in project settings
Post by: invexceptn on April 16, 2013, 11:20:34 am
I'm using C::B for AVR development and, having created a new project with a given MCU type & CPU speed, i wonder how i can change the clock speed of that project lateron. From the build log i do see that the project gets compiled with the correct -DF_CPU=12000000UL setting, but nowhere neither in the general nor the project compiler settings i can see a tiny trace of a particular #define entry for the clock speed.

Looking into the projects. .cbp file i can clearly see the entry for F_CPU with the correct value and as a workaround i can quit C::B and change the setting in the .cbp file, then firing C::B up again, and it now would use the changed setting, but from what i can see, this entry in the .cbp file never makes it into the #defines tab in the compiler options page. Adding an entry in the #defines tab will lead to a warning "F_CPU redefined".

Did i oversee something, is this intended behaviour, other ways to change it?

Thanks a lot!
Title: Re: F_CPU not visible/changeable in project settings
Post by: oBFusCATed on April 16, 2013, 11:47:49 am
Look at Projects->Build options it is there if you have it in the cbp file.
Title: Re: F_CPU not visible/changeable in project settings
Post by: invexceptn on April 16, 2013, 02:32:30 pm
Sorry to disagree, but having spent quite a while in the project settings, especially in the compiler settings page, including the tab labeled "#defines" i can assure you that the is nothing/nil/nada/rien in there, neither in the general settings nor in the project-specific settings.
Title: Re: F_CPU not visible/changeable in project settings
Post by: oBFusCATed on April 16, 2013, 03:32:10 pm
If you have it in the cbp file, then you can edit it in GUI.
If you don't believe me you can post the cbp file and I'll tell you where you can find the option.  ::)
Title: Re: F_CPU not visible/changeable in project settings
Post by: invexceptn on April 16, 2013, 03:47:57 pm
Well, it's not a matter of not believing you, i always try to take a statement of a 4star forum poster as being dominating about my personal faults. But, while i would love to believe you, this is not a religion thing, and i'm more of a facts-driven type. So, i simply do not see (not by overlooking obvious things, but due to the fact that they aren't there) any entry in any of the setup pages. As i said, adding an entry in the #defines tab, i.e. -DF_CPU=12000000UL, leads to a warning of duplicate definitions, but the #defines tab has been totally empty before i added the above line.

My cbp file is attached below, had to rename it to .txt... I see that the clock setting is describved as being an option, but on the options tab there's nothing as well.

Oooops: just saw that you're a 5star poster! :-)
Title: Re: F_CPU not visible/changeable in project settings
Post by: oBFusCATed on April 16, 2013, 04:03:14 pm
Project -> Build options -> Select the root of the tree on the left -> Compiler settings -> Defines (or Other settings)
Title: Re: F_CPU not visible/changeable in project settings
Post by: scarphin on April 16, 2013, 04:06:40 pm
I don't know what the old clock setting is but I can see a 'F_CPU=8000000UL' under 'project->build options->compiler settings->defines' for the global settings (that's the project name is chosen in the left folder structure like box) if that's what you are looking for.
Title: Re: F_CPU not visible/changeable in project settings
Post by: invexceptn on April 16, 2013, 04:12:48 pm
Does the attached picture count as a proof? As i said (several times), it's not a matter of my old eyes, there simply IS no such entry anywhere. Sigh, how can i make you believe me?
Title: Re: F_CPU not visible/changeable in project settings
Post by: oBFusCATed on April 16, 2013, 04:35:27 pm
It is a proof that you've not clicked on the root of the tree - 'I2CDisp' in your case :)
Click and then inspect the options again.
Title: Re: F_CPU not visible/changeable in project settings
Post by: invexceptn on April 16, 2013, 04:45:15 pm
Aaargh! I was about to argue that i indeed DID click on the project name, when i recognized that we spoke about different things. I thought you meant the project name in the tree-structured workspace of the C::B main window, whereas you were talking about clicking on the project name in the build options window. Doing this i can also see (finally) the F_CPU entry!

Ok guys, thanks for the patience, thanks for the help, owe you a german beer!

-- Thilo