xxAtrain223 / EmbMessenger

Command based communication library for embedded devices.
MIT License
2 stars 1 forks source link

Move device tables into program space #9

Closed xxAtrain223 closed 4 years ago

xxAtrain223 commented 4 years ago

This pull request moves the CRC table and command array into program space on the device as proposed in issue #8.

These two files were created to show the data memory usage between master and device. They were compiled by avr-gcc for an Arduino Uno. master.ino

DATA:    [===       ]  28.6% (used 586 bytes from 2048 bytes)
PROGRAM: [==        ]  17.1% (used 5500 bytes from 32256 bytes)

device_progmem.ino

DATA:    [==        ]  16.0% (used 328 bytes from 2048 bytes)
PROGRAM: [==        ]  15.3% (used 4926 bytes from 32256 bytes)

The CRC table used up 256 bytes and the command array used up 2 bytes per command (on the Arduino Uno). Reading the data from program space only takes 1 more cycle, so not a significant amount of time.

codecov[bot] commented 4 years ago

Codecov Report

Merging #9 into master will decrease coverage by 0.2%. The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #9      +/-   ##
==========================================
- Coverage   97.28%   97.08%   -0.21%     
==========================================
  Files          27       27              
  Lines        2435     2508      +73     
==========================================
+ Hits         2369     2435      +66     
- Misses         66       73       +7
Impacted Files Coverage Δ
host/test/EmbMessenger.cpp 100% <ø> (ø) :arrow_up:
shared/include/EmbMessenger/Crc.hpp 100% <100%> (ø) :arrow_up:
device/include/EmbMessenger/EmbMessenger.hpp 93.47% <100%> (-0.93%) :arrow_down:
device/test/EmbMessenger.cpp 90.78% <88.88%> (-0.29%) :arrow_down:
host/src/EmbMessenger.cpp 93.3% <0%> (-0.3%) :arrow_down:
host/include/EmbMessenger/Command.hpp 100% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c39e43c...b7cd4d0. Read the comment docs.