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.1] - 2025-10-12
- update GitHub actions
- update examples
- minor edits

## [0.4.0] - 2024-09-10
- fix #17, loop unroll option, improving performance, kudos to nt314p
- added flag to select LOOP UNROLL (is optional as it gives larger code size)
Expand Down
2 changes: 1 addition & 1 deletion FastShiftIn.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: FastShiftIn.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.4.0
// VERSION: 0.4.1
// PURPOSE: Fast ShiftIn for 74HC165 register, AVR optimized
// DATE: 2013-09-29
// URL: https://github.com/RobTillaart/FastShiftIn
Expand Down
4 changes: 2 additions & 2 deletions FastShiftIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: FastShiftIn.h
// AUTHOR: Rob Tillaart
// VERSION: 0.4.0
// VERSION: 0.4.1
// PURPOSE: Fast ShiftIn for 74HC165 register, AVR optimized
// DATE: 2013-09-29
// URL: https://github.com/RobTillaart/FastShiftIn
Expand All @@ -11,7 +11,7 @@
#include "Arduino.h"


#define FASTSHIFTIN_LIB_VERSION (F("0.4.0"))
#define FASTSHIFTIN_LIB_VERSION (F("0.4.1"))

// uncomment next line to get SPEED OPTIMIZED CODE
// #define FASTSHIFTIN_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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ pull up resistors, especially if wires are exceeding 10 cm (4").
- performance ESP32
- example schema
- add invert flag?
- value = value ^ 0xFF;
- would it be interesting to make a fastShiftIn16() etc?
- squeeze performance but more maintenance.?

Expand Down
21 changes: 12 additions & 9 deletions examples/fastShiftIn/fastShiftIn.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ volatile int x = 0;
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
Serial.println();
Serial.println(__FILE__);
Serial.println("FASTSHIFTIN_LIB_VERSION: ");
Serial.println(FASTSHIFTIN_LIB_VERSION);
Serial.println();

digitalWrite(12, HIGH);
Serial.println("\n 8 bits HIGH\n");
Serial.println("\n 8 bits HIGH\n");

Serial.println("\nPerformance - time in us");
Serial.println("\nPerformance - time in us");
uint32_t start = micros();
for (int i = 0; i < 1000; i++)
{
Expand All @@ -39,9 +42,9 @@ void setup()
}
uint32_t duration2 = micros() - start;
Serial.print("FastShiftIn2: ");
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();


Expand All @@ -52,7 +55,7 @@ void setup()
}
duration1 = micros() - start;
Serial.print("Standard shiftIn1: ");
Serial.println(duration1* 0.001);
Serial.println(duration1* 0.001f);

start = micros();
for (int i = 0; i < 1000; i++)
Expand All @@ -62,9 +65,9 @@ void setup()
}
duration2 = micros() - start;
Serial.print("Standard shiftIn2: ");
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("done...");
Expand All @@ -76,5 +79,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

17 changes: 10 additions & 7 deletions examples/fastShiftIn_readLSBFIRST/fastShiftIn_readLSBFIRST.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ volatile int x = 0;
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println(__FILE__);
Serial.println("FASTSHIFTIN_LIB_VERSION: ");
Serial.println(FASTSHIFTIN_LIB_VERSION);
Serial.println();

digitalWrite(12, HIGH);
Serial.println("\n 8 bits HIGH - readLSBFIRST\n");
Expand All @@ -29,7 +32,7 @@ void setup()
}
uint32_t duration1 = micros() - start;
Serial.print("FastShiftIn1: ");
Serial.println(duration1 * 0.001);
Serial.println(duration1 * 0.001f);

start = micros();
for (int i = 0; i < 1000; i++)
Expand All @@ -39,9 +42,9 @@ void setup()
}
uint32_t duration2 = micros() - start;
Serial.print("FastShiftIn2: ");
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();


Expand All @@ -52,7 +55,7 @@ void setup()
}
duration1 = micros() - start;
Serial.print("Standard shiftIn1: ");
Serial.println(duration1 * 0.001);
Serial.println(duration1 * 0.001f);

start = micros();
for (int i = 0; i < 1000; i++)
Expand All @@ -62,9 +65,9 @@ void setup()
}
duration2 = micros() - start;
Serial.print("Standard shiftIn2: ");
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("done...");
Expand All @@ -76,4 +79,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
19 changes: 11 additions & 8 deletions examples/fastShiftIn_readMSBFIRST/fastShiftIn_readMSBFIRST.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ volatile int x = 0;
void setup()
{
Serial.begin(115200);
Serial.print("example fastShiftIn: ");
Serial.println();
Serial.println(__FILE__);
Serial.println("FASTSHIFTIN_LIB_VERSION: ");
Serial.println(FASTSHIFTIN_LIB_VERSION);
Serial.println();

digitalWrite(12, HIGH);
Serial.println("\n 8 bits HIGH\n");
Expand All @@ -29,7 +32,7 @@ void setup()
}
uint32_t duration1 = micros() - start;
Serial.print("FastShiftIn1: ");
Serial.println(duration1 * 0.001);
Serial.println(duration1 * 0.001f);

start = micros();
for (int i = 0; i < 1000; i++)
Expand All @@ -39,9 +42,9 @@ void setup()
}
uint32_t duration2 = micros() - start;
Serial.print("FastShiftIn2: ");
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();


Expand All @@ -52,7 +55,7 @@ void setup()
}
duration1 = micros() - start;
Serial.print("Standard shiftIn1: ");
Serial.println(duration1 * 0.001);
Serial.println(duration1 * 0.001f);

start = micros();
for (int i = 0; i < 1000; i++)
Expand All @@ -62,9 +65,9 @@ void setup()
}
duration2 = micros() - start;
Serial.print("Standard shiftIn2: ");
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("done...");
Expand All @@ -76,5 +79,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

Loading