Target Doard Definition
I am evaluating CrossWorks and thus this question falls into the catagory of "getting the lay of the land" ...
I have defined a new Multi-Tasking project targeted at a board I made that uses an ATMega32A.
I notice in the file "ctl_avr.c" that it seems to have "knowledge" of board level items such as the PORT/DDR that an LED is connected to.
Since this is a "System File" I assume I am not supposed to alter it. How/Where does one tell CrossWorks that this does not exist or describe the existance of other items like this?
The docs on "packages" seem to alude to "boards" but I couldn't find anything about customizing the target except having to do with JTAG, etc.
Regards,
Chuck Hackett
-
You can edit the ctl_board.c file to match your own target. Right click on the file in the Project Explorer and select Import to make a local copy, if it's not local already.
The "board" files just define the set of services needed by the generic examples--usually something that will control a LED and respond to a button press using an interrupt.
-
(Still trying to find my way around)
(minor) When using "Add Existing File" I get a standard Windows Open Dialog rather than what is shown in Help but I assume that this is because the Help images are from a MAC or Unix?
I don't see ctl_board.c in Project Explorer -- I am trying to compile the bare minimum ctl template code (I have not added any code yet) and I am still getting compile errors on ctl_avr.c.
It appears that "ctl_avr.c" was derived from ctl_board.c (or is at least very similar). I hesitate to alter "System" files before I know my way around the product. I also hesitate to alter a "System" file because I would not get the benefit of any changes made to the file in future releases.
I started with the unaltered CTL template code to be sure I got a clean compile before I added any of my code. My errors are:
Line 64: TIMSK1 undefined
This is in an "else" on an "if defined(__TARGET_PROCESSOR_IS_XMEGA). Project properties correctly shows the target processor as "ATmega32A" which does not have a "TIMSK1" but does have a "TIMSK".
Line 104: EICRA undefined
Line 105: EIMSK undefined
These are within the "else" of a "#elif (__TARGET_PROCESSOR==ATmega32)". Again, the target processor is set to "ATmega32A".
I know how to fix these if I "Import" ctl_avr.c into the project but I hesitated to do so since it was a "System" file.
Does this file need to be updated by Rowley or is this a "commonly modified template only" and I should expect to modify it?
If so, I think this should be noted in the ctl doc (perhaps a section called "Creating a ctl project from scratch").
Please sign in to leave a comment.
Comments
3 comments