Commit Graph

2595 Commits

Author SHA1 Message Date
tx_haggis 9ad500189b
Performance: 15%+ loop/sec speedup by optimising 3d table bilinear interpolation (#735)
* Bi-linear interpolation - round towards nearest integer

Add the equivalent of 0.5 to the final calculation pre-rounding.
This will have the effect of rounding to the nearest integer, rather
than truncating. I.e. rounding down

* Unit tests: isolate table tests and check interpolation x/y bins

* Unit tests: add native table3d tests

* Unit tests: derive min/max from axis test values

* Unit tests: more detailed messages

* Unit tests: fix rounding & unit tests

* Performance

* Performance: use uint16_t instead of unsigned long
for the fixed point math: we only need the fractional
part. I.e. 1.16 not 16.16

* Use narrowest possible type

* Optimise bin position logic for performance

* Only promote to uint32_t when really required.

* Simplify bin checks - no zero width bins

* Save memory: use a single byte for the last bin caches

* Performance: increment pointers instead of
repeatedly dereferncing array by index.

* Comments

* Incorrect array underrun logic

* Rename type, comments

* Fix unit tests
2021-12-09 20:40:31 +11:00
Josh Stewart 9c390deacb Further libdivide tweaks 2021-12-09 12:35:26 +11:00
Josh Stewart 105534efb8 Add option to use libdivide in maths.h functions 2021-12-09 10:50:17 +11:00
tx_haggis 36d285d883
Performance: speed up table I/O (optimized division) (#738)
* Add libdivide

* Apply libdivide to axis I/O scaling

* Fix CI build

* Fix CI build
2021-12-09 09:41:57 +11:00
Vitor Moreno B. Sales 1536b9196d
Steper OL+CL mode (#554) 2021-12-09 08:52:56 +11:00
Josh Stewart 8b262a0087 Sensor calibration in New Comms 2021-12-07 15:20:02 +11:00
Josh Stewart e7a217fab7 Show correct SD card size 2021-11-30 14:40:01 +11:00
Josh Stewart 1b128bb513 Merge branch 'master' of https://github.com/noisymime/speeduino 2021-11-26 13:47:34 +11:00
Josh Stewart 09b61fae79 Handle serial buffer being full in newComms 2021-11-26 13:47:15 +11:00
Corey Harding b419f15a32
Add Radiator Cooling Fan indicator (#719). Fixes #716
* Update auxiliaries.ino

Add Radiator Fan Status Indicator Changes

* Update globals.h

Add Radiator Fan Status Indicator Changes

* Update cancomms.ino

Add Radiator Fan Status Indicator Changes

* Update speeduino.ini

Add Radiator Fan Status Indicator Changes

* Update speeduino.ini

Simplify Naming

* Update auxiliaries.ino

Simplify Naming

* Update cancomms.ino

Simplify Naming

* Update globals.h

Simplify Naming

* Update speeduino.ini

Enable Datalogging of Radiator Cooling Fan Status

* Update auxiliaries.ino

Remove old instances of fanOn

* Update globals.h

Remove old instances of fanOn

* Update auxiliaries.ino

Correct formatting

* Update auxiliaries.ino

formatting

* Update auxiliaries.ino

formatting

* Update auxiliaries.ino

formatting

* Update auxiliaries.ino

formatting

* Update auxiliaries.ino

formatting

Co-authored-by: github-account-0 <91717711+github-account-0@users.noreply.github.com>
2021-11-26 10:28:53 +11:00
Josh Stewart 6025b88fdf Merge branch 'master' of https://github.com/noisymime/speeduino 2021-11-25 13:19:59 +11:00
Josh Stewart c3805456b2 SD File copy to TunerStudio working 2021-11-25 13:19:54 +11:00
Josh Stewart 2841a9f648 Allow for manual SD logging start/stop 2021-11-24 16:14:31 +11:00
Pasi Kemppainen e213f2534e
PWM Fan addition (#637)
* Added PWM Fan functionality

PWM Fan output for Teensy and STM32

* Teensy3.5 timer fix for PWM Fan.

* Fix the conflicts with incorporate AFR

* Possibility to use PWM fan on mega too

Not tested at this stage!! Do not merge yet.

* Fix log entry size

* Remove duplicate stuff and use same way off toggling fan

* Fix typo errors

* Move fan pin definitions to globals.h

* Fix problems related to PWM fan.

* Revert previous change.

* Fix problems with idle things

* fix idle duty getting stuck at 100%

* Revert "fix idle duty getting stuck at 100%"

This reverts commit 7e9779483b.

* Revert "Fix problems with idle things"

This reverts commit 8bccb56d9a.

* Revert "Revert previous change."

This reverts commit fcb962864a.

* Remove mega support

* fixes

* more fixes

* moar fixes

* Should be working now

* Update speeduino.ini

* Lots of tweaking

* Update to work better with current FW

* Fix compiler warnings and include update things.

* Minor fixes

* Update logger.ino

* Fan duty working on mega too and fan output will be on/off

Co-authored-by: Pasi Kemppainen <pazi88@users.noreply.github.com>
2021-11-24 12:18:41 +11:00
Josh Stewart 07bfc6025c Add file listing of SD card through to TS 2021-11-24 10:23:15 +11:00
Josh Stewart 4e15c77c00 Fix broken Teensy 4.1 build 2021-11-20 08:39:38 +11:00
Josh Stewart 2439883a69 Further SD compatibility work with new comms 2021-11-20 08:29:11 +11:00
tx_haggis a65beb46e0
AVR fast eeprom read - 45% speed up (#715)
* Optimize EEPROM read on AVR

* .
2021-11-19 14:22:21 +11:00
Josh Stewart 4f1809ba9d Fix for new comms not compiling on stm32 2021-11-19 11:26:12 +11:00
Josh Stewart db2e667abb Initial work on new serial comms (Disabled in ini) 2021-11-19 11:07:38 +11:00
Josh Stewart 61de6ff038 Fix tests from PR #662 2021-11-18 11:51:32 +11:00
tx_haggis 5ed9ec3ca9
Reduce 3d table memory usage (>500 bytes) (#662)
* Use table_row_iterator_t to adjust ignitionTable

* Separate 2d & 3d table code, abstract page to table iterator conversion.

This is just moving code around in preparation for future changes.

* Reduce table RAM (.bss) usage

Generate a separate type for each possible
3d axis & size combination.

This turns what was runtime information into
compile time data.

* Save 1 byte per table.

Use a flag value (INT16_MAX) instead of a separate boolean
flag

* File renaming

table_iterator -> table3d_iterator.h
table3d.h -> table3d_interpolate.h
table3d.cpp -> table3d_interpolate.cpp
table3d_types.h -> table3d.h

* Optimize page.cpp: reduce code clutter, maintain performance

* Reduce flash usage

* Encapsulate table metadata

* Performance - hoist if statement

* Replace function with macro

* Use a packed enum as a type identifier

Use a packed enum as a type identifier

Slimmer data types

* Use table iterators for random access to table
values and axis.

* Centralize write buffer check

* Encapsulate 16-bit reference concept

* Performance: make table iterators proper classes

This allows us to chain calls on temporaries - not possible
with regular function calls.

* Performance: encapsulate EEPROM update
& address increment

* Save flash - don't duplicate function

* Performance: directly invalidate table cache

* Separate out iterator reversal

* Separate out entity mapping & per-byte access

Much faster, smaller code footprint & easier to understand

* Code quality fixes

* Separate out axis metadata

* Doxygen comments

* Separate int16_ref into separate file

* Separate out table axies & values into separate types

No need for metadata types & more localised code.
E.g. creating iterators is now alongside the data over
which they iterate.

* Doxygen
2021-11-18 11:30:29 +11:00
Josh Stewart aaa5b9090f Merge branch 'master' of https://github.com/noisymime/speeduino 2021-11-15 15:49:44 +11:00
Josh Stewart 0678173a54 Add handling of cam speed dual wheel in decoder 2021-11-15 15:49:41 +11:00
Josh Stewart bafa160834 Change logic for performing Baro reads from MAP 2021-11-15 15:47:55 +11:00
DeionSi eafd4030d1
Add SET_COMPARE; Change some types to COMPARE_TYPE (#691) 2021-11-12 15:11:42 +11:00
Josh Stewart 20b4693c64 Add CODEOWNERS to maintainer of stm32 2021-11-12 08:26:16 +11:00
Josh Stewart 606fac30ff Merge branch 'master' of https://github.com/noisymime/speeduino 2021-11-11 12:06:53 +11:00
Josh Stewart bb9a7135aa Remove controllerPriority for the ADC filters 2021-11-11 12:06:48 +11:00
tx_haggis b3b32a489a
Allow logging of loopsPerSecond (#699) 2021-11-09 17:48:24 +11:00
DeionSi 366f720455
Ignition advance range changes (#701)
* Signed int8 for fixed crank angle (range -10to80)

* Limit ignition advance in tables to 70 and use different range for multiplied

* Limit WMI and Nitrous ign adv to reasonable values

* Fix IAT timing retard table

* Don't let IAT retard correction set a fixed advance. No other correction does this and this fixed correction can be changed by other corrections. Also the current code is not working as ignition offset is not used for IAT retard.
2021-11-09 07:57:15 +11:00
Daniel Tobias b0acb92742
update documentation of EEPROM layout (#694) 2021-10-26 10:01:13 +11:00
tx_haggis 6344fdc76f
Use -fshort-enums instead of packing individual enums (#692) 2021-10-23 09:04:31 +11:00
Josh Stewart bc68e6b8ee Attempt #3 on Doxygen Action 2021-10-21 16:32:17 +11:00
Josh Stewart 6fecd7a414 Attempt #2 on doxygen Action 2021-10-21 16:25:15 +11:00
Josh Stewart 8e7ed92d30 1st attempt at Doxygen compiling on Actions 2021-10-21 16:18:26 +11:00
Daniel Tobias 03650d80eb
Doxygen fixes (#689)
* doxygen warning fixes

* run doxygen -u, add speeduino logo to src tree for doxygen

* increase DOT_GRAPH_MAX_NODES

so we generate the complete call graph for loop() and setup()
2021-10-21 08:03:29 +11:00
Josh Stewart fa481c5724 Don't lock trigger speed field in TS for dual wheel pattern 2021-10-18 14:34:44 +11:00
Josh Stewart d63a7d5af0 Fix incorrect tacho pin map on Dropbear 2021-10-14 07:37:03 +11:00
Josh Stewart 3160e88b61 Fix readable log alignment 2021-10-13 17:54:55 +11:00
Josh Stewart ef59fbabf0 First complete (Basic!) SD logging 2021-10-13 17:10:05 +11:00
Josh Stewart f62195d511 Hopeful fix for Github Actions not finding required library 2021-10-13 12:55:37 +11:00
Josh Stewart b7c97ce2b9 Add missing include for 2560 2021-10-13 12:42:52 +11:00
Josh Stewart 793482a27b Big chunk of SD logging work. 2021-10-13 11:53:46 +11:00
DeionSi 01f4eb90f7
Don't activate engine protection when it is disabled (#683)
* Don't enable engine protection when it is disabled

* This is already checked in each function
2021-10-12 10:25:14 +11:00
DeionSi b5f60ba012
Chrysler NGC pattern for 4-cylinder cam pattern (#679)
* Chrysler NGC pattern for 4-cylinder cam pattern

* New ignition mode for NGC decoder

* NGC decoder: Cleanup/performance improvements

* NGC decoder: Comment fixes
2021-10-11 10:55:32 +11:00
DeionSi e83c77d166
Change teeth numbers for both revolutions (#681) 2021-10-08 07:37:01 +11:00
Pasi Kemppainen 968e6304a2
Fix speeduino.ini (#630)
Add missing description.
2021-10-06 18:35:03 +11:00
Pasi Kemppainen 45b73c242a
Fixes and improvements to OBD2 real time data (#677) 2021-10-06 14:36:02 +11:00
Josh Stewart 814ae52a35 Minor fix to Unit Tests 2021-10-05 15:40:35 +11:00