diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml index 7f8f4ef..0ad60f4 100644 --- a/.github/workflows/arduino-lint.yml +++ b/.github/workflows/arduino-lint.yml @@ -6,8 +6,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 - - uses: arduino/arduino-lint-action@v1 + - uses: actions/checkout@v5 + - uses: arduino/arduino-lint-action@v2 with: library-manager: update compliance: strict \ No newline at end of file diff --git a/.github/workflows/arduino_test_runner.yml b/.github/workflows/arduino_test_runner.yml index dbd0ce7..1897982 100644 --- a/.github/workflows/arduino_test_runner.yml +++ b/.github/workflows/arduino_test_runner.yml @@ -8,7 +8,7 @@ jobs: timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 diff --git a/.github/workflows/jsoncheck.yml b/.github/workflows/jsoncheck.yml index 1cbb5e2..8804e69 100644 --- a/.github/workflows/jsoncheck.yml +++ b/.github/workflows/jsoncheck.yml @@ -5,13 +5,15 @@ on: paths: - '**.json' pull_request: + paths: + - '**.json' jobs: test: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: json-syntax-check uses: limitusus/json-syntax-check@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a588e..1111c2b 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] - 2025-10-12 +- update GitHub actions +- update examples +- minor edits + ## [0.4.1] - 2024-10-31 - fix #17, add more optimizations, kudos to nt314p diff --git a/FastShiftOut.cpp b/FastShiftOut.cpp index c97cc33..f4bfe66 100644 --- a/FastShiftOut.cpp +++ b/FastShiftOut.cpp @@ -1,7 +1,7 @@ // // FILE: FastShiftOut.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.4.1 +// VERSION: 0.4.2 // PURPOSE: ShiftOut that implements the Print interface // DATE: 2013-08-22 // URL: https://github.com/RobTillaart/FastShiftOut diff --git a/FastShiftOut.h b/FastShiftOut.h index 5d2e3b8..6586942 100644 --- a/FastShiftOut.h +++ b/FastShiftOut.h @@ -2,7 +2,7 @@ // // FILE: FastShiftOut.h // AUTHOR: Rob Tillaart -// VERSION: 0.4.1 +// VERSION: 0.4.2 // PURPOSE: shiftOut class that implements the Print interface // DATE: 2013-08-22 // URL: https://github.com/RobTillaart/FastShiftOut @@ -11,7 +11,7 @@ #include "Arduino.h" #include "Print.h" -#define FASTSHIFTOUT_LIB_VERSION (F("0.4.1")) +#define FASTSHIFTOUT_LIB_VERSION (F("0.4.2")) // uncomment next line to get SPEED OPTIMIZED CODE // #define FASTSHIFTOUT_AVR_LOOP_UNROLLED 1 diff --git a/LICENSE b/LICENSE index 9a9ac5a..ea1e69a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2013-2024 Rob Tillaart +Copyright (c) 2013-2025 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/examples/FastShiftOut_demo/FastShiftOut_demo.ino b/examples/FastShiftOut_demo/FastShiftOut_demo.ino index f08c5e2..7af269a 100644 --- a/examples/FastShiftOut_demo/FastShiftOut_demo.ino +++ b/examples/FastShiftOut_demo/FastShiftOut_demo.ino @@ -13,10 +13,11 @@ FastShiftOut FSO(12, 13, LSBFIRST); void setup() { Serial.begin(115200); - Serial.print(__FILE__); - + Serial.println(); + Serial.println(__FILE__); Serial.print("FASTSHIFTOUT_LIB_VERSION: "); Serial.println(FASTSHIFTOUT_LIB_VERSION); + Serial.println(); Serial.println("\nPerformance - time in us"); uint32_t start = micros(); @@ -36,9 +37,9 @@ void setup() } uint32_t duration2 = micros() - start; Serial.print("FastShiftOut2: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); start = micros(); @@ -48,7 +49,7 @@ void setup() } duration1 = micros() - start; Serial.print("Standard shiftOut1: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); start = micros(); for (int i = 0; i < 1000; i++) @@ -58,9 +59,9 @@ void setup() } duration2 = micros() - start; Serial.print("Standard shiftOut2: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); Serial.println("\nTest print interface"); @@ -71,7 +72,7 @@ void setup() } duration1 = micros() - start; Serial.print("println(\"Hello world\"): \t"); - Serial.println(duration1 * 0.01); + Serial.println(duration1 * 0.01f); start = micros(); @@ -81,17 +82,17 @@ void setup() } duration1 = micros() - start; Serial.print("println(1357): \t\t\t"); - Serial.println(duration1 * 0.01); + Serial.println(duration1 * 0.01f); start = micros(); for (int i = 0; i < 100; i++) { - FSO.println(3.14159265, 4); + FSO.println(3.14159265f, 4); } duration1 = micros() - start; Serial.print("println(3.14159265, 4): \t"); - Serial.println(duration1 * 0.01); + Serial.println(duration1 * 0.01f); Serial.println("\ndone ..."); } @@ -102,4 +103,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/FastShiftOut_scope_test/FastShiftOut_scope_test.ino b/examples/FastShiftOut_scope_test/FastShiftOut_scope_test.ino index 511524a..fbdb785 100644 --- a/examples/FastShiftOut_scope_test/FastShiftOut_scope_test.ino +++ b/examples/FastShiftOut_scope_test/FastShiftOut_scope_test.ino @@ -3,6 +3,8 @@ // AUTHOR: Rob Tillaart // PURPOSE: test sketch for scope // URL: https://github.com/RobTillaart/FastShiftOut +// +// Connect scope to pins mentioned in constructor (12, 13) #include "FastShiftOut.h" @@ -14,6 +16,7 @@ uint32_t start, duration1, duration2; void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); Serial.print("FASTSHIFTOUT_LIB_VERSION: "); Serial.println(FASTSHIFTOUT_LIB_VERSION); diff --git a/examples/FastShiftOut_test/FastShiftOut_test.ino b/examples/FastShiftOut_test/FastShiftOut_test.ino index 1b50807..9c6e512 100644 --- a/examples/FastShiftOut_test/FastShiftOut_test.ino +++ b/examples/FastShiftOut_test/FastShiftOut_test.ino @@ -14,10 +14,11 @@ uint32_t start, duration1, duration2; void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); - Serial.print("FASTSHIFTOUT_LIB_VERSION: "); Serial.println(FASTSHIFTOUT_LIB_VERSION); + Serial.println(); Serial.println("\nPerformance - time in us"); test1(); @@ -42,7 +43,7 @@ void test1() } duration1 = micros() - start; Serial.print(" write: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); delay(100); start = micros(); @@ -53,9 +54,9 @@ void test1() } duration2 = micros() - start; Serial.print(" write: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); delay(100); } @@ -70,7 +71,7 @@ void test2() } duration1 = micros() - start; Serial.print("writeLSBFIRST: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); delay(100); start = micros(); @@ -81,9 +82,9 @@ void test2() } duration2 = micros() - start; Serial.print("writeLSBFIRST: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); delay(100); } @@ -98,7 +99,7 @@ void test3() } duration1 = micros() - start; Serial.print("writeMSBFIRST: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); delay(100); start = micros(); @@ -109,9 +110,9 @@ void test3() } duration2 = micros() - start; Serial.print("writeMSBFIRST: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); delay(100); } @@ -126,7 +127,7 @@ void test4() } duration1 = micros() - start; Serial.print("Standard shiftOut1: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); delay(100); start = micros(); @@ -137,9 +138,9 @@ void test4() } duration2 = micros() - start; Serial.print("Standard shiftOut2: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); delay(100); } @@ -154,7 +155,7 @@ void test5() } duration1 = micros() - start; Serial.print(" write16: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); delay(100); start = micros(); @@ -165,9 +166,9 @@ void test5() } duration2 = micros() - start; Serial.print(" write16: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); delay(100); } @@ -182,7 +183,7 @@ void test6() } duration1 = micros() - start; Serial.print(" write24: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); delay(100); start = micros(); @@ -193,9 +194,9 @@ void test6() } duration2 = micros() - start; Serial.print(" write24: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); delay(100); } @@ -210,7 +211,7 @@ void test7() } duration1 = micros() - start; Serial.print(" write32: "); - Serial.println(duration1 * 0.001); + Serial.println(duration1 * 0.001f); delay(100); start = micros(); @@ -221,9 +222,9 @@ void test7() } duration2 = micros() - start; Serial.print(" write32: "); - Serial.println(duration2 * 0.001); + Serial.println(duration2 * 0.001f); Serial.print(" Delta: "); - Serial.println((duration2 - duration1) * 0.001); + Serial.println((duration2 - duration1) * 0.001f); Serial.println(); delay(100); } @@ -239,7 +240,7 @@ void test8() } duration1 = micros() - start; Serial.print("println(\"Hello world\"): \t"); - Serial.println(duration1 * 0.01); + Serial.println(duration1 * 0.01f); delay(100); start = micros(); @@ -249,17 +250,17 @@ void test8() } duration1 = micros() - start; Serial.print("println(1357): \t\t\t"); - Serial.println(duration1 * 0.01); + Serial.println(duration1 * 0.01f); delay(100); start = micros(); for (int i = 0; i < 100; i++) { - FSO.println(3.14159265, 4); + FSO.println(3.14159265f, 4); } duration1 = micros() - start; Serial.print("println(3.14159265, 4): \t"); - Serial.println(duration1 * 0.01); + Serial.println(duration1 * 0.01f); Serial.println(); delay(100); } @@ -270,4 +271,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/library.json b/library.json index 5b31cf3..bbb42eb 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/FastShiftOut.git" }, - "version": "0.4.1", + "version": "0.4.2", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 4274849..aecb6eb 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=FastShiftOut -version=0.4.1 +version=0.4.2 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for (AVR) optimized shiftOut - e.g. 74HC595 diff --git a/test/unit_test_001.cpp b/test/unit_test_001.cpp index 09214ed..6b79c82 100644 --- a/test/unit_test_001.cpp +++ b/test/unit_test_001.cpp @@ -67,7 +67,7 @@ unittest(test_constructor_MSB) FastShiftOut FSO(12, 13, MSBFIRST); assertEqual(MSBFIRST, FSO.getBitOrder()); - + FSO.setBitOrder(LSBFIRST); assertEqual(LSBFIRST, FSO.getBitOrder()); }