Go to file
tx_haggis f95b4978cd
Refactor comms: save 130+ bytes RAM (#906)
* Remove serialCRC - only used within parseSerial()
Also hoist the CRC read into a function.

* Minimize global variable visibility

* Encapsulate write of multi-byte primitives

* Factor out sendBufferAndCrc()

* Push safety test into TS_CommandButtonsHandler()

* Extract writePage()

* Simpler parsing

* Remove some functions from public interface

* Store constant arrays in progmem

* Centralize high speed logger start/stop code

* Factor out loadO2Calibration()

* Factor out temperature calibration table update functions

* Remove dead code

* Fix sendToothLog()

* Fix sendCompositeLog()

* Replace tooth log send booleans with an enum
Saves a byte

* Remove sendBufferAndCrcProgMem()
Use serialPayload to send

* Whitespace clean up

* Optimize comms.cpp for size

* Replace global unsigned long with bool
Saves 2 bytes

* Replace 2 global bools with an enum
Saves a byte, reads better.

* Remove global FastCRC instance

* Make sendSerialReturnCode blocking.
It was using non-blocking functions but was never
re-entered.
Rename to make blocking & non-blocking calls
more obvious.

* Use one uint16_t to track RX/TX byte count

* Simplify new comms log tx API

* Extract loadPageToBuffer function

* All endianess changes use the same code

* Doxygen comments and code organization

* Remove serialWriteUpdateCrc() & updateTmpCalibration()

* Combine SerialStatus & logSendStatus enums.
Makes sense since we can only be doing one thing at a time.

* Remove global inProgressCompositeTime
Only used when sending composite log

* Replace 3 global bools with expanded SerialStatus enum

* Remove unused global tsCanId

* Limit scope of some comms globals.

* Remove isMap global - replace witth function

* Reduce the serial API to only 2 calls
transmit & receive

* Tidy up #define visibility

* Fix Black* build errors

* Workaround Teensy code race condition
availableForWrite() is not reliable.

* Prevent race condition
Was pematurely setting the serialStatusFlag to
SERIAL_INACTIVE before final CRC ws read from
serial.

* Use post write buffer availability checks
Remove buffer size check prior to writing.

* Write multi-byte values as single bytes.
(attempt to fix Teensy 3.5 issue)

* Only use Serial.available() as a boolean test
(Teensy fix)

* writeNonBlocking checks Serial.write() return value

* Non-blocking CRC write
In sendBufferAndCrcNonBlocking().

* Fix compile warning

* Set serial status flag prior to transmitting!

* Reliable blocking byte writes.

* Fix timeout code: not firing under some conditions

* MISRA fixes
2023-02-21 12:55:54 +11:00
.github
lib
misra
reference Duplicate engine_constants dialog (#997) 2023-02-01 14:24:26 +11:00
speeduino Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
test
.gitattributes
.gitignore
Doxyfile Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
LICENSE
README.md Fix README badges 2023-01-10 08:59:01 +09:00
contributing.md
platformio.ini

README.md

Speeduino

Release License Build Status Unit Tests Open Bounties GitHub commits badge https://img.shields.io/discord/879495735912071269

A low cost, DIY friendly Engine Management System (ECU) based on the Arduino framework

Speeduino

The Speeduino project is a flexible, fully featured Engine Management Systems (EMS aka ECU) based on the low cost and open source Arduino platform. It provides the hardware, firmware and software components that make up an engine management system, all provided under open licenses. With over 1000 installations, Speeduino has matured into a product that meets the needs of the hobbyist and enthusiast community without driving prices to the levels of traditional aftermarket ECUs.

Documentation

The Speeduino online manual can be found at: https://wiki.speeduino.com

Where to Buy

Pre-made Speeduino units/boards are available from a number of official resellers

These resellers all contribute a portion of sales back to the project to allow for continued development to take place and we encourage sales through them whenever possible.

Of course, being open source, you are free to use the design files provided here to create your own hardware!

Support

In addition the manual referenced above, Speeduino has a large and very vibrant community of people to help out with your setup or any questions you might add.

Contributors

This project exists thanks to all the people who contribute, both in terms of code and testing provided. If you'd like to get involved, please have a read through Contributing and then jump on Slack to discuss things further