From 8b5c64d903f4e77177b1649d88cd495d47997332 Mon Sep 17 00:00:00 2001 From: Fred Cooke Date: Tue, 18 May 2010 05:29:32 +1200 Subject: [PATCH] Factor out more code, adjust copyright dates and names. --- src/TunableConfig.c | 2 +- src/fuelAndIgnitionCalcs.c | 7 ++----- src/inc/TunableConfigs.h | 2 +- src/inc/injectorISR.c | 2 +- src/inc/interrupts.h | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/TunableConfig.c b/src/TunableConfig.c index 4d0554e..6f12c8c 100644 --- a/src/TunableConfig.c +++ b/src/TunableConfig.c @@ -1,6 +1,6 @@ /* FreeEMS - the open source engine management system * - * Copyright 2008, 2009 Fred Cooke + * Copyright 2008, 2009, 2010 Fred Cooke * * This file is part of the FreeEMS project. * diff --git a/src/fuelAndIgnitionCalcs.c b/src/fuelAndIgnitionCalcs.c index e0aca98..0fc85a4 100644 --- a/src/fuelAndIgnitionCalcs.c +++ b/src/fuelAndIgnitionCalcs.c @@ -1,6 +1,6 @@ /* FreeEMS - the open source engine management system * - * Copyright 2008, 2009 Fred Cooke + * Copyright 2008, 2009, 2010 Fred Cooke * * This file is part of the FreeEMS project. * @@ -130,10 +130,7 @@ void calculateFuelAndIgnition(){ } /* Reference PW for comparisons etc */ - unsigned short refPW = DerivedVars->FinalPW + DerivedVars->IDT; - if(DerivedVars->FinalPW > refPW){ /* If it's not larger, it overflowed */ - refPW = SHORTMAX; /* So max it out! */ - } + unsigned short refPW = safeAdd(DerivedVars->FinalPW, DerivedVars->IDT); DerivedVars->RefPW = refPW; /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ diff --git a/src/inc/TunableConfigs.h b/src/inc/TunableConfigs.h index cce39bc..e2b182a 100644 --- a/src/inc/TunableConfigs.h +++ b/src/inc/TunableConfigs.h @@ -1,6 +1,6 @@ /* FreeEMS - the open source engine management system * - * Copyright 2008, 2009 Fred Cooke + * Copyright 2008, 2009, 2010 Fred Cooke * * This file is part of the FreeEMS project. * diff --git a/src/inc/injectorISR.c b/src/inc/injectorISR.c index 6e6e8b4..157967f 100644 --- a/src/inc/injectorISR.c +++ b/src/inc/injectorISR.c @@ -1,6 +1,6 @@ /* FreeEMS - the open source engine management system * - * Copyright 2008, 2009 Fred Cooke + * Copyright 2008, 2009, 2010 Fred Cooke, Jared Harvey * * This file is part of the FreeEMS project. * diff --git a/src/inc/interrupts.h b/src/inc/interrupts.h index 2d90594..48fc68e 100644 --- a/src/inc/interrupts.h +++ b/src/inc/interrupts.h @@ -1,6 +1,6 @@ /* FreeEMS - the open source engine management system * - * Copyright 2008, 2009 Fred Cooke + * Copyright 2008, 2009, 2010 Fred Cooke, Jared Harvey * * This file is part of the FreeEMS project. * -- 2.11.4.GIT