Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for getAdvance1, getAdvance2 & secondary tables. #1155

Merged
merged 18 commits into from
Jan 9, 2025

Conversation

adbancroft
Copy link
Collaborator

@adbancroft adbancroft commented Dec 24, 2023

Fixes #1152
Fixes #1153
Fixes #1154
Fixes #1274

Details:
In addition to the bug fixes:

  1. Add full unit tests for calculateSecondaryFuel() & calculateSecondarySpark()
  2. Unit testability: split out the definition of statuses, page structs & bit fiddling from globals.h into separate header files (statuses.h, config_pages, bit_manip.h).
  • This allows code to have a dependency on the struct definitions without pulling in global state.
  • In turn, this allows code to have the current status & page structs injected.
  • Which allows unit testing independent of the global state. So no random side effects, no calls to initialiseAll() & opens up a path to generating unit test coverage
  1. Extract copy/paste code from getVE[1|2] & getAdvance[1|2] into shared getLoad() function (load_source.h)
  2. Refactor calculateSecondaryFuel() & calculateSecondarySpark() to remove duplicate code blocks.
  3. Fix all MISRA violations in secondaryTables.cpp
  4. Make the advance2 gauge work correctly in multiply mode: units & gauge range/warnings are different from other modes

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch 2 times, most recently from 4c8da52 to ee9b085 Compare January 17, 2024 03:50
@noisymime noisymime added bug tests Related to unit tests labels Feb 5, 2024
@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from ee9b085 to f3db0ec Compare February 26, 2024 05:54
@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch 2 times, most recently from f3da482 to 6ad068e Compare April 10, 2024 23:15
@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 6ad068e to 02413d4 Compare June 5, 2024 04:43
@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 02413d4 to 7a24140 Compare July 19, 2024 05:28
@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 7a24140 to 7550703 Compare July 31, 2024 05:36
@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 7550703 to ec54366 Compare September 24, 2024 20:43
Copy link

Memory usage change @ ec54366

Board flash % RAM for global variables %
arduino:avr:mega 💚 -320 - -320 -0.13 - -0.13 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF4 🔺 +176 - +176 +0.03 - +0.03 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +448 - +448 +0.09 - +0.09 🔺 +8 - +8 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -320 -0.13 0 0.0
STMicroelectronics:stm32:GenF4 176 0.03 0 0.0
teensy:avr:teensy35 448 0.09 8 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-320,-0.13,0,0.0
STMicroelectronics:stm32:GenF4,176,0.03,0,0.0
teensy:avr:teensy35,448,0.09,8,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from ec54366 to f6ce42a Compare September 30, 2024 23:23
Copy link

Memory usage change @ f6ce42a

Board flash % RAM for global variables %
arduino:avr:mega 💚 -312 - -312 -0.12 - -0.12 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF4 🔺 +176 - +176 +0.03 - +0.03 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +448 - +448 +0.09 - +0.09 🔺 +8 - +8 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -312 -0.12 0 0.0
STMicroelectronics:stm32:GenF4 176 0.03 0 0.0
teensy:avr:teensy35 448 0.09 8 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-312,-0.12,0,0.0
STMicroelectronics:stm32:GenF4,176,0.03,0,0.0
teensy:avr:teensy35,448,0.09,8,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from f6ce42a to e12d99c Compare October 1, 2024 04:19
Copy link

github-actions bot commented Oct 1, 2024

Memory usage change @ e12d99c

Board flash % RAM for global variables %
arduino:avr:mega 💚 -672 - -672 -0.26 - -0.26 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF4 🔺 +184 - +184 +0.04 - +0.04 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +384 - +384 +0.07 - +0.07 🔺 +8 - +8 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -672 -0.26 0 0.0
STMicroelectronics:stm32:GenF4 184 0.04 0 0.0
teensy:avr:teensy35 384 0.07 8 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-672,-0.26,0,0.0
STMicroelectronics:stm32:GenF4,184,0.04,0,0.0
teensy:avr:teensy35,384,0.07,8,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from e12d99c to f6f58d8 Compare December 14, 2024 16:45
Copy link

Memory usage change @ f6f58d8

Board flash % RAM for global variables %
arduino:avr:mega 💚 -524 - -524 -0.21 - -0.21 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +384 - +384 +0.07 - +0.07 0 - 0 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -524 -0.21 0 0.0
teensy:avr:teensy35 384 0.07 0 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-524,-0.21,0,0.0
teensy:avr:teensy35,384,0.07,0,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from f6f58d8 to 719ca0b Compare December 14, 2024 17:04
Copy link

