Skip to content

Commit ae5b9ab

Browse files
author
James Foster
authored
Merge branch 'master' into watch-dog-timer
2 parents ef70223 + ffe8a12 commit ae5b9ab

File tree

14 files changed

+111
-20
lines changed

14 files changed

+111
-20
lines changed

.gitattributes

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
1+
# https://docs.github.com/en/github/using-git/configuring-git-to-handle-line-endings
2+
# https://git-scm.com/docs/gitattributes
3+
# https://git-scm.com/docs/git-config
4+
# https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
5+
6+
# Configure this repository to use Git's type detection algorithm to guess
7+
# whether a file is text or binary. Text files will have line endings converted
8+
# as if you had set
9+
# eol=native
10+
# That is, on Windows text files will have CRLF line endings in your working
11+
# directory while on Linux and macOS your text files will have LF line endings
12+
# in your working directory. In either case, they will have LF line endings in
13+
# the Git repository itself.
14+
115
# Set the default behavior, in case people don't have core.autocrlf set.
2-
* text eol=lf
16+
* text=auto
17+
18+
# Explicitly declare text files you want to always be normalized and converted
19+
# to native line endings on checkout. Git would likely get these right, but
20+
# we can be sure by adding them here.
21+
*.ino text diff=cpp
22+
*.c text diff=c
23+
*.cc text diff=cpp
24+
*.cxx text diff=cpp
25+
*.cpp text diff=cpp
26+
*.c++ text diff=cpp
27+
*.hpp text diff=cpp
28+
*.h text diff=c
29+
*.h++ text diff=cpp
30+
*.hh text diff=cpp
31+
32+
*.md text
33+
*.yaml text
34+
*.yml text
35+
36+
37+
# Denote all files that are truly binary and should not be modified.
38+
# Even if we don't have any of these, they make a good example.
39+
*.png binary
40+
*.jpg binary

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ In this project, we define a workflow for each target platform. **If you're loo
77

88
The reason that all platforms are tested in _this_ project is to ensure that, as a framework, `arduino_ci` will run properly on any developer's personal workstation (regardless of OS).
99

10-
For testing an individual Arduino library in the context of GitHub, [Linux is the cheapest option](https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions) and produces results identical to the other OSes.
10+
For testing an individual Arduino library in the context of GitHub, [Linux is the cheapest option](https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions) and should produce results identical to the other OSes.

.github/workflows/linux.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is the name of the workflow, visible on GitHub UI
22
name: linux
33

4-
on: [pull_request]
4+
on: [push, pull_request]
55

66
jobs:
77
"unittest_lint_sampleproject":

.github/workflows/macos.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is the name of the workflow, visible on GitHub UI
22
name: macos
33

4-
on: [pull_request]
4+
on: [push, pull_request]
55

66
jobs:
77
"unittest_lint_sampleproject":

.github/workflows/windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is the name of the workflow, visible on GitHub UI
22
name: windows
33

4-
on: [pull_request]
4+
on: [push, pull_request]
55

66
jobs:
77
"unittest_lint_sampleproject":

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
## [Unreleased]
99
### Added
1010
- Allow use of watchdog timer in application code (though it doesn't do anything)
11+
- Show output from successful compile
12+
- `--min-free-space=N` command-line argument to fail if free space is below requred value
13+
- Add `_BV()` macro.
1114

1215
### Changed
16+
- Fix copy/paste error to allow additional warnings for a platform
17+
- Properly report compile errors in GitHub Actions (#296)
18+
- Put build artifacts in a separate directory to reduce clutter.
19+
- Replace `#define yield() _NOP()` with `inline void yield() { _NOP(); }` so that other code can define a `yield()` function.
20+
- Update .gitattributes so we have consistent line endings
1321
- Change 266 files from CRLF to LF.
22+
- Run tests on push as well as on a pull request so developers can see impact
1423

1524
### Deprecated
1625

@@ -28,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2837

2938
### Changed
3039
- Topmost installtion instructions now suggest `gem install arduino_ci` instead of using a `Gemfile`. Reasons for using a `Gemfile` are listed and discussed separately further down the README.
40+
- Stream::readStreamUntil() no longer returns delimiter
3141

3242
### Removed
3343
- scanning of `library.properties`; this can and should now be performed by the standalone [`arduino-lint` tool](https://arduino.github.io/arduino-lint).

SampleProjects/TestSomething/.arduino-ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
platforms:
2+
uno:
3+
board: arduino:avr:uno
4+
package: arduino:avr
5+
gcc:
6+
features:
7+
defines:
8+
- __AVR__
9+
- __AVR_ATmega328P__
10+
- ARDUINO_ARCH_AVR
11+
- ARDUINO_AVR_UNO
12+
warnings:
13+
- no-unknown-attributes
14+
flags:
15+
116
unittest:
217
platforms:
318
- uno

SampleProjects/TestSomething/test/stream.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,16 @@ unittest(stream_parse)
6969

7070
}
7171

72+
unittest(readStringUntil) {
73+
String data = "";
74+
unsigned long micros = 100;
75+
data = "abc:def";
76+
77+
Stream s;
78+
s.mGodmodeDataIn = &data;
79+
s.mGodmodeMicrosDelay = &micros;
80+
// result should not include delimiter
81+
assertEqual("abc", s.readStringUntil(':'));
82+
assertEqual("def", s.readStringUntil(':'));
83+
}
7284
unittest_main()

cpp/arduino/Arduino.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ typedef uint8_t byte;
3636
#define highByte(w) ((uint8_t) ((w) >> 8))
3737
#define lowByte(w) ((uint8_t) ((w) & 0xff))
3838

39-
// might as well use that NO-op macro for these, while unit testing
40-
// you need interrupts? interrupt yourself
41-
#define yield() _NOP()
42-
#define interrupts() _NOP()
43-
#define noInterrupts() _NOP()
39+
// using #define for these makes it impossible for other code to use as function
40+
// names!
41+
inline void yield() { _NOP(); }
42+
inline void interrupts() { _NOP(); }
43+
inline void noInterrupts() { _NOP(); }
4444

4545
// TODO: correctly establish this per-board!
4646
#define F_CPU 1000000UL
@@ -50,10 +50,7 @@ typedef uint8_t byte;
5050

5151
typedef unsigned int word;
5252

53-
#define bit(b) (1UL << (b))
54-
55-
56-
53+
#define _BV(bit) (1 << (bit))
5754

5855
// Get the bit location within the hardware port of the given virtual pin.
5956
// This comes from the pins_*.c file for the active board configuration.

cpp/arduino/Stream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class Stream : public Print
186186
ret = String(*mGodmodeDataIn);
187187
mGodmodeDataIn->clear();
188188
} else {
189-
ret = mGodmodeDataIn->substring(0, idxTrm + 1);
189+
ret = mGodmodeDataIn->substring(0, idxTrm);
190190
fastforward(idxTrm + 1);
191191
}
192192
return ret;

0 commit comments

Comments
 (0)