Commit Graph

44 Commits

Author SHA1 Message Date
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
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
Josh Stewart 87e21fc7e2 Increase O2 read frequency to 30Hz
Fixes #799
2022-02-25 15:13:35 +11:00
Josh Stewart b7901568a0 Write to EEPROM more aggressively when engine not running 2022-02-24 10:50:01 +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 c6a37f7347 Implement tableCrcCommand command. Fixes #786 until TS 3.1.07.1 is released
The tableCrcCommand is used by TS to determine what calibrations (IAT, CLT and O2) are currently on the board. This is an optional command, however v3.1.07 unintentionally assumed it was implemented on all boards and gave a 'null' error if the command was not present.
This adds the command for all future versions, but previous releases will need to wait for theTS fix release
2022-02-07 11:05:41 +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 300c8699cc New Comms change to prevent lockup during large table writes 2022-01-07 16:49:04 +11:00
Daniel Tobias b0acb92742
update documentation of EEPROM layout (#694) 2021-10-26 10:01:13 +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
Pasi Kemppainen 982e52db1b
VVT2 addition and closed loop VVT improvement (#551)
* VVT2 and closed loop VVT improvement

* Fix building for latest changes

* Fix CRC error

Co-authored-by: Josh Stewart <josh@noisymime.org>
2021-04-22 08:56:39 +10:00
tx_haggis 02cb7bebd6
Isolate table3D member access in comms.ino (#545)
* fix!: fix ODR violations

* refactor: move page specific code into a separate CPP file

* refactor: page getter/setter share mapping logic

Extract common page-to-entity mapping logic from
getPageValue() & setPageValue() - place in map_page_offset_to_entity()
and share.

* performance: optimize CRC calc

Calculate page CRC by iterating over entities & tables.

* CRC table calculation - use table iterator

* refactor: use iterators for sendPage()

Re-implement sendPage() using page & table iterators
Future proof & fast

* refactor: sendPageASCII()

Pull put shared code into functions.
Use table iterator

* refactor: use shared axis factor

This puts the axis factor usage in one place

* refactor: encapsulate page size & count

Added getPageCount() & getPageSize()

* Added static_assert for all pages.

* Remove C++ language elements

namesapces, scope resolution, enum struct

* Rename comms.ino to comms.cpp

Provides better encapsulation of non-global
data & functions.

INO files are all mashed together by some
custom process. So everything becomes global and
static functions/variables aren't really private to
 the translation unit. Thus breaking encapsulation :-(
2021-04-21 14:36:27 +10:00
Josh Stewart 57ebf498a1 Add fuel trim tables 5-8 2021-02-15 16:01:28 +11:00
Pasi Kemppainen f67817b4ad
Dwell map addition (#525)
* Add dwell map

* Add information about the dwell settings

* Fix copy/paste error

Co-authored-by: Pasi Kemppainen <pazi88@users.noreply.github.com>
2021-02-12 09:11:42 +11:00
Josh Stewart 414d664c03 Fix for excessive EEPROM writes causing disconnect when loading tune onto blank board 2021-02-03 11:51:17 +11:00
Vitor Moreno B. Sales c59153a9d7
Fix pages 13 and 14 EEPROM allocation (#487)
* Fix pages 13 and 14 EEPROM allocation

* Update must start from the end of EEPROM

* Fix allocation
2021-02-02 09:41:51 +11:00
Tjeerd 6078b7e32a
Changes to prevent board lockup with initial run. (EEPROM all 0xFF) (#463)
Co-authored-by: Tjeerd <tjeerdie@users.noreply.github.com>
Co-authored-by: Josh Stewart <josh@noisymime.org>
2020-12-02 11:04:37 +11:00
Josh Stewart fb15a565ea
Pr/435 (#445). Closes #435
* Add files via upload

* Add files via upload

* Update storage.h

* Update log size

Co-authored-by: DylanRooijakkers <69131866+DylanRooijakkers@users.noreply.github.com>
Co-authored-by: Dylan Rooijakkers <rooijakkersd@gmail.com>
2020-08-23 08:27:44 +10:00
Vitor Moreno B. Sales b29fa21775
Programmable outputs (#396)
* Programmable outputs

* Prevent array overflow

* Show fullStatus variables names on dialog

* Further fixes

* Update with master

Co-authored-by: Josh Stewart <josh@noisymime.org>
2020-08-12 14:21:36 +10:00
Josh Stewart 53c0dedde1 Complete new calibration routines for testing 2020-08-11 12:07:12 +10:00
Josh Stewart 0fe885344f Mostly working temp calibrations (See #422) 2020-08-07 14:30:56 +10:00
Mateusz Muszyński 5b342d27bd
Water methanol injection (#417). Refer #154
* Add water methanol injection

* Set signature back to default

* Set signature back to default

Co-authored-by: Josh Stewart <josh@noisymime.org>
2020-07-22 11:27:21 +10:00
Josh Stewart 90fe79a059 Only allow the oil pressure protection to enable if the oil pressure input is actually on 2020-07-07 16:47:28 +10:00
Tjeerd 1530bb892e
EEPROM emulation on internal flash for STM32F407 (#372)
* Added new Flash EEPROM emulation

# Conflicts:
#	platformio.ini
#	speeduino/board_stm32_official.ino
#	speeduino/init.ino
#	speeduino/src/SPIAsEEPROM/SPIAsEEPROM.cpp
#	speeduino/src/SPIAsEEPROM/SPIAsEEPROM.h

* changes to storage to make SPI flash work again

* cleanup
2020-05-06 15:22:48 +10:00
Josh Stewart 8df2c46833 Initial memory allocation for 2nd fuel map 2019-04-10 15:58:38 +10:00
Josh Stewart 0697819f9c Initial work on CRC32 calcs for pages 2019-03-17 22:14:29 +11:00
Josh Stewart 21cd8609ea Fix a bug where calibration routines could potentially overwrite the early memory areas in EEPROM 2019-02-14 19:53:16 +11:00
Josh Stewart 750d486276 VERY rough initial work on modular boards layout 2019-01-17 20:47:19 +11:00
Josh Stewart f1182d569d
Merge branch 'master' into local_auxin3 2018-07-25 16:38:07 +10:00
Josh Stewart ce0e399201 More warnings cleanup 2018-07-19 23:26:31 +10:00
darren siepka 8dd9ed9fbd improve TS ini selection options
fix bit masking
storage table fix
2018-07-04 01:16:35 +01:00
VitorBoss 27e22eef1b Merge branch 'master' of git://github.com/noisymime/speeduino 2018-02-01 18:28:53 -02:00
Josh Stewart 8e2e3f125b Convert all tables in code to match the numbering in the ini (Probably has bugs for now) 2018-01-24 12:05:50 +11:00
VitorBoss d746de22f8 Increase STM32 max write 2017-12-13 15:21:33 -02:00
Josh Stewart 2989e32f15 Memory adjustments for staging fuel table 2017-11-21 15:17:55 +11:00
Josh Stewart 9d89494666 Expand page 4 to 128 bytes 2017-09-20 12:15:41 +10:00
Josh Stewart 1cd2a0f296 Expand page 2 to 128 bytes in size 2017-09-19 15:09:32 +10:00
Josh Stewart 5b3df5ac4d Merge config pages 6 and 7 2017-09-19 14:51:33 +10:00
Josh Stewart ae780dc940 New per page based EEPROM writes 2017-09-19 14:05:43 +10:00
Josh Stewart ccb6e194b7 Initial work creating a new memory page (pg 11) 2017-07-20 16:54:50 +10:00
Josh Stewart f27f883a5c Add updater mechanism for translating data between firmware versions 2017-05-16 15:05:39 +10:00
Josh Stewart c555bbc060 Move to PlatformIO for project layout 2017-02-06 20:56:46 +11:00