Commit Graph

3038 Commits

Author SHA1 Message Date
Josh Stewart 9acfacba5c Fix regression on MC33810 units from af2815d818 2023-12-22 15:06:35 +11:00
Josh Stewart 7d817e3cde Resolve issue with Teensy not sending CAN msgs 2023-12-21 13:40:36 +11:00
Josh Stewart 5d6440f00d Merge branch 'master' of https://github.com/noisymime/speeduino 2023-12-21 08:27:44 +11:00
chaoschris 4b7948e22c
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
2023-12-15 14:09:24 +11:00
Josh Stewart 25ff07c30f Merge branch 'master' of https://github.com/noisymime/speeduino 2023-12-12 10:00:56 +11:00
Josh Stewart af2815d818 Fix issue with LED indicator not working when MC33810 was in use 2023-12-12 10:00:47 +11:00
Pasi Kemppainen 8cb4e382e4
Fix STM32duino RTC library version to 1.2.0 (#1076) 2023-12-11 13:31:39 +11:00
mike501 ef39476f8f
Adds support for toyota 3 tooth secondary and 2 tooth tertiary input (#1040)
* Disable SD on T4.1 temporarily to prevent lockups. See #847

* Fix unit test value

* Improve closedloop boost control (#736)

* First try on updating closedloop boost control

* added eeprom updates for backward comp[atibility

* fix merge conflict

* Change updates to next release EEPROM version.

* Fix some issues after merging master

* some cleanup to minimize changes and speedup review

* cleanup updates

* chances on updates to alaign with new table format

* move LUT to new config page in eeprom

* little cleanup

* Update storage.h comments

* fix some ini warnings

Co-authored-by: Tjeerd <tjeerdie@users.noreply.github.com>

* Minor cleanup of boost dialog from previous PR

* Add dynamic EEPROM block write limit based on RPM. Should fix #859

* Only set the idle up pin state on init if it's enabled

* AFR protection function (#861)

* Implementing AFR protection

* Update globals.h

* Bug fixes and code refactoring

* Moved variables to prevent ODR

* Dialog for AFR protection

* Data size and math corrections

* Possibility to use either AFR or lambda

* Updated default AFR protection values

* No need to do multiplications due to existing RPMdiv100 variable

* The X100 multiplier was wrongfully removed

* Add defaults in updates.ino, minor formatting cleanups

Co-authored-by: Josh Stewart <josh@noisymime.org>

* Prevent cranking and ASE corrections running at once. Alternative fix to #868

* Corrected RPM to TPS (#878). Fixes #874

* Fixed value mode for AFR protection (#877)

* bug fix. A workaround for failing emulated on internal flash writes + a root cause fix (#876)

* workaround for failing flash writes

* Root cause fix for EEPROM emulation on STM32

* Oops, remove some debugging functions.

Co-authored-by: Tjeerd <tjeerdie@users.noreply.github.com>

* Correct typos found by codespell (#880)

* Fix broken build on Teensy from #880

* Narrow scope of EEPROM_MAX_WRITE_BLOCK to writeConfig (#881)

* EEPROM_MAX_WRITE_BLOCK can be local to writeConfig()
This saves a byte of memory ;-)

* Fix MISRA/lint warnings
Correctly cast address parameter of eeprom_read_block
Statically access table 3d type_key member

* Remove force burn code - unused

* Replace eepromWritesPending with bit set/check

* Refactor: chain write_location instances.
Clearer code.

* Fix hanging on boot (#858)

* Further fixes to the ASE correction

* Enable use of disabled functions pins (#549)

* Enable use pins of disabled functions or unused ign channels

* Added new pins and functions to check

* Fix for semi-seq inj after #478 (#883)

* Don't try to run inappropriate CI on forked repositories (#871)

* Remove old unused corrections code

* Remove controller priority on trigger edge. Fixes #860

This was added for a specific FW update in 2018 and no longer needed.

* Add engine protection flags to datalog

* Add option for SD logging with external switch

* TS option to display pressure in bar #842 (#864)

Adds options in TunerStudio project settings to have default units
for fuel and oil pressure in bar. Adds gauge in kPa. This only
adds convertion from psi to bar, not affecting firmware.

Co-authored-by: Min <min@infcof.com>

* Fix typo from last commit

* Missing commas in ini

* bug fix EGO PID controller + some improvements.  (#879)

* Fix for EGO pid

* Further improvements on ego PID

* Stop EGO controllers from calculating while DFCO is active. To prevent integrator windup.

* Fix bug in DFCO enable/disable of the controller

Co-authored-by: Tjeerd <tjeerdie@users.noreply.github.com>

* Add necessary pin translations (#887). Fixes #867

* Signatures for 202207

* Update README.md

* Update signatures for 202207 in legacy comms

* Dev signatures for 202210-dev

* Volatile decoder variables (#902)

* triggerToothAngle is modified by interrupts

* triggerActualTeeth is never modified in interrupts

* fix check for DFCO off in correctionAFRclosedLoop() (#899)

line 608 has bit-and of configpage6.egotype > 0  & DFCO off.
it should be logical and &&

* cl boost control above baro should use logical and/or (#901)

* libdivide structs can be const - saves a few bytes (#886)

* Add OLCL mode to initBoard() for teensy (#903)

Co-authored-by: csmergs <christopher@smeraglinolo.com>

* Fix for idle PWM on STM32. Enable idle timer when idle pwm is enabled. Fixes #907 

Co-authored-by: Tjeerd <tjeerdie@users.noreply.github.com>

* Disable automatic retransmission (#910)

* Allow for float values in SD log where supported with FPU

* Increase most F temp field max values to 419F

* Revert "Merge branch 'master' into DoubleMissing"

This reverts commit bda3d89bf553df40951167870c826792ba92a715.

* recover missing files

* add vvt

* missing files

* fix stall time from debug version

* Add 3 tooth cam support

* added vvt2 and potential I4 cam

* fix

* fixes to VVT1 to always trigger on rotation 1

* fix attempt to vtt1 trigger

* fixed VVT trigger

* updated how vvt2 is calculated

* made code more readable and portable

instead of trying to set an unsigned int to its max value and handling different sized unsigned ints across different processes, using -1 and adding a comment to explain why. This will then work across all processors

* Allow updating of trigger edge for third cam

* Add logging to second cam & filtering

* include high speed logger in legacy comms

* 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.

* missed save

* 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.

* fix tertiary cam trigger

tertiary cam trigger is supposed to trigger on 2nd tooth, code had bug meaning it would never trigger.

* change how tertiary cam reset

(needs testing)

* added 4th composite logger for both cams

allows you to log both cams together and see the relationship between them.

* 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.

* Improve VVT1 detection

* fixes to merge

* update VVT2 trigger detection and reduce filtering

* Revert "Merge remote-tracking branch 'noisymime/master'"

This reverts commit 58e6e283e6.

* Correct merge error with master

missed decoders.h merge missing a reference to recordVVT1Angle which has been renamed to fit better into the naming convention within this file to triggerRecordVVT1Angle

* Removed tertiary decoder

Tertiary decoder hasn't completed testing & is specifically for certain v8 engines, removing so this can be submitted and built into the next release covering other Toyota engines (eg those used in Lexius inline 6)

* Make triggerRecordVVT1Angle static

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
Co-authored-by: Tjeerd <33102280+Tjeerdie@users.noreply.github.com>
Co-authored-by: Tjeerd <tjeerdie@users.noreply.github.com>
Co-authored-by: larmicfre <49905831+larmicfre@users.noreply.github.com>
Co-authored-by: Daniel Tobias <dantob@users.noreply.github.com>
Co-authored-by: tx_haggis <13982343+adbancroft@users.noreply.github.com>
Co-authored-by: Pasi Kemppainen <48950874+pazi88@users.noreply.github.com>
Co-authored-by: Vitor Moreno B. Sales <vitor.m.benevides@outlook.com>
Co-authored-by: Min <72794870+zceemja@users.noreply.github.com>
Co-authored-by: Min <min@infcof.com>
Co-authored-by: Afroboltski <70011435+Afroboltski@users.noreply.github.com>
Co-authored-by: DeionSi <DeionSi@users.noreply.github.com>
Co-authored-by: Jon Billings <jon.billings@bbc.co.uk>
Co-authored-by: a32guy <turboe30@gmail.com>
Co-authored-by: csmergs <christopher@smeraglinolo.com>
2023-12-11 13:30:51 +11:00
Vitor Moreno B. Sales f7ee4c6415
Moved WMI to VVT2 (#845)
* Moved WMI to VVT2

 WMI to VVT2 channel and increased PWM resolution to 0.5%

* Enable WMI and VVT at the same time

* Move MWI to VVT2 options on INI file

* Rename auxiliaries.ino to auxiliaries.cpp

* Rename updates.ino to updates.cpp

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-12-11 11:53:34 +11:00
Josh Stewart 7079b50aa1 Fix tests 2023-12-06 15:20:23 +11:00
Josh Stewart 4d4486df4f Minor memory optimisation 2023-12-06 14:47:13 +11:00
Josh Stewart 4d4b2a87f7 Disable ADC ISR after each full cycle and re-enable every 5ms (200Hz) 2023-12-06 13:39:32 +11:00
Josh Stewart f80a8aa218 Working ADC ISR for AVR. Not enabled. 2023-12-05 17:35:45 +11:00
Josh Stewart 75b3530036 Hardcode tooth count for 36-2-2-2 decoder 2023-12-01 14:57:34 +11:00
Josh Stewart fedd32e43c Fix build failure when ANALOG_ISR is set 2023-12-01 14:56:14 +11:00
tx_haggis d5d4274054
Bug fix: reset control can be enabled but pin can be set to zero (#1142)
* Reset control pin: don't over-writie the board default with zero.
The added unit tests interfered with each other & hung -
solution is to reinitialize the global context at the start of
each test.

* Additional pin init tests
2023-11-28 10:13:00 +11:00
tx_haggis 963f6317ba
Save 600+ bytes RAM (step 5 of 9) - De-duplicate setSchedule functions (#1111)
* 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
2023-11-24 09:35:43 +11:00
tx_haggis 1c9122ded3
No need for bit masks on bit fields. (#1139) 2023-11-24 08:07:47 +11:00
Josh Stewart 0dd42a2303 Fix build on mega2560 2023-11-21 17:05:47 +11:00
Josh Stewart 36d22b4832 Allow secondary serial interface to be set on a per board basis rather than MCU only
Fixes #1135
2023-11-21 16:47:24 +11:00
Josh Stewart 011a2ed906 Remove warning about sprintf potential overflow 2023-11-15 08:24:58 +11:00
Josh Stewart 3f32fb48af Correct idle frequency check for Teensy41 2023-11-15 07:26:34 +11:00
155ac 8e1e3296e8
Adds even more info in TunerStudio help bubbles (#1089)
* Adds more info in tunerstudio help

* Wording/formatting changes

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-11-12 09:08:37 +11:00
Josh Stewart dd76cfa0e0 Change init for <=3 cylinder Wasted COP to match standard wasted spark
Fixes #1132
2023-11-07 08:51:55 +11:00
tx_haggis 53d18accf8
Use portable paths (that work on Win & Linux) (#1131) 2023-11-06 18:50:21 +11:00
tx_haggis 9bbd16c81b
Performance: optimize division (#1082)
* 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
2023-11-06 09:10:08 +11:00
Josh Stewart 5ad8784976 Add missing include from last commit 2023-11-03 15:37:29 +11:00
Josh Stewart 00f15a6336 Fix misalignment of CAN address and start bytes 2023-11-03 15:23:55 +11:00
Josh Stewart 329a5278a7 Move CAN buffers into the relevant comms files rather than boards
This should resolve #1116
2023-11-03 15:22:11 +11:00
tx_haggis cd3b4dfeaa
Simplify 3D table I/O conversions - save 12 bytes RAM (#1107)
* Simplify 3d table I/O conversions
Saves 10 bytes RAM

* MISRA fix: remove abort() from CONCRETE_TABLE_ACTION

* CppCheck fix (pointer past end of array warning)

* MISRA fixes
2023-11-02 09:08:31 +11:00
Josh Stewart 41eb7b3b85
Initial work on pulsed HW test outputs (#1120) 2023-10-27 10:07:05 +11:00
Vitor Moreno B. Sales f8ffbb13da
Added taper entering DFCO (#1118)
* Added taper for DFCO for ignition and fuel

Used 1 byte of RAM and 4 on page 9

* Moved data to be compatible with DFCO map thres

* Added taper for DFCO for ignition and fuel

Used 1 byte of RAM and 4 on page 9

* Moved data to be compatible with DFCO map thres

* Fixed potential overflow and DFCO tests

* Moved math into functions and added tests

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-10-25 10:09:57 +11:00
155ac 602203d3e0
MAP Limits for EGO (#1124)
* Map Limits for EGO

* Better update value for not breaking old tunes

my guess is that 300 kpa max will be good for not disabling EGO when using boost now but you can change for what value you think is the best

* Atualizar o updates.cpp

fix my dumbo mistake

* Prevent signed vs unsigned warning

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-10-24 22:06:53 +11:00
Josh Stewart 00c558ff39 Add chunkWrite command handler for secondary serial (Allows for writes over secondary) 2023-10-24 12:18:00 +11:00
dependabot[bot] 8fa408c598
Bump schneegans/dynamic-badges-action from 1.6.0 to 1.7.0 (#1121)
Bumps [schneegans/dynamic-badges-action](https://github.com/schneegans/dynamic-badges-action) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/schneegans/dynamic-badges-action/releases)
- [Changelog](https://github.com/Schneegans/dynamic-badges-action/blob/master/changelog.md)
- [Commits](https://github.com/schneegans/dynamic-badges-action/compare/v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: schneegans/dynamic-badges-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 22:45:48 +11:00
Josh Stewart 7cca27ee28 Fix incorrect check from last commit on stm32F11 2023-10-13 14:01:17 +11:00
Josh Stewart 059f4b3adf Restructure CAN code into comms_CAN 2023-10-13 12:25:05 +11:00
Josh Stewart f9d0f0fce2 Add compile warnings for stm32 if arguments have not been configured in boards.txt 2023-10-13 12:21:58 +11:00
155ac 2f711ffdb4
Fix logs not opening in msdroid (#1114)
* Update speeduino.ini

this fix parse problem in the msdroid debuglogs

* fix logs not opening in msdroid

this fix a problem that the logs the msdroid created cannot be open in msdroid itself
2023-10-11 12:26:08 +11:00
Vitor Moreno B. Sales f133b0f613
Moved STM32 definitions from globals to board file (#1117)
* Moved STM32 definitions from globals to board file

Moved definitions from globals.h

Removed old STM32 generic library as this is very old and unused for almost 5 years.

* Remove old stm32_generic build environment from platformio.ini

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-10-11 12:24:46 +11:00
Josh Stewart 4cf7141b0b Add environment builds for mega2560 6/3 and 8/1 channel configurations. Add these builds to unit tests 2023-10-11 08:21:47 +11:00
Josh Stewart f657fc6293 Add option on secondary serial to use previous generic data list 2023-10-10 15:49:36 +11:00
155ac 279fa09788
Update speeduino.ini (#1113)
this fix parse problem in the msdroid debuglogs
2023-10-09 09:05:47 +11:00
tx_haggis b03db96ad7
Save 600+ bytes RAM (step 4 of 9) - deduplicate scheduler ISR functions (#1063) 2023-10-07 08:25:26 +11:00
Josh Stewart 55c98cab22 Allow mega2560 builds with non-standard _CHANNELS values 2023-10-06 20:43:15 +11:00
Josh Stewart fc536d15f0 Rename all ino files to cpp (Excluding speeduino.ino).
Confirmed this compiles OK in Arduino IDE 2.x
Frees up 8 bytes of RAM
2023-10-06 18:10:20 +11:00
tx_haggis 977ffa3119
MISRA: clean up logger header (#1108)
* Move log header definitions inside sd_logger.ino
It's the only place they are used.

* Convert to CPP - fixes build error

* Encapsulate fsIntIndex

* MISRA fixes

* Convert logger.ino -> cpp

* Conditonal compile - reclaim memory
2023-10-06 15:07:12 +11:00
Josh Stewart 650efeb6c4 202311-dev signatures and updates file 2023-10-06 15:01:23 +11:00
Josh Stewart 70d3f61573 Signatures for 202310 release 2023-10-06 12:09:43 +11:00
Josh Stewart 484e3916e3 Further cleanup work on secondary comms. Slight RAM free up. 2023-10-06 11:48:05 +11:00