Updating .h etc files in project?

A forum for discussing the creation, modification, and loading of embedded code for B&G MS-I/MS-II.
Forum rules
Read the manual to see if your question is answered there before posting. Many users will not reply if the answer is already available in the manual.

If your question is about troubleshooting, configuration, or tuning, you MUST include your processor type (MS-I or MS-II) and code version in your post. If your question is about PCB assembly or modifications, you must also include the main board version number (1.01, 2.2 or 3.0).

If you have questions about MS1/Extra or MS2/Extra code configuration or tuning, please post them at www.msextra.com Such questions posted here will be moved to: a temporary MSextra sub-forum, where they will be removed after 7 days

The full forum rules are here: Forum Rules, be sure to read them all regularly.
Post Reply
GrahamB
MegaSquirt Newbie
Posts: 6
Joined: Wed Oct 20, 2010 12:25 pm

Updating .h etc files in project?

Post by GrahamB »

Hello,
I'm a noob, so please forgive some naivety...

I've just tried "make"ing the ver 2.891 code in the free version of Codewarrior 5.90
I get lots of undeclared variable and type mis-match errors. I fixed some of them by searching
the megamanual site and discovering that the timer variables pTC0 etc are defined in the
.h file directly linked here:
http://www.megamanual.com/ms2/hcs12def.h
but are named as TCO etc in the corresponding file in the zipped project download.

Are there other files that should be updated?

Some other stuff is hard to see as an update issue, ie pTIC and pTOC are defined as arrays of
pointers to volative unsigned shorts, but are assigned as though having one less level
of indirection, viz arrays of volatile unsigned shorts...

So what am I doing wrong :?:

Also, as a hint, just how much code would I need to junk to get below the 32k limit?
I can certainly live without knock sensing, flex fuel, EDIS and a lot of other trigger options
(this is for a uS going on a motorcycle with toothed wheel)... but will that be enough?
grippo
Site Admin
Posts: 286
Joined: Mon Feb 16, 2004 6:55 pm

Re: Updating .h etc files in project?

Post by grippo »

GrahamB wrote:Hello,
I'm a noob, so please forgive some naivety...

I've just tried "make"ing the ver 2.891 code in the free version of Codewarrior 5.90
I get lots of undeclared variable and type mis-match errors. I fixed some of them by searching
the megamanual site and discovering that the timer variables pTC0 etc are defined in the
.h file directly linked here:
http://www.megamanual.com/ms2/hcs12def.h
but are named as TCO etc in the corresponding file in the zipped project download.

Are there other files that should be updated?

Some other stuff is hard to see as an update issue, ie pTIC and pTOC are defined as arrays of
pointers to volative unsigned shorts, but are assigned as though having one less level
of indirection, viz arrays of volatile unsigned shorts...

So what am I doing wrong :?:

Also, as a hint, just how much code would I need to junk to get below the 32k limit?
I can certainly live without knock sensing, flex fuel, EDIS and a lot of other trigger options
(this is for a uS going on a motorcycle with toothed wheel)... but will that be enough?
I don't know anything about CW above V4.5, but the types of variables are what they are - I can't believe CW changed these conventions, unless it is to use uint8, uint16, etc instead of char and short - that makes sense. But other than this, you should not have to change anything. The p in PTOC means it is a pointer, so it would be set to an address directly and *pTOC means the value at the address. The only other thing I can think of is that the compiler often goes nuts after it finds one error, for example leaving out a ;, and spews out dozens of errors thereafter, all of which may be cleared when you correct the first error.

The biggest change when 4.5 came out was that all variables called tmpn, n=1,2,3,.. had to be renamed tmpxn to make it happy - evidently tmp became a reserved word.

Other files used are the cltfactor, matfactor, egofactor, etc, which are sensor calibrations.

With 2.89x code don't think it is that hard to get below the 32k. If you don't need CAN, I would start with that - its fairly large. Once you get a good compile, the compiler will tell you what the code size is.
Post Reply