Skip to content

Commit 40b1399

Browse files
authored
add changelog.md (#8)
1 parent 2de4d94 commit 40b1399

File tree

8 files changed

+131
-21
lines changed

8 files changed

+131
-21
lines changed

.arduino-ci.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
platforms:
2+
rpipico:
3+
board: rp2040:rp2040:rpipico
4+
package: rp2040:rp2040
5+
gcc:
6+
features:
7+
defines:
8+
- ARDUINO_ARCH_RP2040
9+
warnings:
10+
flags:
11+
12+
packages:
13+
rp2040:rp2040:
14+
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
15+
116
compile:
217
# Choosing to run compilation tests on 2 different Arduino platforms
318
platforms:
@@ -8,5 +23,6 @@ compile:
823
- m4
924
- esp32
1025
# - esp8266
11-
- mega2560
26+
# - mega2560
27+
- rpipico
1228

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Change Log FastShiftOut
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
9+
## [0.2.5] - 2022-11-05
10+
- add changelog.md
11+
- add rp2040 to build-CI
12+
- update readme.md
13+
14+
15+
## [0.2.4] - 2021-12-17
16+
- license
17+
18+
## [0.2.3] - 2021-05-27
19+
20+
----
21+
22+
## no history ...
23+
24+
25+
## [0.1.0] - 2013-08-22
26+
- initial version

FastShiftOut.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
//
22
// FILE: FastShiftOut.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.2.4
4+
// VERSION: 0.2.5
55
// PURPOSE: ShiftOut that implements the Print interface
66
// DATE: 2013-08-22
77
// URL: https://github.com/RobTillaart/FastShiftOut
8+
//
9+
// HISTORY: see changelog.md
810

911

1012
#include "FastShiftOut.h"
@@ -15,26 +17,26 @@ FastShiftOut::FastShiftOut(const uint8_t datapin, const uint8_t clockpin, const
1517
_bitorder = bitOrder;
1618
pinMode(datapin, OUTPUT);
1719
pinMode(clockpin, OUTPUT);
18-
// https://www.arduino.cc/reference/en/language/functions/advanced-io/shiftout/
19-
digitalWrite(clockpin, LOW); // assume rising pulses from clock
20+
// https://www.arduino.cc/reference/en/language/functions/advanced-io/shiftout/
21+
digitalWrite(clockpin, LOW); // assume rising pulses from clock
2022

2123
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR)
2224

23-
// uint8_t _datatimer = digitalPinToTimer(datapin);
24-
// if (_datatimer != NOT_ON_TIMER) turnOffPWM(_datatimer); TODO
25+
// uint8_t _datatimer = digitalPinToTimer(datapin);
26+
// if (_datatimer != NOT_ON_TIMER) turnOffPWM(_datatimer); TODO
2527
uint8_t _dataport = digitalPinToPort(datapin);
2628
_dataout = portOutputRegister(_dataport);
2729
_databit = digitalPinToBitMask(datapin);
2830

29-
// uint8_t _clocktimer = digitalPinToTimer(clockpin);
30-
// if (_clocktimer != NOT_ON_TIMER) turnOffPWM(_clocktimer);
31+
// uint8_t _clocktimer = digitalPinToTimer(clockpin);
32+
// if (_clocktimer != NOT_ON_TIMER) turnOffPWM(_clocktimer);
3133
uint8_t _clockport = digitalPinToPort(clockpin);
3234
_clockout = portOutputRegister(_clockport);
3335
_clockbit = digitalPinToBitMask(clockpin);
3436

35-
#else // reference implementation
37+
#else // reference implementation
3638

37-
// reuse these vars as pin to save some space
39+
// reuse these variables as pin to save some space
3840
_databit = datapin;
3941
_clockbit = clockpin;
4042

@@ -100,7 +102,7 @@ size_t FastShiftOut::writeMSBFIRST(const uint8_t data)
100102
n >>= 1;
101103
}
102104
return 1;
103-
#else // reference implementation // note this has no cli()
105+
#else // reference implementation // note this has no cli()
104106
shiftOut(_databit, _clockbit, MSBFIRST, data);
105107
return 1;
106108
#endif
@@ -111,7 +113,7 @@ bool FastShiftOut::setBitOrder(const uint8_t bitOrder)
111113
{
112114
if ((bitOrder == LSBFIRST) || (bitOrder == MSBFIRST))
113115
{
114-
_bitorder = bitOrder;
116+
_bitorder = bitOrder;
115117
return true;
116118
};
117119
return false;

FastShiftOut.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: FastShiftOut.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.2.4
5+
// VERSION: 0.2.5
66
// PURPOSE: shiftOut class that implements the Print interface
77
// DATE: 2013-08-22
88
// URL: https://github.com/RobTillaart/FastShiftOut
@@ -11,7 +11,7 @@
1111
#include "Arduino.h"
1212
#include "Print.h"
1313

14-
#define FASTSHIFTOUT_LIB_VERSION (F("0.2.4"))
14+
#define FASTSHIFTOUT_LIB_VERSION (F("0.2.5"))
1515

1616

1717
class FastShiftOut : public Print

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
Arduino library for (AVR) optimized shiftOut - e.g. 74HC595.
1212

13-
A library for FastShiftIn also exist - https://github.com/RobTillaart/FastShiftIn
13+
- library for FastShiftIn - https://github.com/RobTillaart/FastShiftIn
14+
- library for FastShiftInOut - https://github.com/RobTillaart/FastShiftInOut
1415

1516

1617
## Description
@@ -31,6 +32,15 @@ The performance of **write()** is substantially faster than the default Arduino
3132
Exact how big the performance gain is can be seen with the example sketch.
3233
It does a comparison and shows how the class is to be used.
3334

35+
test 0.2.4 Arduino UNO
36+
37+
| function | time (us) |
38+
|:----------------------|----------:|
39+
| write() | 21.66 |
40+
| writeLSBFIRST() | 22.94 |
41+
| writeMSBFIRST() | 20.30 |
42+
| reference shiftOut() | 89.74 |
43+
3444

3545
## Interface
3646

examples/FastShiftOut_test/FastShiftOut_test.ino

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ void setup()
2222
test1();
2323
test2();
2424
test3();
25+
test4();
26+
test5();
2527

2628
Serial.println("\ndone ...\n");
2729
}
@@ -35,7 +37,7 @@ void test1()
3537
FSO.write(0x55);
3638
}
3739
duration1 = micros() - start;
38-
Serial.print("FastShiftOut1: ");
40+
Serial.print(" write: ");
3941
Serial.println(duration1 * 0.001);
4042

