Commit Graph

8 Commits

Author SHA1 Message Date
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
Daniel Tobias 982b40a753
small doxygen fixes / config changes (#779)
* update Doxyfile to 1.9.3 (doxygen -u)

* doxygen config changes

* remove redundant Doxyfile

* fix param name
2022-02-14 10:02:39 +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
Josh Stewart b04939d0c7 Remove stm32f103 from automated Travis build 2019-06-25 13:41:59 +10:00
Josh Stewart 4705a594f6 Some initial testing of doxygen generation (on speeduino.ino/h files) 2019-04-09 10:58:55 +10:00
Josh Stewart 5f8530be3b Fix for doxygen failing to upload 2019-04-08 12:17:39 +10:00
Josh Stewart b93bc46d0d Initial doxygen stuff 2019-04-08 11:38:20 +10:00