0.3.1 SHEX

This commit is contained in:
rob tillaart 2022-11-24 12:47:19 +01:00
parent 650d554979
commit f2e0254ab3
8 changed files with 90 additions and 36 deletions

View File

@ -1,3 +1,18 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
@ -7,5 +22,6 @@ compile:
# - leonardo
- m4
- esp32
# - esp8266
- esp8266
# - mega2560
- rpipico

View File

@ -0,0 +1,50 @@
# Change Log SHEX
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.3.1] - 2022-11-24
- Add RP2040 support to build-CI.
- Add CHANGELOG.md
## [0.3.0 2022-05-28 breaking!
- change default HEX output instead of pass through.
- add get / setCountDigits() =>
- #digits of count 4, 6 or 8 (4 = default)
- replaces get / setCounterFlag()
- add define SHEX_COUNTER_DIGITS + SHEX_MIN_LENGTH
- add restartOutput() and getCounter()
- add SHEXA class for ASCII column output
- add SHEXA::flushASCII().
----
## [0.2.3] - 2022-05-28
- add setVTAB(vtab) getVTAB()
- add define SHEX_DEFAULT_VTAB
## [0.2.2] - 2022-05-27
- fix #6 set default length
- add defines SHEX_DEFAULT_LENGTH + SHEX_MAX_LENGTH
## [0.2.1] - 2021-12-28
- update library.json
- update readme.md
- update license
- minor edits
## [0.2.0] - 2021-01-07
- Arduino-CI + unit tests + modifiers
----
## [0.1.1] - 2020-06-19
- fix library.json
## [0.1.0] - 2020-05-24
- initial version

View File

@ -133,27 +133,31 @@ See examples.
Although no follow up release is planned, some ideas are kept here
so they won't get lost.
### Must
#### Must
- optimize code
- print vs write
#### should
- more testing
- performance measurement
- different platforms.
- different streams incl SW Serial
### Could
#### Could
- investigate **flushASCII()** for better solutions.
- HEX reader: **RHEX** converts dump format to a normal stream again.
- separate library.
- void setSeparatorInterval() ??
### Wont
#### Wont
- line buffering for faster output (e.g Ethernet and SD card)
could it support **write(array, length)** call.
needs quite a rewrite..
Needs a big buffer: ~150 bytes. (counter 8 + hex 96 + printable 32 + extra sep)
==> go through a small buffer twice as data is same!!
- header line: runtime configurable;
optional combined with separator
and after how many lines the header should repeat

View File

@ -1,29 +1,10 @@
//
// FILE: SHEX.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.3.0
// VERSION: 0.3.1
// PURPOSE: Arduino library to generate hex dump over Serial
// DATE: 2020-05-24
// URL: https://github.com/RobTillaart/SHEX
//
// HISTORY:
// 0.1.0 2020-05-24 initial version
// 0.1.1 2020-06-19 fix library.json
// 0.2.0 2021-01-07 Arduino-CI + unit tests + modifiers.
// 0.2.1 2021-12-28 update library.json, readme, license, minor edits
// 0.2.2 2022-05-27 fix #6 set default length
// add defines SHEX_DEFAULT_LENGTH + SHEX_MAX_LENGTH
// 0.2.3 2022-05-28 add setVTAB(vtab) getVTAB()
// add define SHEX_DEFAULT_VTAB
// 0.3.0 2022-05-28 breaking!
// change default HEX output instead of pass through.
// add get / setCountDigits() =>
// #digits of count 4, 6 or 8 (4 = default)
// replaces get / setCounterFlag()
// add define SHEX_COUNTER_DIGITS + SHEX_MIN_LENGTH
// add restartOutput() and getCounter()
// add SHEXA class for ASCII column output
// add SHEXA::flushASCII().
#include "SHEX.h"
@ -59,7 +40,7 @@ void SHEX::reset()
///////////////////////////////////////////
//
// WRITE - the core
// WRITE - the core
//
size_t SHEX::write(uint8_t c)
{
@ -115,7 +96,7 @@ void SHEX::setHEX(bool hexOutput)
void SHEX::setBytesPerLine(const uint8_t length)
{
// force multiple of 4; max 32
// force multiple of 4; max 32
_length = ((length + 3) / 4) * 4;
if (_length > SHEX_MAX_LENGTH)
{
@ -165,7 +146,7 @@ SHEXA::SHEXA(Print* stream, uint8_t length) : SHEX(stream, length)
size_t SHEXA::write(uint8_t c)
{
// PASS THROUGH MODE
// PASS THROUGH MODE
if (_hexOutput == false) return _stream->write(c);
// HEX MODE
@ -225,5 +206,6 @@ void SHEXA::flushASCII()
}
}
// -- END OF FILE --
// -- END OF FILE --

View File

@ -2,7 +2,7 @@
//
// FILE: SHEX.h
// AUTHOR: Rob Tillaart
// VERSION: 0.3.0
// VERSION: 0.3.1
// PURPOSE: Arduino library to generate hex dump over Serial
// DATE: 2020-05-24
// URL: https://github.com/RobTillaart/SHEX
@ -83,5 +83,5 @@ protected:
};
// -- END OF FILE --
// -- END OF FILE --

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/SHEX.git"
},
"version": "0.3.0",
"version": "0.3.1",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=SHEX
version=0.3.0
version=0.3.1
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library to generate hex dump over Serial

View File

@ -29,6 +29,7 @@
// assertNAN(arg); // isnan(a)
// assertNotNAN(arg); // !isnan(a)
#include <ArduinoUnitTests.h>
#include "SHEX.h"
@ -49,9 +50,9 @@ unittest(test_constants)
{
assertEqual(16, SHEX_DEFAULT_LENGTH);
assertEqual(32, SHEX_MAX_LENGTH);
assertEqual(4, SHEX_MIN_LENGTH);
assertEqual(4, SHEX_COUNTER_DIGITS);
assertEqual(8, SHEX_DEFAULT_VTAB);
assertEqual(4, SHEX_MIN_LENGTH);
assertEqual(4, SHEX_COUNTER_DIGITS);
assertEqual(8, SHEX_DEFAULT_VTAB);
}
@ -150,4 +151,5 @@ unittest(test_vtab)
unittest_main()
// --------