From bf690e8fa2bb1382f4216dd9e9d3a91ff7e36833 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Fri, 12 Jun 2026 11:32:15 +0200 Subject: [PATCH] update GitHub actions --- .github/workflows/arduino-lint.yml | 2 +- .github/workflows/arduino_test_runner.yml | 3 +- .github/workflows/jsoncheck.yml | 2 +- CHANGELOG.md | 5 ++ FastShiftIn.cpp | 2 +- FastShiftIn.h | 8 ++- LICENSE | 2 +- README.md | 22 ++++---- .../fastShiftIn_test/performance_0.4.1.txt | 51 +++++++++++++++++++ library.json | 2 +- library.properties | 2 +- 11 files changed, 75 insertions(+), 26 deletions(-) create mode 100644 examples/fastShiftIn_test/performance_0.4.1.txt diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml index 0ad60f4..aed264b 100644 --- a/.github/workflows/arduino-lint.yml +++ b/.github/workflows/arduino-lint.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: arduino/arduino-lint-action@v2 with: library-manager: update diff --git a/.github/workflows/arduino_test_runner.yml b/.github/workflows/arduino_test_runner.yml index 1897982..a2a5f07 100644 --- a/.github/workflows/arduino_test_runner.yml +++ b/.github/workflows/arduino_test_runner.yml @@ -6,9 +6,8 @@ jobs: runTest: runs-on: ubuntu-latest timeout-minutes: 20 - steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 diff --git a/.github/workflows/jsoncheck.yml b/.github/workflows/jsoncheck.yml index 8804e69..2c52dc7 100644 --- a/.github/workflows/jsoncheck.yml +++ b/.github/workflows/jsoncheck.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: json-syntax-check uses: limitusus/json-syntax-check@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d7c9b2..c04b49c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.4.2] - 2026-06-12 +- update readme.md +- update GitHub actions +- minor edits + ## [0.4.1] - 2025-10-12 - update GitHub actions - update examples diff --git a/FastShiftIn.cpp b/FastShiftIn.cpp index 9300b92..a121889 100644 --- a/FastShiftIn.cpp +++ b/FastShiftIn.cpp @@ -1,7 +1,7 @@ // // FILE: FastShiftIn.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.4.1 +// VERSION: 0.4.2 // PURPOSE: Fast ShiftIn for 74HC165 register, AVR optimized // DATE: 2013-09-29 // URL: https://github.com/RobTillaart/FastShiftIn diff --git a/FastShiftIn.h b/FastShiftIn.h index 44c1d64..7805013 100644 --- a/FastShiftIn.h +++ b/FastShiftIn.h @@ -2,7 +2,7 @@ // // FILE: FastShiftIn.h // AUTHOR: Rob Tillaart -// VERSION: 0.4.1 +// VERSION: 0.4.2 // PURPOSE: Fast ShiftIn for 74HC165 register, AVR optimized // DATE: 2013-09-29 // URL: https://github.com/RobTillaart/FastShiftIn @@ -11,7 +11,7 @@ #include "Arduino.h" -#define FASTSHIFTIN_LIB_VERSION (F("0.4.1")) +#define FASTSHIFTIN_LIB_VERSION (F("0.4.2")) // uncomment next line to get SPEED OPTIMIZED CODE // #define FASTSHIFTIN_AVR_LOOP_UNROLLED 1 @@ -26,10 +26,8 @@ class FastShiftIn uint16_t read16(void); uint32_t read24(void); uint32_t read32(void); - uint32_t lastRead(void); - - // Experimental 0.3.4 void read(uint8_t * array, uint8_t size); + uint32_t lastRead(void); // returns false if bitOrder out of range. bool setBitOrder(uint8_t bitOrder); diff --git a/LICENSE b/LICENSE index ea1e69a..b6937e7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2013-2025 Rob Tillaart +Copyright (c) 2013-2026 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 diff --git a/README.md b/README.md index eec16e3..ab6dd32 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ The library provides wrapper functions to read multi-byte variables. These are read16(), read24(), read32() and read(array, size). The latter is used to shift in any size object. +Feedback as always is welcome. + ### 0.4.0 breaking changes @@ -95,7 +97,7 @@ bitOrder = { LSBFIRST, MSBFIRST }; - **FastShiftIn(uint8_t dataIn, uint8_t clockPin, uint8_t bitOrder = LSBFIRST)** Constructor -### Functions +### Read functions - **uint16_t read(void)** reads a new value, 8 bit. - **uint16_t read16(void)** reads a new value, 16 bit. @@ -104,7 +106,8 @@ bitOrder = { LSBFIRST, MSBFIRST }; - **uint32_t lastRead()** returns last value read. - **uint16_t readLSBFIRST(void)** optimized LSB read(), 8 bit. - **uint16_t readMSBFIRST(void)** optimized MSB read(), 8 bit. - +- **void read(uint8_t \*array, uint8_t size)** read an array of values. +The order in the array follows as BYTE order MSB / LSB. ### BitOrder @@ -113,15 +116,6 @@ Returns false for other values ==> no change. - **uint8_t getBitOrder(void)** returns LSBFIRST or MSBFIRST as set in the constructor or latest set from **setBitOrder()**. - -### Experimental - -- **void read(uint8_t \*array, uint8_t size)** read an array of values. -The order in the array follows as BYTE order MSB / LSB, that is why this function -is made experimental. This might change in the future, and fill the array -in arrival order. - - ### Byte order The functions **read16()**, **read24()** and **read32()** of this library assume @@ -160,15 +154,17 @@ pull up resistors, especially if wires are exceeding 10 cm (4"). #### Could - investigate ESP32 optimization readLSBFIRST readMSBFIRST + - see MCP_ADC issue 26 (does it work for all ESP32) - performance ESP32 - example schema -- add invert flag? - - value = value ^ 0xFF; +- add invertClock()? => more difficult for user. + - penalty performance - would it be interesting to make a fastShiftIn16() etc? - squeeze performance but more maintenance.? #### Wont +- add invertData()? => use can do value = value ^ 0xFF - investigate separate **BYTE**-order, - only MSBFirst and LSBFirst - **void setByteOrder()** + **uint8_t getByteOrder()** diff --git a/examples/fastShiftIn_test/performance_0.4.1.txt b/examples/fastShiftIn_test/performance_0.4.1.txt new file mode 100644 index 0000000..d4a1b6b --- /dev/null +++ b/examples/fastShiftIn_test/performance_0.4.1.txt @@ -0,0 +1,51 @@ +Arduino UNO R3 +IDE 1.8.19 + +fastShiftIn_test.ino +0.4.1 + + 8 bits HIGH + + +Performance - time in us : read() +FastShiftIn1: 13.96 +FastShiftIn2: 26.66 + Delta: 12.70 + + +Performance - time in us : read16() +FastShiftIn1: 26.16 +FastShiftIn2: 51.56 + Delta: 25.40 + + +Performance - time in us : read24() +FastShiftIn1: 39.88 +FastShiftIn2: 78.97 + Delta: 39.10 + + +Performance - time in us : read32() +FastShiftIn1: 52.20 +FastShiftIn2: 103.62 + Delta: 51.42 + + +Performance - time in us : readLSBFIRST() +FastShiftIn1: 12.83 +FastShiftIn2: 24.77 + Delta: 11.94 + + +Performance - time in us : readMSBFIRST() +FastShiftIn1: 12.82 +FastShiftIn2: 24.77 + Delta: 11.95 + + +Performance - time in us : reference shiftIn() +Standard shiftIn1: 108.98 +Standard shiftIn2: 217.04 + Delta: 108.06 + +done... diff --git a/library.json b/library.json index b2e0154..d5d71f7 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/FastShiftIn.git" }, - "version": "0.4.1", + "version": "0.4.2", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 9ba15dd..946d4e8 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=FastShiftIn -version=0.4.1 +version=0.4.2 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for (AVR) optimized shiftIn - e.g. for 74HC165