Commit Graph

26 Commits

Author SHA1 Message Date
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 dd41ae5f27 Signatures for 202305 release 2023-05-26 17:00:51 +10:00
Josh Stewart e5e46b1d73 Add serial compatibility mode option 2023-03-23 11:05:10 +11:00
tx_haggis 3595634bd2
Table3D: MISRA fixes (#973) 2023-01-11 10:58:48 +09:00
tx_haggis 56ab7c054d
Table 3d: change X-axis orientation to match Y-axis (#771)
* Change X axis in memory orientation to match Y

* X & Y axes can use the same type (Ie.e class)

* Table3D axis iterator: replace reverse() with rbegin()

* Use iterators as part of unit tests

* Doxygen fixes/corrections
2022-11-14 10:26:14 +11:00
Josh Stewart 2fc29ceef5 MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
Josh Stewart 2269e688f3 Lower SPI EEPROM write frequency 2022-10-19 12:19:52 +11:00
Josh Stewart 3923ecf12f Tweaks to 2560 EEPROM burn during multi page writes 2022-09-12 11:53:18 +10:00
Afroboltski 75d6c2ff61
Air Conditioning Control - Feature Implementation (#665)
* 19.09.2021

* Final testing of AC Control, some idle features fixed

AC control feature added, better than the existing idle-up feature (which can still be used for other things, e.g. electrical load detection). Air conditioning is locked out with coolant temp, RPM high/low, and high TPS. So the A/C automatically cuts out when driving hard.

Idle step now works correctly with closed loop PWM, open loop PWM, and closed+open loop PWM. Untested with stepper motor, but no reason it shouldn't work.

* Fixed mistakenly incremented page sizes

* Initial changes as per HWright9

-Renamed engineRunSeconds to acAfterEngineStartDelay
-Formatted large if statements better
-Fixed acStartDelay overflow bug
-Improved readability of logic

* Final fixes as per HWright9's feedback

-Add high/low RPM lockout delay, similar to the high TPM lockout delay
-General tidy-up

* Added stand-alone fan, moved config data in EEPROM

-Added additional configurable stand-alone A/C fan output, for when there is dedicated cooling fan for the A/C compressor. This is independent of the engine cooling fan logic.
-Moved config storage in EEPROM to configPage9, as noisymime's SD card logging has used the (previously unused) bytes I had used in configPage13.
-Minor bug fix - rename Aux in 1-16 to Aux in 0-15

* Revert to current master branch - as of master commit 97f8ef795a

* A/C Control Re-Integrated from AC-Control-Clean-3 (@Corey-Harding). Tested & ready to merge.

Additionally, added @HazuTo25's lines into the update() routine to configure default A/C settings.

* Changed updates.ino to just set A/C to disabled

* Fix change reverted by mistake - master merge commit 73badbce8c

* Fix remaining mistakes from previous master merge

* Remove test statements left in by mistake

* define unusedBits

* Remove test statements left in by mistake

* Increase timing granularity to 0.1s

* idleUpRPMAdder

* Remove another line put in by mistake by auto merge

* idleUpRPMFixes

* Update speeduino.ino

* Tweak A/C idle up descriptions

* Tweak A/C TS descriptors again

* Fixed alignment bug that turned page 15 config values into gobbledegook.

This had the symptom of the A/C request never triggering, because when a pin was assigned in TS (e.g. I did 27), a completely different pin would be read from config15 (in my case 22 - connecting the button to pin 22 would work in this case, even though TS was set to 27).

* Fix bit count - should be 6 to match ini file

* Increase minimum RPM lockout granularity

* Change granularity of A/C minimum RPM lockout to 10 RPM; Inline some functions for readability

* Add static inline function prototypes to auxiliaries.h as per the style guide.

* Fixed page 15 merge errors

* Style changes to suit new pinIsUsed() checks in setPinMappings()

* Add PWM Fan Control Minimum Clamp Value when A/C Compressor Engaged

* Fix comment

* Fix bug with stand-alone fan initialisation

Pin was unable to be used in prog. I/O even if fan was disabled, because it was always initialised as an output even if it was disabled. Fixed in this commit.

* Correction to Fahrenheit temperature scaling

* Move A/C updates to correct next release

Co-authored-by: shiznit304 <62686180+shiznit304@users.noreply.github.com>
Co-authored-by: Josh Stewart <josh@noisymime.org>
2022-09-07 10:23:01 +10:00
tx_haggis 3009c39767
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.
2022-06-27 11:53:33 +10:00
Josh Stewart 1d85100ea7 Add dynamic EEPROM block write limit based on RPM. Should fix #859 2022-06-03 18:23:22 +10:00
Tjeerd 20c5e17756
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>
2022-06-03 15:44:09 +10:00
Daniel Tobias 7020705dbe
fix typos in code documentation (#816)
* fix typos in code documentation

* minor reverts

* fix typos in ini

Co-authored-by: Josh Stewart <josh@noisymime.org>
2022-04-11 10:49:58 +10:00
tx_haggis 6c12bcc32d
Separate table axis I/O conversion from iteration (#767)
* Missing include

* 1. Add int16_byte class
2. Add axis factory function for int16_byte instances
(flyweight pattern)

* Separate out axis iteration and I/O conversions

* Optimize for size and performance.

* Fix unit test
2022-02-24 16:11:54 +11:00
Josh Stewart b7901568a0 Write to EEPROM more aggressively when engine not running 2022-02-24 10:50:01 +11:00
Josh Stewart 738ae2ed93 Add indicator showing when an EEPROM burn is in progress 2022-02-24 10:22:28 +11:00
Josh Stewart 3d627ded34 More efficient EEPROM write deferral 2022-02-22 23:29:41 +11:00
Josh Stewart ccfc344dc3 Move the calibration CRC value functions into storage.x 2022-02-11 11:59:36 +11:00
Josh Stewart fe33785ec5 Some potential fixes for comms issues with large writes 2022-01-18 16:57:55 +11:00
Josh Stewart e2dd7a388e Fix for O2 calibration not working on mega2560 2022-01-09 17:05:05 +11:00
Josh Stewart 9121b45995 Signatures for interim release 202202 2022-01-09 16:26:30 +11:00
Josh Stewart 300c8699cc New Comms change to prevent lockup during large table writes 2022-01-07 16:49:04 +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
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
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
tx_haggis 5e409445a4
Use table iterator for EEPROM read/write (#620)
* refactor: use a loop for writeAllConfig.

Future proofing: new pages will get automatically
written

* Call existing [read|store]EEPROMVersion functions

* Common function to compute CRC address

* Bulk write calibration tables

* Use EEPROM get/put instead of hand rolled code

* Typedef the EEPROM address

I.e. the EEPROM.read() parameter type

* Encapsulate eepromWritesPending

* Remove C++ namespaces

* Use table iterators for read/write

* Rename storage.ino to .cpp

This fixes a warning
2021-09-14 16:51:26 +10:00