Commit Graph

8 Commits

Author SHA1 Message Date
Josh Stewart 2fc29ceef5 MISRA cleanup rule: misra-c2012-8.2 2022-11-06 09:43:29 +11: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 326405ac55 Flag an error if an invalid MAP reading is calculated 2020-05-22 15:26:20 +10:00
Josh Stewart ccad3d258f VSS calibration routines (untested) 2020-04-23 20:34:31 +10:00
Josh Stewart bc096fbae3 Bunch of minor error cleanup 2018-08-15 17:44:30 +10:00
Josh Stewart c8fa9f9246 MISRA compliant errors.ino 2017-06-16 16:41:45 +10:00
Josh Stewart a7d0a95611 Use currentStatus.spark rather than currentStatus.engine for error indicator. Fixes #67 2017-02-14 15:21:38 +11:00
Josh Stewart c555bbc060 Move to PlatformIO for project layout 2017-02-06 20:56:46 +11:00