Commit Graph

2858 Commits

Author SHA1 Message Date
Josh Stewart 3aa9aec13f Update contributing file. Fixes #1004 2023-04-24 15:15:09 +10:00
Pasi Kemppainen 8c3c416f7a
Remove duplicates (#1027) 2023-04-24 11:53:42 +10:00
Josh Stewart d0286fe02d Ensure that output port manipulations are done atomically. Fixes #972 2023-04-24 10:30:51 +10:00
Josh Stewart 90530f65a3 Handle 3 cylinder, non-seq, staging with >= 6 fuel channels 2023-04-16 17:20:39 +10:00
Josh Stewart f32efa7aee Fix for cranking and fixed timing not being applied when secondary spark table in use 2023-04-16 17:19:33 +10:00
Josh Stewart 6987c966f6 Fixes for regressions in the new staging code 2023-04-13 16:35:47 +10:00
Josh Stewart b8b9cc2780 Set pin trigger hysteresis on T4.1 2023-04-08 08:36:14 +10:00
tx_haggis 8794f51550
Fix single cylinder staging configuration (#1028) 2023-04-07 10:03:06 +10:00
Josh Stewart a309659b69 Warnings cleanup. Fixes #1026 #1025 2023-03-30 14:29:38 +11:00
Josh Stewart 1c5ae26d7b Revert "Fix for hang on uninitialised Teensy 41 boards under some conditions"
This reverts commit 0cff612b01.
2023-03-27 16:59:50 +11:00
Josh Stewart 31b18b5078 Fix for hang on uninitialised Teensy 41 boards under some conditions 2023-03-27 16:59:44 +11:00
Josh Stewart 0cff612b01 Fix for hang on uninitialised Teensy 41 boards under some conditions 2023-03-27 16:57:56 +11:00
Josh Stewart e5e46b1d73 Add serial compatibility mode option 2023-03-23 11:05:10 +11:00
Josh Stewart 1886eb3861 Honour the Inverted ignition output setting on boards using MC33810. Fixes #1021 2023-03-16 13:49:59 +11:00
Josh Stewart 05e3ebeea3 Add power cycle warning for oil and fuel pressure. Fixes #1017 2023-03-14 11:59:44 +11:00
DeionSi e99a9e52f1
Remove unused temp sensor calibration option (#1005) 2023-03-14 11:43:21 +11:00
tx_haggis 0afffb2ca0
Unit test the schedule calculations (#1010)
* 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
2023-03-06 17:23:17 +11:00
Josh Stewart 311cae3fac Allow fuel staging up to 8 total fuel channels (All reasonable combinations) 2023-03-06 16:49:30 +11:00
Pasi Kemppainen 3411917180
Accurate RPM conversion for BMW CAN broadcast (#1012)
* Adjust RPM conversion.

Change the BMW can broadcast RPM conversion to accurate calculation.

* no signed ints

Whoopsie. Non of these are signed values.
2023-02-28 19:48:17 +11:00
Josh Stewart 560764e50b Fix for potential timing issue running dual wheel, sequential at cam speed 2023-02-28 15:02:07 +11:00
tx_haggis f95b4978cd
Refactor comms: save 130+ bytes RAM (#906)
* 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
2023-02-21 12:55:54 +11:00
tx_haggis 0e19fc86bc
Sync mode changes: fuel shouldn't impact ignition (#1009)
This would mess with a combo of sequential fuel
and wasted spark.
2023-02-20 09:15:13 +11:00
tx_haggis d7d44014bf
Correct the get3DTableValue() return type. (#1007)
The core interpolation function returns table3d_value_t
2023-02-14 07:43:45 +11:00
DeionSi 2312102d4b
Replace 8 channelXInjEnabled variables with 1 (#1001) 2023-02-06 11:48:11 +11:00
Josh Stewart 6f61bd3ee6 Allow staged fuel table mode to work with TPS load
Fixes #998
2023-02-03 10:16:57 +11:00
DeionSi 84cc382b17
Duplicate engine_constants dialog (#997) 2023-02-01 14:24:26 +11:00
DeionSi 1b52719caf
Make curGap3 variable local. It's only used in one trigger. Also remove unused curTime3 variable. (#980) 2023-01-30 15:32:09 +11:00
DeionSi b2a3fdd88d
Add Lambda options for EGO correction and Nitrous leanest AFR (#993)
* Added Lambda option for EGO correction. Same fields, just another way to view and set them.

* Added Lambda option for Nitrous Leanest AFR. Same field, just another way to view and set it.
2023-01-30 15:22:15 +11:00
DeionSi 41352d22bf
Add lambdaTable and memory map to afrTable (#988)
* Add and memory map lambdaTable to afrTable

* Remove extra lambdaTargetTables entry
2023-01-30 14:20:14 +11:00
DeionSi 9a03a91261
Use separate afrProtectDeviationLambda constant memory-mapped onto afrProtectDeviation (#989)
* Use separate afrProtectDeviationLambda constant memory-mapped onto afrProtectDeviation

* 3 decimal accuracy for Lambda

* Add default for afrProtectDeviationLambda
2023-01-30 14:18:52 +11:00
DeionSi 6df8162897
Scale AFR gauge warnings by stoichiometric ratio (#986) 2023-01-30 14:13:46 +11:00
wonder99 ee0818d982
Add Tacho Sweep function at startup (#935) 2023-01-11 14:27:16 +09:00
tx_haggis 3595634bd2
Table3D: MISRA fixes (#973) 2023-01-11 10:58:48 +09:00
Josh Stewart a311c37e31 Fix README badges
See https://github.com/badges/shields/issues/8671
2023-01-10 08:59:01 +09:00
Pasi Kemppainen 11313ba440
Fix decel in AE Add -mode (#971) 2023-01-10 08:46:34 +09:00
DeionSi fec50e9db7
Fix reset lock indicator for always on (#951) 2023-01-09 21:55:31 +09:00
DeionSi 3495877d0f
Tests failing due to out of memory and uninitialized variables (#979)
* Free up memory for tests_misc

* Tests failed by uninitialised variables
2023-01-09 06:53:45 +09:00
tx_haggis efccfed057
Install dos2unix (#974) 2023-01-05 00:28:21 +09:00
tx_haggis 8888e06e7f
MISRA check: add XML output (#967)
* MISRA check: add XML output

* Improve handling of cppcheck output

* Simplify - make cppcheck do more work
Now need for the script to gather source files
and run them one at a time, or flatten xml etc.

* Define the byte type - flushes out violations.

* Precaution: apply dos2unix before invoking shell script

* Restore force rename of libdivide folder
Scans on Windows Git Bash were taking way too long.

* Performance: run as many cppcheck jobs as possible
Logical CPU count - 1

* Set the build dir
Prevents temp files being left in the source tree
2023-01-01 10:25:59 +09:00
Josh Stewart b30fde5685 Fix unit tests following #939 2022-12-14 11:25:54 +00:00
Jon Billings 8e4b840325
stuck ego fix (#942)
Ego control gets stuck at 100% when ignitionCount wraps during an DFCO event because the test "if (ignitionCount < AFRnextCycle).." continues to fail until ignitionCount catches up with AFRnextCycle again - long time.
This fix also checks for ignitionCount < (AFRnextCycle - configPage6.egoCount)
2022-12-14 12:03:53 +11:00
Pasi Kemppainen f59d013714
Add deceleration enleanment feature (#939)
* Add decel enleanment feature

* Fix tps and map DOT scaling in TS.

* updates.ino

* Small bug fix.

* One more small bug fix.

* Update cancomms.ino

Cast tps/mapDOT as uint8 to cancomms to retain backwards compatibility

* Fix programmable outputs list.

* Fix programmable outputs in updates.ino

* Add abs around currentStatus.mapDOT
2022-12-14 11:17:47 +11:00
Pasi Kemppainen eb97b8458c
Add parameters to require power cycle (#940) 2022-11-30 15:19:01 +11:00
DeionSi 647681767e
Scale IAT and CLT calibration to ADC 1023 instead of 992 (#959) 2022-11-30 15:16:49 +11:00
Josh Stewart 03d09e91d3
Update README.md 2022-11-24 10:25:18 +11:00
Josh Stewart 22d2b4e38e Add delay to oil pressure engine protection 2022-11-23 16:15:01 +11:00
Josh Stewart 461e632db7 Allow use of RPM2 pin as VSS input with missing tooth 2022-11-22 16:46:32 +11:00
Josh Stewart 4693cb2013 Change to single decoder state variable. Small (12 byte) RAM free up 2022-11-22 15:53:35 +11:00
rafolg 86319f43ca
Update decoders.ino (#944)
Fix an issue where negative trigger angles cause erroneous crankAngles for ignition by tooth.
2022-11-14 10:52:21 +11:00
dependabot[bot] 1f03a7b25e
Bump actions/cache from 2 to 3 (#964)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-14 10:46:19 +11:00