Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/arduino-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/arduino_test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/jsoncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion FastShiftOut.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions FastShiftOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 13 additions & 12 deletions examples/FastShiftOut_demo/FastShiftOut_demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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++)
Expand All @@ -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");
Expand All @@ -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();
Expand All @@ -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 ...");
}
Expand All @@ -102,4 +103,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
3 changes: 3 additions & 0 deletions examples/FastShiftOut_scope_test/FastShiftOut_scope_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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);
Expand Down
55 changes: 28 additions & 27 deletions examples/FastShiftOut_test/FastShiftOut_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -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();
Expand All @@ -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);
}
Expand All @@ -270,4 +271,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=FastShiftOut
version=0.4.1
version=0.4.2
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for (AVR) optimized shiftOut - e.g. 74HC595
Expand Down
Loading