forked from speeduino/speeduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes for getAdvance1, getAdvance2 & secondary tables. (speeduino…
…#1155) * Unit testability: split out definition of statuses struct. * Separate out getLoad() function * Bug Fix: getAdvance1() & getAdvance2() should return a signed value. * secondarytables.cpp - extract duplicate code into functions. * Bug fix: BIT_STATUS3_FUEL2_ACTIVE not set in 2 cases. * Performance: secondaryTables call percentage() (which is optimised) * Add secondary table tests * Bug Fix: do not correct secondary spark multiplier * Unit test no secondary spark with fixed timing. * MISRA fixes * Save memory: remove statuses::ignLoad2 & fuelLoad2 (unused) * Unit testability: split out definition of config page structs. * Make 3D table interpolation a const operation. * Unit testability: inject the tune & status. * Make the advance2 gauge work correctly in multiply mode * Secondary table tests - no global state * Secondary table tests: add additional spark multiply tests to cover speeduino#1274 --------- Co-authored-by: Josh Stewart <[email protected]>
- Loading branch information
1 parent
784c2ed
commit fbd1e4f
Showing
18 changed files
with
2,073 additions
and
1,428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
/** | ||
* @file | ||
* @brief Bit twiddling macros | ||
*/ | ||
|
||
/** @brief Set bit b (0-7) in byte a */ | ||
#define BIT_SET(var,pos) ((var) |= (1U<<(pos))) | ||
|
||
/** @brief Clear bit b (0-7) in byte a */ | ||
#define BIT_CLEAR(var,pos) ((var) &= ~(1U<<(pos))) | ||
|
||
/** @brief Is bit pos (0-7) in byte var set? */ | ||
#define BIT_CHECK(var,pos) !!((var) & (1U<<(pos))) | ||
|
||
/** @brief Toggle the value of bit pos (0-7) in byte var */ | ||
#define BIT_TOGGLE(var,pos) ((var)^= 1UL << (pos)) | ||
|
||
/** @brief Set the value ([0,1], [true, false]) of bit pos (0-7) in byte var */ | ||
#define BIT_WRITE(var, pos, bitvalue) ((bitvalue) ? BIT_SET((var), (pos)) : BIT_CLEAR((var), (pos))) |
Oops, something went wrong.