0.1.2 DEVFULL

This commit is contained in:
rob tillaart 2022-10-31 19:44:49 +01:00
parent afe39794bd
commit 955c94007d
8 changed files with 64 additions and 24 deletions

View File

@ -1,11 +1,28 @@
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: compile:
# Choosing to run compilation tests on 2 different Arduino platforms # Choosing to run compilation tests on 2 different Arduino platforms
platforms: platforms:
- uno - uno
- due # - due
- zero # - zero
- leonardo # - leonardo
- m4 - m4
- esp32 - esp32
- esp8266 - esp8266
- mega2560 # - mega2560
- rpipico

View File

@ -0,0 +1,18 @@
# Change Log DEVFULL
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.1.2] - 2022-10-31
- add changelog.md
- add rp2040 to build-CI
## [0.1.1] - 2022-07-01
- add limits.h INT_MAX to support 32 bit int.
## [0.1.0] - 2022-03-11
- initial version

View File

@ -2,21 +2,18 @@
// //
// FILE: DEVFULL.h // FILE: DEVFULL.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.1 // VERSION: 0.1.2
// PURPOSE: Arduino library for a /dev/full stream - useful for testing / debugging. // PURPOSE: Arduino library for a /dev/full stream - useful for testing / debugging.
// URL: https://github.com/RobTillaart/DEVFULL // URL: https://github.com/RobTillaart/DEVFULL
// //
// HISTORY: // HISTORY: see changelog.md
// 0.1.0 2022-03-11 initial version.
// 0.1.1 2022-07-01 add limits.h INT_MAX to support 32 bit int.
#include "Arduino.h" #include "Arduino.h"
#include "limits.h" #include "limits.h"
#define DEVFULL_LIB_VERSION (F("0.1.1")) #define DEVFULL_LIB_VERSION (F("0.1.2"))
#ifndef ENOSPC #ifndef ENOSPC
@ -34,23 +31,23 @@ class DEVFULL : public Stream
public: public:
DEVFULL() DEVFULL()
{ {
setTimeout(0); // no timeout. setTimeout(0); // no timeout.
}; };
int available() { return INT_MAX; }; int available() { return INT_MAX; };
int peek() { return 0; }; int peek() { return 0; };
int read() { return 0; }; int read() { return 0; };
void flush() { return; }; // placeholder to keep build CI happy void flush() { return; }; // placeholder to keep build CI happy
size_t write(const uint8_t data) size_t write(const uint8_t data)
{ {
dummy = data; // keep compiler happy dummy = data; // keep compiler happy
return -28; return -28;
}; };
size_t write( const uint8_t *buffer, size_t size) size_t write( const uint8_t *buffer, size_t size)
{ {
dummy = buffer[size-1]; // keep compiler happy dummy = buffer[size-1]; // keep compiler happy
return -28; return -28;
}; };

View File

@ -23,12 +23,6 @@ This causes a return value of n x -28 ==> mostly a number in the 65xxx range
See - https://en.wikipedia.org/wiki//dev/full See - https://en.wikipedia.org/wiki//dev/full
## Versions
- 0.1.0 is a minimal implementation.
- 0.1.1 implements INT_MAX
## Interface ## Interface
- **DEVFULL()** constructor, sets the timeout to zero. - **DEVFULL()** constructor, sets the timeout to zero.
@ -62,4 +56,3 @@ See examples.
- improve code - improve code
- test different platforms. - test different platforms.

View File

@ -3,7 +3,7 @@
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// PURPOSE: demo // PURPOSE: demo
// //
// this shows that a print can be split up in many write calls // this shows that a print can be split up in many write calls
// that all return -28. Print will add these together. // that all return -28. Print will add these together.
// (is a limit of the Arduino environment) // (is a limit of the Arduino environment)

View File

@ -0,0 +1,15 @@
// test run on IDE 1.8.19 UNO
// test run while working on improvements for 0.1.2)
DEVFULL_performance.ino
DEVFULL_LIB_VERSION: 0.1.2
PRINTLN: 20 2
WRITE: 4 1
long: 356 1
float0: 64 1
float1: 596 7
float2: 1096 12
float3: 1612 17
float4: 2116 22

View File

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

View File

@ -1,5 +1,5 @@
name=DEVFULL name=DEVFULL
version=0.1.1 version=0.1.2
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for a /dev/full stream sentence=Arduino library for a /dev/full stream