* Add optimized 32-bit shifting
* Tooth based time to angle coversion is only used by a few decoders.
So move the functions into decoders.cpp
* Better separation of deocders and crank maths.
* Apply optimised shifts
* Doxygen
* CAN WBO Support
* fix typo
* Change data handling
* add source repo information
* Added heater functionality and fixed value handling
* Missed 0
* Better condition handling and minor fixes to multiplication
* Remove code duplication
* fix
* Error fixing and correct address of controller for outgoing frames
* Page layout adjustment
* fix
* Second WBO added to be used in TS / MLV
* Add extended flag to out frame
* Functional test and fixes
* typo
* CAN WBO Support
fix typo
Change data handling
add source repo information
Added heater functionality and fixed value handling
Missed 0
Better condition handling and minor fixes to multiplication
Remove code duplication
fix
Error fixing and correct address of controller for outgoing frames
Page layout adjustment
fix
Second WBO added to be used in TS / MLV
Add extended flag to out frame
Add support for BlitzBox hardware in speeduino firmware (#1148)
* Add support for BlitzBox in init.cpp
added case 42 for BlitzBox support
* Added support for Blitzbox to speeduino.ini
Added support for Blitzbox to speeduino.ini to get an ECU entry in Tunerstudio
* Enabled spare pins in pin layout
Functional test and fixes
typo
Fix issue with LED indicator not working when MC33810 was in use
Resolve issue with Teensy not sending CAN msgs
Fix regression on MC33810 units from af2815d818
Added check for AFR greater than 25.5
Added overflow check of O2 value
Code clean up
Bump actions/upload-artifact from 3 to 4 (#1149)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Spelling and typo correction
missing space
* Fix possible overflow
* Allow for future CAN based WBO modules to be added
* rusEFI case as requested.
* fix
* CAN WBO Support
* fix typo
* Change data handling
* add source repo information
* Added heater functionality and fixed value handling
* Missed 0
* Better condition handling and minor fixes to multiplication
* Remove code duplication
* fix
* Error fixing and correct address of controller for outgoing frames
* Page layout adjustment
* fix
* Second WBO added to be used in TS / MLV
* Add extended flag to out frame
* Functional test and fixes
* typo
* Allow for future CAN based WBO modules to be added
* CAN WBO Support
fix typo
Change data handling
add source repo information
Added heater functionality and fixed value handling
Missed 0
Better condition handling and minor fixes to multiplication
Remove code duplication
fix
Error fixing and correct address of controller for outgoing frames
Page layout adjustment
fix
Second WBO added to be used in TS / MLV
Add extended flag to out frame
Add support for BlitzBox hardware in speeduino firmware (#1148)
* Add support for BlitzBox in init.cpp
added case 42 for BlitzBox support
* Added support for Blitzbox to speeduino.ini
Added support for Blitzbox to speeduino.ini to get an ECU entry in Tunerstudio
* Enabled spare pins in pin layout
Functional test and fixes
typo
Fix issue with LED indicator not working when MC33810 was in use
Resolve issue with Teensy not sending CAN msgs
Fix regression on MC33810 units from af2815d818
Added check for AFR greater than 25.5
Added overflow check of O2 value
Code clean up
Bump actions/upload-artifact from 3 to 4 (#1149)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Spelling and typo correction
missing space
* rusEFI case as requested.
* Revert "Merge branch 'master' of https://github.com/dynfer/speeduino"
This reverts commit 49dc0eab08, reversing
changes made to 56abc79008.
* fix merge
* fixes
* Added overflow prevention
* Final
---------
Co-authored-by: Josh Stewart <josh@noisymime.org>
* initialiseSchedulers: factor out shared code.
* Proxy setFuelSchedule\d through generic
setFuelSchedule() function
* Directly call setFuelSchedule
* Simplify unit tests
* Proxy setIgnitionSchedule\d through generic
setIgnitionSchedule() function
* Directly call setIgnitionSchedule
* Simplify unit tests
* Optimize by partially inlining
the set[Fuel|Ignition]Schedule funcs
* Use the embedded schedule compare
& counter members instead of using
hardcoded individual channel macros.
* Unit test adjustCrankAngle
* Add udiv_32_16
* Apply udiv_32_16() where possible
* Convert udiv_32_16 to assembler
It's worth 20 loop/s
* Remove unused functions
* Remove degreesPeruSx2048 - unused
* Remove angleToTime - replace with direct calls
1. Drop angleToTime()
It's slow, only partially implemented and adds zero value
(and has MISRA violations)
2. Consistent function naming
3. Doxygen
* triggerPri_Nissan360 shouldn't set timePerDegree.
It will be overwritten every loop by doCrankSpeedCalcs()
* Use angleToTimeMicroSecPerDegree() instead of timePerDegree
No loss in performance
Increased injection open/close time accuracy (so unit test values must change)
Can remove timePerDegree global.
* Hide (encapsulate) crank math globals.
* Base all angle to time conversions on decoder computed variables.
This is within 2us of the revolution based method
and is much faster - which is essentially zero percent change.
* Performance: move calculation of degreesPeruSx32768
into decoders.
Remove doCrankSpeedCalcs() - it's doing nothing
at the moment.
* Apply libdivide to triggerSetEndTeeth functions.
Since triggerToothAngle is set once at initialization
time, we can generate the libdivide struct
once and reuse it many times.
* Remove lastToothCalcAdvance - unused
* Replace 16-bit division with shift
* Replace 32-bit divison with 16-bit division
* Avoid 32-bit division; use div100()
* inline percentage()
* Optimize div100()
* MISRA fixes
* Replace magic numbers with #defs
* Replace libdivide structs with inline constants
No perf or memory changes
* Use fixed types for PWM max count variables
* Accurate rounded integer division
* Formalise rounding behavior (DIV_ROUND_CORRECT)
* Apply DIV_ROUND_CORRECT to DIV_ROUND_CLOSEST(),
UDIV_ROUND_CLOSEST(), div100(), div360(),
percentage() & halfPercentage()
* Add, fix & improve unit tests
* Add udiv_32_16_closest()
* Perf: Limit percentage calculations to 16-bits
* MISRA fixes
* Add compare_executiontime() to encapsulate common perf testing code
* Signed to unsigned division
* Convert ignitionLimits() to an inline function.
Slight speed up, probably due to removing
multiple evaluations of macro arguments.
* Split unit tests up.
* udiv_32_16 - check for valid parameters
* calculateInjector1Timeout proxies calculateInjectorNTimeout
Unit test still pass.
* Remove calculateInjector1Timeout,
Replace with call to calculateInjectorTimeout
All unit tests still pass.
* Remove unecassary unit test
* calculateIgnition1Timeout proxies calculateIgnitionNTimeout
Unit test all pass
* Remove calculateIgnition1Timeout,
Replace with call to calculateIgnitionTimeout
All unit tests still pass.
* Remove unecassary unit test
* calculateIgnitionAngle\d proxies
calculateIgnitionAngle
Unit tests all pass
* Remove calculateIgnitionAngle\d
Just call calculateIgnitionAngle() directly
* Route rotary ignition angle calcs
through generic calculateIgnitionTrailingRotary
function.
* Remove calculateIgnitionAngle\d
Just call calculateIgnitionTrailingRotary() directly
* calculateInjectorStartAngle: inject all parameters
Do not rely on global state
Easier unit testing.
* calculateIgnitionAngle: inject all parameters
Do not rely on global state
Easier unit testing.
* Pull all ignition global vars into schedule_calcs
* Conditional compile for schedule calc vars
Saves memory
* Optimize: break out angleToTimeIntervalRev
from angleToTime. The new function will
always be inlined.
* Optimize - simpler code path
when no channel offset (zero)
Some optimization of arithmetic operations.
* Fix unit tests
* Fix bug on injector angle calculations
Need while loops to correctly bring intermediate
values into range
---------
Co-authored-by: Josh Stewart <josh@noisymime.org>
* Added a 1000Hz call for MAP reading on ARM cores
* Use 1kHz section for map reads on all MCUs
---------
Co-authored-by: Josh Stewart <josh@noisymime.org>
* adding VVT logging and trigger edge editing
fix missing define (temp fix?)
Revert "fix missing define (temp fix?)"
This reverts commit c6280f38ff69cc41278148a79c888736a71754b1.
fixes
* Create an additional logger screen in tunerstudio
Changes to create a third high speed logger window in tuner studio.
* Change variable name
Discord discussion requested compositeLogEnabled didn't do a test for false as the type is now a byte. Variable renamed to be compositeTriggerUsed and false replaced with 0. Variable name and values used should now make more logical sense.
* added more logging
Log the primary, secondary and third inputs as well as engine cycle on all composite logs. Still have 3 different logs to allow you to visualise which is the best way to present the information.
* Read analog values via CAN BUS
Allows reading of 16 analog signals via CAN-BUS. with selection of Edianness.
* Moved function
Function moved to improve data readability.
---------
Co-authored-by: Josh Stewart <josh@noisymime.org>
* Refactor: separate out schedule calcs from speeduino.ino
(so they can be unit tested)
* Add unit tests for compute_delay
* Use PROGMEM to store test input & output
* Add some 720 unit tests
* Rename unit test file
* Test ignition codepaths 2-8
* Test ign1 calcs
* Add first injector calc tests
* Add 720 deg tests
Simplify
* Simplify test_calc_inj1_timeout
* Claw back RAM
* Simplify test framework
Channel angle is part of the test data set.
* Move schedule calculation unit tests into their own harness
Competing for RAM with the rest of Speeduino
can cause them to fail,
* Performance: inline all schedule calcs.
* Unit test end angle
* Unit test calculateIgnitionAngle1
* Test start angles also
And test end angles for channel 1
* Unit test calculateIgnitionAngle3
* Unit test calculateIgnitionAngle4
* Improve unit test output
* Add Nissan360 decoder unit tests.
* Add Ford ST170 decoder unit tests
* Add NGC decoder unit tests
* Remove serialCRC - only used within parseSerial()
Also hoist the CRC read into a function.
* Minimize global variable visibility
* Encapsulate write of multi-byte primitives
* Factor out sendBufferAndCrc()
* Push safety test into TS_CommandButtonsHandler()
* Extract writePage()
* Simpler parsing
* Remove some functions from public interface
* Store constant arrays in progmem
* Centralize high speed logger start/stop code
* Factor out loadO2Calibration()
* Factor out temperature calibration table update functions
* Remove dead code
* Fix sendToothLog()
* Fix sendCompositeLog()
* Replace tooth log send booleans with an enum
Saves a byte
* Remove sendBufferAndCrcProgMem()
Use serialPayload to send
* Whitespace clean up
* Optimize comms.cpp for size
* Replace global unsigned long with bool
Saves 2 bytes
* Replace 2 global bools with an enum
Saves a byte, reads better.
* Remove global FastCRC instance
* Make sendSerialReturnCode blocking.
It was using non-blocking functions but was never
re-entered.
Rename to make blocking & non-blocking calls
more obvious.
* Use one uint16_t to track RX/TX byte count
* Simplify new comms log tx API
* Extract loadPageToBuffer function
* All endianess changes use the same code
* Doxygen comments and code organization
* Remove serialWriteUpdateCrc() & updateTmpCalibration()
* Combine SerialStatus & logSendStatus enums.
Makes sense since we can only be doing one thing at a time.
* Remove global inProgressCompositeTime
Only used when sending composite log
* Replace 3 global bools with expanded SerialStatus enum
* Remove unused global tsCanId
* Limit scope of some comms globals.
* Remove isMap global - replace witth function
* Reduce the serial API to only 2 calls
transmit & receive
* Tidy up #define visibility
* Fix Black* build errors
* Workaround Teensy code race condition
availableForWrite() is not reliable.
* Prevent race condition
Was pematurely setting the serialStatusFlag to
SERIAL_INACTIVE before final CRC ws read from
serial.
* Use post write buffer availability checks
Remove buffer size check prior to writing.
* Write multi-byte values as single bytes.
(attempt to fix Teensy 3.5 issue)
* Only use Serial.available() as a boolean test
(Teensy fix)
* writeNonBlocking checks Serial.write() return value
* Non-blocking CRC write
In sendBufferAndCrcNonBlocking().
* Fix compile warning
* Set serial status flag prior to transmitting!
* Reliable blocking byte writes.
* Fix timeout code: not firing under some conditions
* MISRA fixes