Memory usage change @ 719ca0b

Board flash % RAM for global variables %
arduino:avr:mega 💚 -524 - -524 -0.21 - -0.21 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF4 🔺 +192 - +192 +0.04 - +0.04 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +384 - +384 +0.07 - +0.07 0 - 0 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -524 -0.21 0 0.0
STMicroelectronics:stm32:GenF4 192 0.04 0 0.0
teensy:avr:teensy35 384 0.07 0 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-524,-0.21,0,0.0
STMicroelectronics:stm32:GenF4,192,0.04,0,0.0
teensy:avr:teensy35,384,0.07,0,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 719ca0b to d11a8c3 Compare December 18, 2024 15:24
Copy link

Memory usage change @ d11a8c3

Board flash % RAM for global variables %
arduino:avr:mega 💚 -524 - -524 -0.21 - -0.21 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF4 🔺 +192 - +192 +0.04 - +0.04 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +384 - +384 +0.07 - +0.07 0 - 0 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -524 -0.21 0 0.0
STMicroelectronics:stm32:GenF4 192 0.04 0 0.0
teensy:avr:teensy35 384 0.07 0 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-524,-0.21,0,0.0
STMicroelectronics:stm32:GenF4,192,0.04,0,0.0
teensy:avr:teensy35,384,0.07,0,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from d11a8c3 to c0c81b3 Compare December 23, 2024 15:01
Copy link

Memory usage change @ c0c81b3

Board flash % RAM for global variables %
arduino:avr:mega 💚 -304 - -304 -0.12 - -0.12 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF4 🔺 +160 - +160 +0.03 - +0.03 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +384 - +384 +0.07 - +0.07 0 - 0 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -304 -0.12 0 0.0
STMicroelectronics:stm32:GenF4 160 0.03 0 0.0
teensy:avr:teensy35 384 0.07 0 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-304,-0.12,0,0.0
STMicroelectronics:stm32:GenF4,160,0.03,0,0.0
teensy:avr:teensy35,384,0.07,0,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from c0c81b3 to 98dd891 Compare December 23, 2024 16:33
Copy link

Memory usage change @ 98dd891

Board flash % RAM for global variables %
arduino:avr:mega 💚 -304 - -304 -0.12 - -0.12 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF4 🔺 +76 - +76 +0.01 - +0.01 0 - 0 0.0 - 0.0
teensy:avr:teensy35 🔺 +192 - +192 +0.04 - +0.04 0 - 0 0.0 - 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -304 -0.12 0 0.0
STMicroelectronics:stm32:GenF4 76 0.01 0 0.0
teensy:avr:teensy35 192 0.04 0 0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-304,-0.12,0,0.0
STMicroelectronics:stm32:GenF4,76,0.01,0,0.0
teensy:avr:teensy35,192,0.04,0,0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 98dd891 to a2f7c17 Compare December 30, 2024 04:57
Copy link

Memory usage change @ a2f7c17

Board flash % RAM for global variables %
arduino:avr:mega 💚 -120 - -120 -0.05 - -0.05 💚 -3 - -3 -0.04 - -0.04
teensy:avr:teensy35 🔺 +64 - +64 +0.01 - +0.01 💚 -8 - -8 -0.0 - -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -120 -0.05 -3 -0.04
teensy:avr:teensy35 64 0.01 -8 -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-120,-0.05,-3,-0.04
teensy:avr:teensy35,64,0.01,-8,-0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from a2f7c17 to 7caf754 Compare December 30, 2024 14:11
Copy link

Memory usage change @ 7caf754

Board flash % RAM for global variables %
arduino:avr:mega 💚 -28 - -28 -0.01 - -0.01 💚 -3 - -3 -0.04 - -0.04
STMicroelectronics:stm32:GenF4 🔺 +60 - +60 +0.01 - +0.01 💚 -4 - -4 -0.0 - -0.0
teensy:avr:teensy35 🔺 +64 - +64 +0.01 - +0.01 💚 -8 - -8 -0.0 - -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -28 -0.01 -3 -0.04
STMicroelectronics:stm32:GenF4 60 0.01 -4 -0.0
teensy:avr:teensy35 64 0.01 -8 -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-28,-0.01,-3,-0.04
STMicroelectronics:stm32:GenF4,60,0.01,-4,-0.0
teensy:avr:teensy35,64,0.01,-8,-0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 7caf754 to 671d4d9 Compare December 31, 2024 17:13
Copy link

