0.3.3 PrintCharArray

This commit is contained in:
rob tillaart 2022-11-22 15:51:21 +01:00
parent 55a6809e80
commit 6a40e32753
6 changed files with 75 additions and 22 deletions

View File

@ -1,14 +1,32 @@
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
# selected only those that work
platforms:
- uno
- due
- zero
- leonardo
# - due
# - zero
# - leonardo
- m4
- esp32
# - esp8266
- esp8266
# - mega2560
- rpipico
# Declaring Dependent Arduino Libraries (to be installed via the Arduino Library Manager)
libraries:
- "XMLWriter"

View File

@ -0,0 +1,38 @@
# Change Log PrintCharArray
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.3] - 2022-11-22
- add changelog.md
- add RP2040 to build-CI
- minor edit readme.md
## [0.3.2] - 2021-12-24
- update library.json, license, minor edits
## [0.3.1] - 2021-11-13 update Arduino-CI, readme.md
- add conditional PRINTCHARARRAY_MAX_BUFFER_SIZE
- add write(char \* str, uint8_t length) Print interface.
## [0.3.0] - 2021-01-06
- Arduino-CI + unit test, free -> available()
----
## [0.2.1] - 2020-06-19 fix library.json
## [0.2.0] - 2020-04-30 dynamic memory
----
## [0.1.1] - 2020-04-28
- minor optimization
## [0.1.0] - 2017-12-07
- initial version

View File

@ -2,27 +2,17 @@
//
// FILE: PrintCharArray.h
// AUTHOR: Rob Tillaart
// VERSION: 0.3.2
// VERSION: 0.3.3
// PURPOSE: Class that captures prints into a char array
// DATE: 2017-12-07
// URL: https://github.com/RobTillaart/PrintCharArray
//
// HISTORY
// 0.1.0 2017-12-07 initial version
// 0.1.1 2020-04-28 minor optimization
// 0.2.0 2020-04-30 dynamic memory
// 0.2.1 2020-06-19 fix library.json
// 0.3.0 2021-01-06 Arduino-CI + unit test, free -> available()
// 0.3.1 2021-11-13 update Arduino-CI, readme.md
// add conditional PRINTCHARARRAY_MAX_BUFFER_SIZE
// add write(char * str, uint8_t length) Print interface.
// 0.3.2 2021-12-24 update library.json, license, minor edits
#include "Arduino.h"
#include "Print.h"
#define PRINTCHARARRAY_VERSION (F("0.3.2"))
#define PRINTCHARARRAY_VERSION (F("0.3.3"))
#ifndef PRINTCHARARRAY_MAX_BUFFER_SIZE
#define PRINTCHARARRAY_MAX_BUFFER_SIZE 250
@ -58,7 +48,7 @@ public:
size_t write(uint8_t * str, uint8_t length)
{
if ( (int(_index) + length) >= _bufSize) return 0; // does not fit.
if ( (int(_index) + length) >= _bufSize) return 0; // does not fit.
uint8_t len = length;
uint8_t i = 0;
@ -82,7 +72,7 @@ public:
}
// int length() { return _index; }; // better as size()?
// int length() { return _index; }; // better as size()?
int size()
{
return _index;
@ -109,5 +99,5 @@ private:
};
// -- END OF FILE --
// -- END OF FILE --

View File

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

View File

@ -1,5 +1,5 @@
name=PrintCharArray
version=0.3.2
version=0.3.3
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Library to capture prints into a char array.

View File

@ -51,7 +51,14 @@ See examples.
## Future
#### must
- documentation
#### should
- move code to .cpp file
- testing
#### could
- examples
- inject spaces in "middle align" example? possible?
- rename some