speeduino/speeduino
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
..
src Disable automatic retransmission (#910) 2022-08-10 11:06:28 +10:00
SD_logger.h fix typos in code documentation (#816) 2022-04-11 10:49:58 +10:00
SD_logger.ino Do not run SD logging if overall setting is disabled 2022-08-31 14:48:46 +10:00
TS_CommandButtonHandler.h Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
TS_CommandButtonHandler.ino Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
acc_mc33810.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
acc_mc33810.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
auxiliaries.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
auxiliaries.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
board_avr2560.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
board_avr2560.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
board_same51.h Allow for float values in SD log where supported with FPU 2022-08-10 12:12:42 +10:00
board_same51.ino fix typos in code documentation (#816) 2022-04-11 10:49:58 +10:00
board_stm32_generic.h Allow for float values in SD log where supported with FPU 2022-08-10 12:12:42 +10:00
board_stm32_generic.ino fix typos in code documentation (#816) 2022-04-11 10:49:58 +10:00
board_stm32_official.h Allow for float values in SD log where supported with FPU 2022-08-10 12:12:42 +10:00
board_stm32_official.ino Fix hanging on boot (#858) 2022-06-27 11:54:47 +10:00
board_teensy35.h Allow for float values in SD log where supported with FPU 2022-08-10 12:12:42 +10:00
board_teensy35.ino Add OLCL mode to initBoard() for teensy (#903) 2022-07-28 10:22:42 +10:00
board_teensy41.h Configuration of PWM for idle, boost and vvt for Teensy4.1 (Take2) (#929) 2022-09-15 09:58:37 +10:00
board_teensy41.ino Update board_teensy41.ino (#937) 2022-10-09 13:48:53 +11:00
board_template.h Allow for float values in SD log where supported with FPU 2022-08-10 12:12:42 +10:00
board_template.ino fix typos in code documentation (#816) 2022-04-11 10:49:58 +10:00
canBroadcast.h [WIP] CAN broadcasting menu (#639) 2022-04-21 16:33:10 +10:00
canBroadcast.ino Correct typos found by codespell (#880) 2022-06-27 10:39:14 +10:00
cancomms.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
cancomms.ino Add deceleration enleanment feature (#939) 2022-12-14 11:17:47 +11:00
comms.cpp Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
comms.h Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
comms_legacy.cpp Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
comms_legacy.h Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
comms_sd.h Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
corrections.h Small memory reduction in AE code 2022-11-07 14:49:49 +11:00
corrections.ino Fix decel in AE Add -mode (#971) 2023-01-10 08:46:34 +09:00
crankMaths.h Change to single decoder state variable. Small (12 byte) RAM free up 2022-11-22 15:53:35 +11:00
crankMaths.ino Change to single decoder state variable. Small (12 byte) RAM free up 2022-11-22 15:53:35 +11:00
decoders.h Make curGap3 variable local. It's only used in one trigger. Also remove unused curTime3 variable. (#980) 2023-01-30 15:32:09 +11:00
decoders.ino Make curGap3 variable local. It's only used in one trigger. Also remove unused curTime3 variable. (#980) 2023-01-30 15:32:09 +11:00
display.h Move to PlatformIO for project layout 2017-02-06 20:56:46 +11:00
display.ino fix typos in code documentation (#816) 2022-04-11 10:49:58 +10:00
engineProtection.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
engineProtection.ino Fix unit tests following #939 2022-12-14 11:25:54 +00:00
errors.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
errors.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
globals.h Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
globals.ino Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
idle.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
idle.ino Added possibility to configure Steper bounds (#930) 2022-11-07 13:52:04 +11:00
init.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
init.ino Sync mode changes: fuel shouldn't impact ignition (#1009) 2023-02-20 09:15:13 +11:00
int16_byte.h Include CPP files in MISRA script (#925) 2022-09-15 12:16:14 +10:00
logger.h Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
logger.ino Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
maths.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
maths.ino libdivide structs can be const - saves a few bytes (#886) 2022-07-27 13:51:45 +10:00
page_crc.cpp Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
page_crc.h Initial work on new serial comms (Disabled in ini) 2021-11-19 11:07:38 +11:00
pages.cpp Table 3d: change X-axis orientation to match Y-axis (#771) 2022-11-14 10:26:14 +11:00
pages.h Table 3d: change X-axis orientation to match Y-axis (#771) 2022-11-14 10:26:14 +11:00
rtc_common.h Change name of rtc.h/.ino files to avoid conflict for stm32 2021-01-23 08:49:44 +11:00
rtc_common.ino Fix hanging on boot (#858) 2022-06-27 11:54:47 +10:00
scheduledIO.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
scheduledIO.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
scheduler.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
scheduler.ino Replace 8 channelXInjEnabled variables with 1 (#1001) 2023-02-06 11:48:11 +11:00
secondaryTables.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
secondaryTables.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
sensors.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
sensors.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
speeduino.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
speeduino.ino Refactor comms: save 130+ bytes RAM (#906) 2023-02-21 12:55:54 +11:00
storage.cpp Table3D: MISRA fixes (#973) 2023-01-11 10:58:48 +09:00
storage.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
table2d.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
table2d.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
table3d.cpp Table 3d: change X-axis orientation to match Y-axis (#771) 2022-11-14 10:26:14 +11:00
table3d.h Correct the get3DTableValue() return type. (#1007) 2023-02-14 07:43:45 +11:00
table3d_axes.h Table3D: MISRA fixes (#973) 2023-01-11 10:58:48 +09:00
table3d_axis_io.cpp Separate table axis I/O conversion from iteration (#767) 2022-02-24 16:11:54 +11:00
table3d_axis_io.h Include CPP files in MISRA script (#925) 2022-09-15 12:16:14 +10:00
table3d_interpolate.cpp Table 3d: change X-axis orientation to match Y-axis (#771) 2022-11-14 10:26:14 +11:00
table3d_interpolate.h Table3D: MISRA fixes (#973) 2023-01-11 10:58:48 +09:00
table3d_typedefs.h Table3D: MISRA fixes (#973) 2023-01-11 10:58:48 +09:00
table3d_values.h Table3D: MISRA fixes (#973) 2023-01-11 10:58:48 +09:00
timers.h Add Tacho Sweep function at startup (#935) 2023-01-11 14:27:16 +09:00
timers.ino Add Tacho Sweep function at startup (#935) 2023-01-11 14:27:16 +09:00
updates.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
updates.ino Add deceleration enleanment feature (#939) 2022-12-14 11:17:47 +11:00
utilities.h MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00
utilities.ino MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11:00