Memory usage change @ 671d4d9

Board flash % RAM for global variables %
arduino:avr:mega 💚 -76 - -76 -0.03 - -0.03 💚 -3 - -3 -0.04 - -0.04
STMicroelectronics:stm32:GenF4 🔺 +20 - +20 0.0 - 0.0 💚 -4 - -4 -0.0 - -0.0
teensy:avr:teensy35 🔺 +64 - +64 +0.01 - +0.01 💚 -8 - -8 -0.0 - -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -76 -0.03 -3 -0.04
STMicroelectronics:stm32:GenF4 20 0.0 -4 -0.0
teensy:avr:teensy35 64 0.01 -8 -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-76,-0.03,-3,-0.04
STMicroelectronics:stm32:GenF4,20,0.0,-4,-0.0
teensy:avr:teensy35,64,0.01,-8,-0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 671d4d9 to 80d6c8c Compare December 31, 2024 17:36
Copy link

Memory usage change @ 80d6c8c

Board flash % RAM for global variables %
arduino:avr:mega 💚 -76 - -76 -0.03 - -0.03 💚 -3 - -3 -0.04 - -0.04
STMicroelectronics:stm32:GenF4 🔺 +20 - +20 0.0 - 0.0 💚 -4 - -4 -0.0 - -0.0
teensy:avr:teensy35 🔺 +64 - +64 +0.01 - +0.01 💚 -8 - -8 -0.0 - -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -76 -0.03 -3 -0.04
STMicroelectronics:stm32:GenF4 20 0.0 -4 -0.0
teensy:avr:teensy35 64 0.01 -8 -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-76,-0.03,-3,-0.04
STMicroelectronics:stm32:GenF4,20,0.0,-4,-0.0
teensy:avr:teensy35,64,0.01,-8,-0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from 80d6c8c to a0d9149 Compare January 1, 2025 06:54
Copy link

github-actions bot commented Jan 1, 2025

Memory usage change @ a0d9149

Board flash % RAM for global variables %
arduino:avr:mega 💚 -402 - -402 -0.16 - -0.16 💚 -3 - -3 -0.04 - -0.04
STMicroelectronics:stm32:GenF4 🔺 +20 - +20 0.0 - 0.0 💚 -4 - -4 -0.0 - -0.0
teensy:avr:teensy35 🔺 +128 - +128 +0.02 - +0.02 💚 -8 - -8 -0.0 - -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -402 -0.16 -3 -0.04
STMicroelectronics:stm32:GenF4 20 0.0 -4 -0.0
teensy:avr:teensy35 128 0.02 -8 -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-402,-0.16,-3,-0.04
STMicroelectronics:stm32:GenF4,20,0.0,-4,-0.0
teensy:avr:teensy35,128,0.02,-8,-0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@adbancroft adbancroft force-pushed the bugfix-getAdvance-secondary branch from a0d9149 to ecf2df6 Compare January 1, 2025 20:28
Copy link

github-actions bot commented Jan 1, 2025

Memory usage change @ ecf2df6

Board flash % RAM for global variables %
arduino:avr:mega 💚 -402 - -402 -0.16 - -0.16 💚 -3 - -3 -0.04 - -0.04
STMicroelectronics:stm32:GenF4 🔺 +20 - +20 0.0 - 0.0 💚 -4 - -4 -0.0 - -0.0
teensy:avr:teensy35 🔺 +128 - +128 +0.02 - +0.02 💚 -8 - -8 -0.0 - -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report table
Board speeduino
flash
% speeduino
RAM for global variables
%
arduino:avr:mega -402 -0.16 -3 -0.04
STMicroelectronics:stm32:GenF4 20 0.0 -4 -0.0
teensy:avr:teensy35 128 0.02 -8 -0.0
teensy:avr:teensy41 N/A N/A N/A N/A
Click for full report CSV
Board,speeduino<br>flash,%,speeduino<br>RAM for global variables,%
arduino:avr:mega,-402,-0.16,-3,-0.04
STMicroelectronics:stm32:GenF4,20,0.0,-4,-0.0
teensy:avr:teensy35,128,0.02,-8,-0.0
teensy:avr:teensy41,N/A,N/A,N/A,N/A

@noisymime noisymime merged commit fbd1e4f into speeduino:master Jan 9, 2025
8 checks passed
@adbancroft adbancroft deleted the bugfix-getAdvance-secondary branch January 9, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tests Related to unit tests
Projects
None yet
2 participants