4143
start = micros();
@@ -45,7 +47,7 @@ void test1()
4547
FSO.write(0x55);
4648
}
4749
duration2 = micros() - start;
48-
Serial.print("FastShiftOut2: ");
50+
Serial.print(" write: ");
4951
Serial.println(duration2 * 0.001);
5052
Serial.print(" Delta: ");
5153
Serial.println((duration2 - duration1) * 0.001);
@@ -55,6 +57,60 @@ void test1()
5557

5658

5759
void test2()
60+
{
61+
start = micros();
62+
for (int i = 0; i < 1000; i++)
63+
{
64+
FSO.writeLSBFIRST(0x55);
65+
}
66+
duration1 = micros() - start;
67+
Serial.print("writeLSBFIRST: ");
68+
Serial.println(duration1 * 0.001);
69+
70+
start = micros();
71+
for (int i = 0; i < 1000; i++)
72+
{
73+
FSO.write(0x55);
74+
FSO.write(0x55);
75+
}
76+
duration2 = micros() - start;
77+
Serial.print("writeLSBFIRST: ");
78+
Serial.println(duration2 * 0.001);
79+
Serial.print(" Delta: ");
80+
Serial.println((duration2 - duration1) * 0.001);
81+
Serial.println();
82+
delay(100);
83+
}
84+
85+
86+
void test3()
87+
{
88+
start = micros();
89+
for (int i = 0; i < 1000; i++)
90+
{
91+
FSO.write(0x55);
92+
}
93+
duration1 = micros() - start;
94+
Serial.print("writeMSBFIRST: ");
95+
Serial.println(duration1 * 0.001);
96+
97+
start = micros();
98+
for (int i = 0; i < 1000; i++)
99+
{
100+
FSO.writeMSBFIRST(0x55);
101+
FSO.writeMSBFIRST(0x55);
102+
}
103+
duration2 = micros() - start;
104+
Serial.print("writeMSBFIRST: ");
105+
Serial.println(duration2 * 0.001);
106+
Serial.print(" Delta: ");
107+
Serial.println((duration2 - duration1) * 0.001);
108+
Serial.println();
109+
delay(100);
110+
}
111+
112+
113+
void test4()
58114
{
59115
start = micros();
60116
for (int i = 0; i < 1000; i++)
@@ -81,7 +137,7 @@ void test2()
81137
}
82138

83139

84-
void test3()
140+
void test5()
85141
{
86142
Serial.println("\nTest print interface");
87143
start = micros();
@@ -120,4 +176,4 @@ void loop()
120176
}
121177

122178

123-
// -- END OF FILE --
179+
// -- END OF FILE --

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/FastShiftOut.git"
1717
},
18-
"version": "0.2.4",
18+
"version": "0.2.5",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=FastShiftOut
2-
version=0.2.4
2+
version=0.2.5
33
author=Rob Tillaart <rob.tillaart@gmail.com>
44
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
55
sentence=Arduino library for (AVR) optimized shiftOut - e.g. 74HC595

0 commit comments

Comments
 (0)