Skip to content

Commit

Permalink
Merge branch 'jandelgado:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Astymeus authored Dec 22, 2024
2 parents 977244a + f6ccd9d commit 149a092
Show file tree
Hide file tree
Showing 35 changed files with 25,094 additions and 18,535 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: install python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: linter
run: |
pip install cpplint
pip install cpplint==2.0.0
make lint
test:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: install python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: install tools
run: |
pip install platformio==5.1.1
pip install platformio==6.1.10
sudo apt-get update && sudo apt-get install -y lcov
- name: run tests
Expand All @@ -47,10 +47,10 @@ jobs:
make clean coverage OPT=-O0
- name: Upload coverage to coveralls
uses: coverallsapp/github-action@v1.1.2
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: test/coverage.info
file: test/coverage.lcov

- name: build examples
run: make ci
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.envrc
.venv/
.pio/
**/.vscode
test/bin
Expand All @@ -13,6 +15,7 @@ test/bin
*.gcov
*.gcno
*.gcda
*.lcov
test/coverage.info
test/report
**/tags
Expand Down
66 changes: 59 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,64 @@
# JLed changelog (github.com/jandelgado/jled)

## [2024-12-01] 4.15.0

* new: `Update()` methods now optionally return the last brightness value
calculated and written out to the LED. See `examples/last_brightness`

## [2024-09-21] 4.14

* new: make `JLed::Update(unit32_t t)` public, allowing optimizations and
simplified tests

## [2023-09-10] 4.13.1

* fix: `Update()` sometimes returning wrong state (https://github.com/jandelgado/jled/issues/122)

## [2023-08-20] 4.13.0

* new: `Stop()` takes optional parameter allowing to turn LED fully off

## [2023-06-29] 4.12.2

* fix: `JLedSequence` starting again after call to `Stop` (https://github.com/jandelgado/jled/issues/115)

## [2023-01-11] 4.12.1

* fix: add missing keywords to keywords.txt

## [2022-11-13] 4.12.0

* new: add `MinBrightness` method and scale output to interval defined by
`MinBrightness` and `MaxBrightness`.

## [2022-11-13] 4.11.1

* improve: reduce memory consumption of JLed objects by 3 bytes, simplify
state management.

## [2022-03-29] 4.11.0

* change: `JLedSequence` objects are now assignable, making switching
effects easier. See https://github.com/jandelgado/jled-example-switch-sequence for an example.

## [2022-03-24] 4.10.0

* new: `On`, `Off` and `Set` now take an optional `duration` value, making
these effects behave like any other in this regard. This allows to add
an `On` effect to a `JLedSequence` for a specific amount of time.

## [2022-02-24] 4.9.1

* fix: make sure JLedSequence methods like `Repeat` and `Forever` are chainable
like in the `JLed` class

## [2022-02-13] 4.9.0

* new: support ESP-IDF platform for the ESP32 (#87, thanks to @troky for the
initial work). See also repositories
https://github.com/jandelgado/jled-esp-idf-example and
https://github.com/jandelgado/jled-esp-idf-platformio-example

## [2021-10-18] 4.8.0

* new: make `Breathe` method more flexible (#78, thanks to @boraozgen)
Expand Down Expand Up @@ -54,12 +106,12 @@

## [2019-08-30] 4.2.1

* fix: make sure memory alignment is correct (caused hard fault on
* fix: make sure memory alignment is correct (caused hard fault on
SAMD21). Fixes #27.

## [2019-06-20] 4.2.0

* changing an effect resets the Jled object so it starts over with the
* changing an effect resets the Jled object so it starts over with the
new effect (see #25). Prior to this change, calling `Reset()` was
necessary.

Expand Down Expand Up @@ -109,10 +161,10 @@ In addition to the changes introduced with `v4.0.0-rc0` and `v4.0.0-rc1`, the

### Added

* `JLed::Reset()` - resets the led to it's initial state allowing to
* `JLed::Reset()` - resets the led to it's initial state allowing to
to start over
* `JLed::IsRunning()` - return true if effect is active, else false
* new class `JLedSequence` to update JLed objects simultanously or
* new class `JLedSequence` to update JLed objects simultanously or
sequentially. See [README](README.md#controlling-a-group-of-leds) for details.
* added new [morse example](examples/morse)
* clean separation between hardware specific and common code, making
Expand All @@ -125,7 +177,7 @@ In addition to the changes introduced with `v4.0.0-rc0` and `v4.0.0-rc1`, the
BrightnessEvaluator. Migration of code should be straight forward, see
below

#### old brightness function
#### old brightness function

In JLed version prio to version 4.0.0, a function pointer was used to specify
a user provided brightness function.
Expand Down Expand Up @@ -177,7 +229,7 @@ JLed led = JLed(LED_BUILTIN).UserFunc(&userEffect);
## [2018-09-22] v2.3.0

* ESP8266 platform: scaling from 8 to 10 bit improved. The scaling makes sure
that 0 is mapped to 0 and 255 is mapped to 1023, preserving min/max
that 0 is mapped to 0 and 255 is mapped to 1023, preserving min/max
relationships in both ranges.

## [2018-06-09] v2.2.3
Expand Down
27 changes: 15 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# use this makefile to build with platformio
#
.PHONY: all clean upload monitor lint test ci
.PHONY: phony

# some of the examples use LED_BUILTIN which is not defined for ESP32
CIOPTS=--board=uno --board=esp01 --board=nano33ble --lib="src"
CIOPTS_MBED=--board=nucleo_f401re -Oframework=mbed --lib="src"
CIOPTSALL=--board=esp32dev --board=uno --board=nano33ble --board=esp01 --lib="src"

all:
all: phony
pio run

lint:
cpplint --extensions=cpp,h,ino $(shell find . -maxdepth 3 \( ! -regex '.*/\..*' \) \
lint: phony
cpplint --filter -readability/check \
--exclude test/catch2 \
--extensions=cpp,h,ino $(shell find . -maxdepth 3 \( ! -regex '.*/\..*' \) \
-type f -a \( -name "*\.cpp" -o -name "*\.h" -o -name "*\.ino" \) )

ci:
ci: phony
pio ci $(CIOPTS) examples/custom_hal/custom_hal.ino
pio ci $(CIOPTS_MBED) examples/multiled_mbed/multiled_mbed.cpp
pio ci $(CIOPTS) --lib="examples/morse" examples/morse/morse.ino
Expand All @@ -27,21 +29,22 @@ ci:
pio ci $(CIOPTSALL) examples/fade_on/fade_on.ino
pio ci $(CIOPTSALL) examples/sequence/sequence.ino

envdump:
envdump: phony
-pio run --target envdump

clean:
clean: phony
-pio run --target clean
rm -f {test,src}/{*.o,*.gcno,*.gcda}
cd test && make clean
rm -f src/{*.o,*.gcno,*.gcda}

upload:
upload: phony
pio run --target upload

monitor:
monitor: phony
pio device monitor

test:
test: phony
$(MAKE) -C test coverage OPT=-O0

tags:
tags: phony
ctags -R
Loading

0 comments on commit 149a092

Please sign in to comment.