Fred's firmware development diary comments thread

Official FreeEMS vanilla firmware development, the heart and soul of the system!
User avatar
sry_not4sale
LQFP144 - On Top Of The Game
Posts: 568
Joined: Mon Mar 31, 2008 12:47 am
Location: New Zealand, land of the long white burnout
Contact:

Re: Fred's firmware development diary comments thread

Post by sry_not4sale »

Any chance of getting another "state of the onion" announcement Fred?
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
MotoFab
1N4001 - Signed up
Posts: 307
Joined: Thu May 29, 2008 1:23 am
Location: Long Beach CA

Re: Fred's firmware development diary comments thread

Post by MotoFab »

sry_not4sale wrote:Any chance of getting another "state of the onion" announcement Fred?
"Development continues under current fief." :D ;)
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

sry_not4sale wrote:Any chance of getting another "state of the onion" announcement Fred?
Yeah, it's overdue, along with diyefi.org site update, documentation updates, and various other things. I'm planning to write up the USA trip story at some point very soon (hoping that donations will feed me a little longer) and with that, I'll go and hammer all the forums that I'm a member of with updates, including that state of the onion thread.

JHarvey, work is continuing almost every day, it's just not necessarily obvious. SeanK has been doing heaps of compiler dev work, and I've been chatting to him regularly about that, and supporting him with changes on my side where required. Plus other little bits of work.

Marcos, I'd roll with them with less hesitation if they were free of the _t. We'll see, I'll have a think about it and make a decision some time. In the mean time, as noted, search and replace will solve this issue very quickly if ever required anyway.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
EssEss
LQFP112 - Up with the play
Posts: 244
Joined: Thu Sep 10, 2009 9:23 am
Location: Dayton, OH

Re: Fred's firmware development diary comments thread

Post by EssEss »

more of my 2c:

the _t is there to avoid collision since they usually reside in a .h. The .h is only file scope, but usually gets inserted across many translation units .. thus they end up more 'global' than intended most of the time.

From some real code:

you're more likely to get a collision from

Code: Select all

typedef unsigned long timer;
than:

Code: Select all

typedef unsigned long timer_t;
It's highly likely that someone is going to name one of their vars 'timer' and then they waste 3 days tracking down why their stuff breaks. Like I said before, it's usually the new guy that gets bit by this, so I do it for him :). Whatever you decide, staying consistent throughout the codebase is more important than haggling over type names.

In case you haven't noticed (I think you already have), typedef's don't get you any real static safety:

Code: Select all

timer_t
timerAddTo( timer_t t, 
            unsigned long val )
{
    return t + val;
}
You could probably figure out what can happen there. Someone goes off and calls it w/the args reversed. The compiler would never detect it, and your code would actually appear to work correctly (in this simplified example). But, to be pedantic, it is being called incorrectly.

Instead, I lean on typedefs for abstracting out an interface most of the time. Which is why the various int[xx]_t's serve as a nice platform independent abstraction for me even if I never have the goal of platform independence. Its pure habit at this point based on previous headaches.

As you already know, if someone codes to the interface you can always change the implementation in the future with minimal fuss.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

Sure, but the chances of someone naming their variable uint8 are slim to none, and slim just copped one from some n*****s 45! :-)

Thanks for the static type checking lesson, though. Good to know.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
sry_not4sale
LQFP144 - On Top Of The Game
Posts: 568
Joined: Mon Mar 31, 2008 12:47 am
Location: New Zealand, land of the long white burnout
Contact:

Re: Fred's firmware development diary comments thread

Post by sry_not4sale »

I just built FreeEMS with XGATE code in it! I estimate that we will have an XGATE release inside the next month. That would be cool :-) All credit to SeanK who has been working his arse off on this. See the Advanced section for more detail. Good work young padawan.
Excuse the ignorance, but what difference does XGATE make to the release?
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

It's a milestone, that's all. And, I found out after I posted, that I was lying anyway. It was linked with the XGATE tools, but didn't include the xgate code. I should have RTFM (Sean's email) more thoroughly... I'll try to make sure that happens today, though. I' love to see that LED flashing by XGATE power. XGATE will be key to doing as much as we have dreamed of, well.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
sry_not4sale
LQFP144 - On Top Of The Game
Posts: 568
Joined: Mon Mar 31, 2008 12:47 am
Location: New Zealand, land of the long white burnout
Contact:

Re: Fred's firmware development diary comments thread

Post by sry_not4sale »

This whiny bitch likes to stay informed!!! :P (thanks for the public update)
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

Seriously, I try to put everything vaguely important up, but you seem to want to know if I've sneezed on the board ;-) I'll try to keep enough stuff happening to justify posting and keep you happy ;-)
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
sry_not4sale
LQFP144 - On Top Of The Game
Posts: 568
Joined: Mon Mar 31, 2008 12:47 am
Location: New Zealand, land of the long white burnout
Contact:

Re: Fred's firmware development diary comments thread

Post by sry_not4sale »

Fred wrote:Seriously, I try to put everything vaguely important up, but you seem to want to know if I've sneezed on the board ;-) I'll try to keep enough stuff happening to justify posting and keep you happy ;-)
Even if you don't get much done, I think it's good for the community to see some sort of movement - even if it's "read some docs"
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
Post Reply