Commit Graph

3125 Commits

Author SHA1 Message Date
Josh Stewart 429a9273f0 Fix unit tests based on code path changes 2024-12-16 14:32:18 +11:00
Josh Stewart 5b243fd3f7 Do not queue next fuel schedule if cycle time exceeds max timer duration 2024-12-16 13:12:03 +11:00
Josh Stewart 4e24792b51 Further work handling when injection start angle passes back and forth between 0 and CRANK_ANGLE_MAX_INJ 2024-12-11 14:42:58 +11:00
Josh Stewart dbad3818a1 Prevent missed injection pulse under specific timing conditions 2024-12-11 12:04:44 +11:00
Josh Stewart ba19486dbf Slight tweak to fuel scheduling conditions 2024-12-10 11:02:38 +11:00
Josh Stewart a3338c1b47 Cleanup of new code. Align ignition schedules with new fuel schedules 2024-12-06 12:40:17 +11:00
Josh Stewart 2b038bb13a Remove end compare on fuel schedules. Significant RAM improvement 2024-12-05 07:39:50 +11:00
Josh Stewart 960a5e4e6e Avoid overflow of timer period between the current and next schedules
Potential fix for #1181
2024-12-04 22:31:22 +11:00
Vitor Moreno B. Sales 2fd3640c8a
Hardened pin reassignment (#1248)
* Hardened pin reassignment

Added check as some functions access the pin via registers and had no check.

Added protection for "board default" pin value as it can lock up STM32 board due to wrong board layout.

Added STM32 CAN pins to the `pinIsReserved` check.

* Fixed check for inputs

* Fixed typos on last commit

* Fixed possible problems with some outputs

Fixed first test failed on previous commit

* Correctly init reset pin

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
2024-11-29 14:53:14 +11:00
Josh Stewart 4ac5b72d9e Adjust init test for reset control output pin 2024-11-29 14:20:07 +11:00
Josh Stewart b99ab35f8b Correct Coolant reading over BMW CAN protocol. Fixes #1218 2024-11-28 18:09:43 +11:00
Josh Stewart abc688bc5d Change ignSoftLaunchValue to signed. Fixes #1188
This was not causing any actual issues that I can see, however best to use the correct type
2024-11-28 17:59:01 +11:00
Josh Stewart 0898043d19 Teensy 4.1 boot speed optimisations 2024-11-22 11:55:09 +11:00
Josh Stewart 95664baee6 Only perform SD card init if SD logging is enabled 2024-11-19 12:36:48 +11:00
Josh Stewart a9dcc597c3 Fix faulty logic for VSS hard launch check 2024-11-15 13:57:16 +11:00
Josh Stewart 9be81a6700 Minor loop count optimisation. 2024-11-07 15:29:05 +11:00
Josh Stewart 4e23e87a34 Correct comment. Fixes #1257 2024-11-07 14:18:01 +11:00
Josh Stewart 095c2ff196 Cleanup warnings 2024-11-07 13:32:12 +11:00
Josh Stewart 43bc13cf40 Fix compilation issue from last commit 2024-11-06 14:58:47 +11:00
Josh Stewart fe31596c9e Add rx timeout checks on secondary and legacy serial code. Reduce rx timeout from 700ms to 400ms 2024-11-06 14:16:41 +11:00
Josh Stewart fcb106f3cc Clear serial buffer after 0xF0 character received 2024-10-25 20:05:23 +11:00
Josh Stewart cb9baca418 Avoid potential tacho out race condition on teensy and stm32 2024-10-25 17:40:17 +11:00
Josh Stewart ba77e36bd7 Check for DTR change on serial line and ignore
Fixes 1112
2024-10-25 12:03:25 +11:00
Josh Stewart 8b97b9802d Increase SD ringbuffer size and add checks for space before writing to ringbuffer
Fixes #1258
2024-10-22 14:27:17 +11:00
Josh Stewart 88e1e951af Add pin reserved check for external interrupt functions
This can prevent a lockup on stm32 boards if a reserved pin is selected on a reserved pin
2024-10-22 13:57:13 +11:00
tx_haggis bf8e651a89
Unit test Pull Requests (#1255)
* Only need a single simulator test environment.
(now that PIO have fixed their SimAVR tooling).

* Run unit tests on PRs using SimAVR.
2024-10-19 00:24:38 +11:00
mike501 406e8806b4
Fix sequential sync detection - raised in issue 1240 (#1256)
Fixes #1240
2024-10-19 00:22:24 +11:00
tx_haggis 30b9354486
Run unit tests on SimAVR (#1252)
* Run unit tests on SimAVR

* Revert CI unit tests to run on remote hardware.
2024-10-02 12:34:35 +10:00
tx_haggis a4bbce63c3
Sensors.cpp: MISRA fixes & reduce conditional compilation blocks (#1157)
* Bug fix - consistent #ifdef (ANALOG_ISR/ANALOG_ISR_MAP)
Also  replace multiple #ifdefs with inline function.

* MISRA fixes for sensor.cpp

* Conditional compile to allow MAP sensor read pin even when using analog ISR
Useful for development testing

* Remove unused global variables
statuses::batADC
fpPrimed - duplicate of statuses::fpPrimed
injPrimed - duplicate of statuses::injPrimed

* Replace duplicate filter macros with one inline function: LOW_PASS_FILTER (which is MISRA compliant).

* Remove mapErrorCount - it's unused
(only ever written to, never read)

* Deduplicate MAP reading code

* Encapsulate MAP variables

* Add isEngineRunning() to capture duplicate code

* Make readBaro() independent of instanteneousMAPReading()
Removes a conditional and reduces module surafce area

* Use structs to capture the MAP algorithm state.
Also apply ATOMIC_BLOCK to prevent tearing of ISR modified variables.

* Force loop() inline
Reduces stack usage.

* Use 16-bit comparisons

* Remove validateMAP() - since we validate every sensor reading, it wasn't doing anything.

* Unit test engineIsRunning

* Apply SET_UNITY_FILENAME to K6A unit tests

* Unit test LOW_PASS_FILTER

* Unit test fastMap10Bit

* Reduce scope of MAP ADC variables - only used in sensors.cpp

* MAP: read the sensors in one place in the code & inject the values into the sampling algorithms

* MAP: encapsulate reset of state structures

* MAP: replace magic numbers wirth an enum

* MAP algorithms return a flag indicting whether they recomputed MAP/EMAP

* MAP sampling algorithms: push MAP value calculation up the call stack.

* Remove errors.* - it's never called an uses up RAM

* Unit Test: inject all MAP sampling algorithm dependencies

* Unit test MAP sampling algorithms

* Unit test validateFilterMapSensorReading

* Prevent torn reads during comparisons

* Don't skip readings on cycle/event boundaries
2024-10-01 12:22:29 +10:00
tx_haggis 4c29faa739
Suzuki k6a fix & "improvements" (#1174)
* Add unit tests for triggerSetEndTeeth_SuzukiK6A

* Bug fix - use correct parameter when calling stdGetRPM

* Compute triggerToothAngle from the fixed tooth angle array.

* triggerSetEndTeeth_SuzukiK6A - hoist duplicated code into calcEndTeeth_SuzukiK6A
(like we did for some other decoders).

* MISRA fixes for Suzuki K6A decoder
2024-09-26 11:34:54 +10:00
Josh Stewart 8afead9ae4 Fix O2 calibration not showing correctly when dialog is reopened 2024-09-26 10:23:33 +10:00
Josh Stewart f12b59ad4e Minor workflow updates 2024-09-22 14:06:06 +10:00
Josh Stewart 20f450607b Minor cleanup to decoders 2024-09-21 17:28:35 +10:00
Josh Stewart da6dd19cab Add release workflow 2024-09-21 17:25:36 +10:00
Josh Stewart c2512bedb6 Use flex fuel frequency settings for non-GM sensors. Closes #1247 2024-09-20 07:13:18 +10:00
Josh Stewart f44fdf4ef9 Fix oil and fuel pressure readings over Haltech CAN 2024-09-11 15:22:29 +10:00
Josh Stewart 9b04a04370 Fix the pin output check on VVT2 since it was changed to share the timer with WMI 2024-09-11 13:20:46 +10:00
Josh Stewart ba38f751e5 Bump python version of unit testing workflow 3.7 -> 3.10 2024-09-09 14:21:26 +10:00
Josh Stewart ef0d9a7dd7 Further tweaks to Haltech CAN messages 2024-09-09 14:16:30 +10:00
Josh Stewart b26027705a Correct byte order for Haltech CAN messages 2024-09-09 13:09:42 +10:00
Josh Stewart 190192b061 Reduce flash and ram usage on mega2560
This has a very small impact on loops/s, around 0.5%
2024-08-26 13:41:48 +10:00
Josh Stewart cfc3854d97 Reduce flash usage for 2560 to prevent burn issues. 2024-08-23 23:55:51 +10:00
Josh Stewart a9642f461a Add option for TunerStudio protocol on secondary serial 2024-08-23 23:21:54 +10:00
Josh Stewart a727eb51a7 Standardise on UINT8_MAX rather than 255 for limits 2024-08-23 07:19:52 +10:00
Wilmar den Ouden 50b91c7ae7
feat: adds AEM 30-0300 X-Series UEGO wideband over CAN support (#1238)
* feat: adds AEM 30-0300 X-Series UEGO wideband over CAN support

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* fix: add else around setting currentStatus.02

Signed-off-by: wilmardo <info@wilmardenouden.nl>

* refactor: only do the division once for AEM wideband data

Signed-off-by: wilmardo <info@wilmardenouden.nl>

---------

Signed-off-by: wilmardo <info@wilmardenouden.nl>
2024-08-23 06:57:29 +10:00
Josh Stewart b99aa15a94 Remove unused workflow file 2024-08-15 17:09:02 +10:00
Josh Stewart 44f715213f
Add revised Memory deltas workflow (#1239)
* Initial test

* Fix syntax

* Fix platform names

* Fix platforms order

* Add sketch-paths

* Add verbose

* Disable fail fast

* Attempt compile only top level file

* Update compile-sketches action version

* Try mega2560 compile with native core

* Try blank source-url

* Change to array for platform

* Change formatting

* Last try

* Use scalar multiline strings for paltform

* Use string literals for newline

* Formatting

* Try mega2560 without library

* Add stm32f407

* Add library board property

* Fixes

* Fix mega platform

* Change Time to TimeLib

* Try different escaping

* Use individual lines for build extra-flags

* Try without escaping

* Try only single build flag

* Add 2nd -D for mega

* Add all mega build options back

* Match stm32 build option format

* Remove HWSERIAL 2 and 3 for stm32

* Lock stm32 to v2.7.1

* Enable reporting on PR

* Disable verbose

* Add workflow name

* Dummy test data to verify memory change

* Revert "Dummy test data to verify memory change"

This reverts commit e83609ec9e.

* Dummy memory increase for Teensy and stm32

* Revert "Dummy memory increase for Teensy and stm32"

This reverts commit 830b255e75.

* Only run on PRs

* Revert "Only run on PRs"

This reverts commit 24d61e5069.

* Split memory deltas workflow into calculating and reporting

* Force v3 of upload-artifact

* Lock report deltas version

* Use latest example as reference
2024-08-15 17:07:34 +10:00
Josh Stewart 62c75a177d Make sure workflow report runs on pull_request_target 2024-08-15 12:21:07 +10:00
Josh Stewart 8f460fec9a Change the delta workflow PR scope 2024-08-15 12:03:44 +10:00
Josh Stewart 9ae1932aea Update permissions on workflow 2024-08-15 11:38:23 +10:00