mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.6 Multiplex
This commit is contained in:
parent
353b00ec0e
commit
55a0732cff
@ -6,7 +6,7 @@ jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: arduino/arduino-lint-action@v1
|
||||
with:
|
||||
library-manager: update
|
||||
|
@ -8,7 +8,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
|
@ -10,7 +10,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: json-syntax-check
|
||||
uses: limitusus/json-syntax-check@v1
|
||||
with:
|
||||
|
48
libraries/Multiplex/CHANGELOG.md
Normal file
48
libraries/Multiplex/CHANGELOG.md
Normal file
@ -0,0 +1,48 @@
|
||||
# Change Log multiPlex
|
||||
|
||||
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.2.6] - 2023-01-19
|
||||
- fix SoftwareSerial build
|
||||
- update GitHub actions
|
||||
- update license
|
||||
- minor edit unit tests
|
||||
- add changelog.md again :)
|
||||
|
||||
|
||||
## [0.2.5] - 2022-10-23
|
||||
- Add flush()
|
||||
- add changelog.md
|
||||
- add RP2040 support to build-CI
|
||||
|
||||
## [0.2.4] - 2022-06-12
|
||||
- add isEnabledAny() to see if writes makes sense.
|
||||
- keep the streams in adding order when removing a stream.
|
||||
- add getOutputCount() and resetOutputCount() to keep track of bytes multiplexed.
|
||||
|
||||
## [0.2.3] - 2021-12-22
|
||||
- update library.json, readme.md, license, minor edits
|
||||
|
||||
## [0.2.2] - 2021-09-12
|
||||
- add remove(Stream)
|
||||
- add remove(index)
|
||||
|
||||
## [0.2.1] - 2021-09-12
|
||||
- made index(Stream) public
|
||||
- added stream(index)
|
||||
- enable() / disable() return true on success
|
||||
- added free() function
|
||||
- minor refactor.
|
||||
|
||||
## [0.2.0] - 2021-08-09
|
||||
- See issues #2 and #3
|
||||
|
||||
----
|
||||
|
||||
## [0.1.0] - 2021-01-09
|
||||
- initial version
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021-2022 Rob Tillaart
|
||||
Copyright (c) 2021-2023 Rob Tillaart
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,13 +1,10 @@
|
||||
//
|
||||
// FILE: Multiplex.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.5
|
||||
// VERSION: 0.2.6
|
||||
// PURPOSE: Arduino library to multiplex streams
|
||||
// DATE: 2021-01-09
|
||||
// URL: https://github.com/RobTillaart/Multiplex
|
||||
//
|
||||
// HISTORY: see changelog.md
|
||||
|
||||
|
||||
|
||||
#include "Multiplex.h"
|
||||
@ -105,7 +102,7 @@ size_t Multiplex::write(const uint8_t *buffer, size_t size)
|
||||
}
|
||||
|
||||
|
||||
void Multiplex::flush() // see issue 13
|
||||
void Multiplex::flush() // see issue #13
|
||||
{
|
||||
for (uint8_t i = 0; i < _count; i++)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: Multiplex.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.5
|
||||
// VERSION: 0.2.6
|
||||
// PURPOSE: Arduino library to multiplex streams
|
||||
// DATE: 2021-01-09
|
||||
// URL: https://github.com/RobTillaart/Multiplex
|
||||
@ -11,7 +11,7 @@
|
||||
#include "Arduino.h"
|
||||
|
||||
|
||||
#define MULTIPLEX_LIB_VERSION (F("0.2.5"))
|
||||
#define MULTIPLEX_LIB_VERSION (F("0.2.6"))
|
||||
|
||||
|
||||
// MAX 254 (in theory) as 0xFF is a special value
|
||||
@ -39,7 +39,7 @@ public:
|
||||
bool remove(Print * stream);
|
||||
bool remove(uint8_t index);
|
||||
|
||||
// see issue 13
|
||||
// see issue #13
|
||||
virtual void flush() override;
|
||||
|
||||
// CONTROL
|
||||
|
@ -153,7 +153,10 @@ See examples
|
||||
|
||||
## Future
|
||||
|
||||
#### 0.3.0
|
||||
#### Must
|
||||
|
||||
|
||||
#### Should
|
||||
|
||||
- set size in constructor
|
||||
- dynamic memory for all internal arrays
|
||||
@ -163,7 +166,8 @@ See examples
|
||||
- breaking change ==> 0.3.0
|
||||
- add **removeAll()** ==> reset()
|
||||
|
||||
#### should
|
||||
|
||||
#### Could
|
||||
|
||||
- error handling
|
||||
- add an error flag if one of the streams does not **write()**
|
||||
@ -173,7 +177,7 @@ correctly and returns 0 or less than it should.
|
||||
- KB / second
|
||||
- move all code to .cpp
|
||||
|
||||
#### wont
|
||||
#### Wont
|
||||
|
||||
- pack enabled flag in one or more bytes.
|
||||
(not much faster + need to encode/decode)
|
||||
|
@ -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:
|
||||
@ -9,4 +24,5 @@ compile:
|
||||
# - esp32
|
||||
# - esp8266
|
||||
- mega2560
|
||||
# - rpipico
|
||||
|
||||
|
@ -1,13 +1,31 @@
|
||||
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:
|
||||
- uno
|
||||
# - due
|
||||
# - zero
|
||||
# - due // has no SoftwareSerial
|
||||
# - zero // has no SoftwareSerial
|
||||
- leonardo
|
||||
# - m4
|
||||
# - esp32
|
||||
# - esp8266
|
||||
# - m4 // has no SoftwareSerial
|
||||
# - esp32 // has no SoftwareSerial
|
||||
- esp8266
|
||||
- mega2560
|
||||
- rpipico
|
||||
# external libraries
|
||||
libraries:
|
||||
# - SoftwareSerial # werkt niet..
|
||||
# - "SoftwareSerial" does not work as it is build in.
|
||||
|
||||
|
@ -1,14 +1,31 @@
|
||||
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:
|
||||
- uno
|
||||
# - due
|
||||
# - zero
|
||||
# - due // has no SoftwareSerial
|
||||
# - zero // has no SoftwareSerial
|
||||
- leonardo
|
||||
# - m4
|
||||
# - esp32
|
||||
# - esp8266
|
||||
# - m4 // has no SoftwareSerial
|
||||
# - esp32 // has no SoftwareSerial
|
||||
- esp8266
|
||||
- mega2560
|
||||
- rpipico
|
||||
# external libraries
|
||||
libraries:
|
||||
# - SoftwareSerial # werkt niet..
|
||||
# - "SoftwareSerial" does not work as it is build in.
|
||||
- "SD"
|
||||
|
@ -1,13 +1,31 @@
|
||||
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:
|
||||
- uno
|
||||
# - due
|
||||
# - zero
|
||||
# - due // has no SoftwareSerial
|
||||
# - zero // has no SoftwareSerial
|
||||
- leonardo
|
||||
# - m4
|
||||
# - esp32
|
||||
# - esp8266
|
||||
# - m4 // has no SoftwareSerial
|
||||
# - esp32 // has no SoftwareSerial
|
||||
- esp8266
|
||||
- mega2560
|
||||
- rpipico
|
||||
# external libraries
|
||||
libraries:
|
||||
# - SoftwareSerial # werkt niet..
|
||||
# - "SoftwareSerial" does not work as it is build in.
|
||||
|
||||
|
@ -1,13 +1,31 @@
|
||||
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:
|
||||
- uno
|
||||
# - due
|
||||
# - zero
|
||||
# - due // has no SoftwareSerial
|
||||
# - zero // has no SoftwareSerial
|
||||
- leonardo
|
||||
# - m4
|
||||
# - esp32
|
||||
# - esp8266
|
||||
# - m4 // has no SoftwareSerial
|
||||
# - esp32 // has no SoftwareSerial
|
||||
- esp8266
|
||||
- mega2560
|
||||
- rpipico
|
||||
# external libraries
|
||||
libraries:
|
||||
# - SoftwareSerial # werkt niet..
|
||||
# - "SoftwareSerial" does not work as it is build in.
|
||||
|
||||
|
@ -1,13 +1,31 @@
|
||||
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:
|
||||
- uno
|
||||
# - due
|
||||
# - zero
|
||||
# - due // has no SoftwareSerial
|
||||
# - zero // has no SoftwareSerial
|
||||
- leonardo
|
||||
# - m4
|
||||
# - esp32
|
||||
# - esp8266
|
||||
# - m4 // has no SoftwareSerial
|
||||
# - esp32 // has no SoftwareSerial
|
||||
- esp8266
|
||||
- mega2560
|
||||
- rpipico
|
||||
# external libraries
|
||||
libraries:
|
||||
# - SoftwareSerial # werkt niet..
|
||||
# - "SoftwareSerial" does not work as it is build in.
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/Multiplex"
|
||||
},
|
||||
"version": "0.2.5",
|
||||
"version": "0.2.6",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=Multiplex
|
||||
version=0.2.5
|
||||
version=0.2.6
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino Library implementing a stream multiplexer
|
||||
|
@ -1,9 +1,9 @@
|
||||
//
|
||||
// FILE: unit_test_001.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// DATE: 2021-01-01
|
||||
// PURPOSE: unit tests for the XXXXXX
|
||||
// https://github.com/RobTillaart/
|
||||
// DATE: 2021-01-09
|
||||
// PURPOSE: unit tests for the Multiplex
|
||||
// https://github.com/RobTillaart/Multiplex
|
||||
// https://github.com/Arduino-CI/arduino_ci/blob/master/REFERENCE.md
|
||||
//
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
#include "Arduino.h"
|
||||
#include "Multiplex.h"
|
||||
|
||||
|
||||
// A simple implementation of Print that outputs
|
||||
// to Serial, prefixing each call to write(buffer, size)
|
||||
// with an id.
|
||||
@ -129,4 +130,4 @@ unittest(test_enable)
|
||||
unittest_main()
|
||||
|
||||
|
||||
// --------
|
||||
// -- END OF FILE --
|
||||
|
Loading…
Reference in New Issue
Block a user