Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CRC and SAMD51 #144

Merged
merged 83 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
a49cc13
[Issue #65] CRC implementation.
peterj43 May 29, 2020
96feec0
Correct missing #, Also add CRC calculate function and correct one of
peterj43 Jul 12, 2021
f543a69
[Issue #79] ESP32- Core panic when using in conjunction with the
peterj43 Jul 13, 2021
02d84cd
Update with suggestions from the pull request
peterj43 Jul 14, 2021
19449f1
Correct missing #, Also add CRC calculate function and correct one of
peterj43 Jul 12, 2021
793ed69
[Issue #79] ESP32- Core panic when using in conjunction with the
peterj43 Jul 13, 2021
14c5182
Update with suggestions from the pull request
peterj43 Jul 14, 2021
e4b4506
Merge branch 'Add-ESP32-Support' of
peterj43 Jul 16, 2021
014d58f
Change depricated symbol ICACHE_RAM_ATTR that had been used for the
peterj43 Jul 19, 2021
7abc730
Merge pull request #82 from peterj43/Add-ESP32-Support
SRGDamia1 Sep 21, 2023
ee41b8b
Clang format
SRGDamia1 Sep 21, 2023
9389a7b
Refactor addCRCResponse into part of sendResponse
SRGDamia1 Sep 22, 2023
f525628
Function to verify CRC, #75
SRGDamia1 Sep 22, 2023
b5d9da5
Fix type warnings, slave for ESP8266
SRGDamia1 Sep 22, 2023
667a3c3
Fix interface example for ESP8266
SRGDamia1 Sep 22, 2023
af498b4
Trim string in verify CRC
SRGDamia1 Sep 22, 2023
9b72786
Add example for CRC check
SRGDamia1 Sep 22, 2023
d20cd75
Add new example to checks
SRGDamia1 Sep 22, 2023
4172915
replace defines in examples
SRGDamia1 Apr 1, 2024
aaeb9f5
BREAKING CHANGE: Change output of CRC verify
SRGDamia1 Apr 1, 2024
b235253
Fix some stray slashes
SRGDamia1 Apr 1, 2024
561dd43
Allow power pin to be 0 in examples
SRGDamia1 Apr 1, 2024
83f6ac9
Remove year in examples
SRGDamia1 Apr 1, 2024
c3ddfe8
Switch to reusable workflows
SRGDamia1 Jun 25, 2024
2a7d936
First round of updates for newer doxygen
SRGDamia1 Jun 25, 2024
e656c3d
Rename wake delay
SRGDamia1 Jun 25, 2024
8e1a308
Fix licence/copyright doxy tags
SRGDamia1 Jun 25, 2024
2811746
Update test programs
SRGDamia1 Jun 25, 2024
43f157b
Markdown updates
SRGDamia1 Jul 29, 2024
2b87e6d
CRC docs
SRGDamia1 Jul 29, 2024
907ead3
Update gitignore
SRGDamia1 Jul 29, 2024
98d150e
Add docs on clocks
SRGDamia1 Jul 30, 2024
7a0abd8
Re-write and condense timers
SRGDamia1 Jul 30, 2024
ff16d40
Fix 15624 to 15625, some typos
SRGDamia1 Jul 30, 2024
e35412f
doc changes
SRGDamia1 Aug 1, 2024
4160c9e
SAMD Prescaler changes, read fix
SRGDamia1 Aug 1, 2024
c59aac4
condense avr prescaler settings
SRGDamia1 Aug 1, 2024
9ca6687
Update gitignore
SRGDamia1 Aug 1, 2024
f128f88
Fix timer 1
SRGDamia1 Aug 2, 2024
31358ee
Update testing programs
SRGDamia1 Aug 2, 2024
468f1c8
Fix types in test
SRGDamia1 Aug 2, 2024
79058b6
Fix types of bitTimes
SRGDamia1 Aug 2, 2024
f5f5748
Restore some internal docs
SRGDamia1 Aug 2, 2024
9ce0561
Doc changes
SRGDamia1 Aug 2, 2024
c73c93a
Move remaining defines to boards.h
SRGDamia1 Aug 6, 2024
6330308
Adjust SAMD fudge and add yield function
SRGDamia1 Aug 6, 2024
eb12169
Fix doc typo
SRGDamia1 Aug 6, 2024
d284004
Add a tool to print all characters as 7E1
SRGDamia1 Aug 6, 2024
d3b9d19
Add parity check
SRGDamia1 Aug 6, 2024
b94f973
Fix parity check
SRGDamia1 Aug 6, 2024
7869ccc
rename tools to extras
SRGDamia1 Aug 6, 2024
f9c7a80
remove errant trailing comma
SRGDamia1 Aug 6, 2024
28bce89
Remove lingering stop bit interrupt defines
SRGDamia1 Aug 6, 2024
3715643
Update doxygen config
SRGDamia1 Aug 6, 2024
d189536
Move datasheet quotes from .h to markdown
SRGDamia1 Aug 6, 2024
79235b2
Rename ESPFAMILY_USE_INSTRUCTION_RAM
SRGDamia1 Aug 6, 2024
800f9bb
Remove bad /
SRGDamia1 Aug 6, 2024
9502bdf
Update doxyfile to 1.12
SRGDamia1 Aug 8, 2024
b8812be
Add example dependency file
SRGDamia1 Aug 8, 2024
1089063
Separated job for external interrupts
SRGDamia1 Aug 8, 2024
9393782
Fix unused var in example f
SRGDamia1 Aug 9, 2024
d6e6489
Updates to documentation
SRGDamia1 Aug 9, 2024
d50b5b9
Tweek address change script
SRGDamia1 Aug 9, 2024
1d9a643
Add src for extra example, update changelog
SRGDamia1 Aug 12, 2024
448b1e5
Doc renames
SRGDamia1 Aug 12, 2024
5944b3b
Build fewer boards
SRGDamia1 Aug 12, 2024
a4d5ed1
Tool changes
SRGDamia1 Aug 12, 2024
65b067a
Fiddle with baud
SRGDamia1 Aug 12, 2024
034aeee
Fix TCNT sizes
SRGDamia1 Aug 12, 2024
a71ae13
fix strnlen
SRGDamia1 Aug 12, 2024
a2eaa8b
Fix esp platform names
SRGDamia1 Aug 12, 2024
52b185b
Fix concurrent example
SRGDamia1 Aug 12, 2024
7f184fb
use c++ rather than c-style casts
SRGDamia1 Aug 13, 2024
683f2ee
Expand changelog
SRGDamia1 Aug 13, 2024
b59e48a
Markdown codeblock changes
SRGDamia1 Aug 13, 2024
75f81be
Fix external int builder
SRGDamia1 Aug 13, 2024
b3d51d5
Don't use extints on samd51
SRGDamia1 Aug 13, 2024
feea274
Empty commit after fixing conflicts
SRGDamia1 Aug 13, 2024
e8528d8
Merge pull request #143 from EnviroDIY/samd51
SRGDamia1 Aug 13, 2024
6b136ee
Merge branch 'master' into CRC
SRGDamia1 Aug 14, 2024
d9b2de5
Update changelog
SRGDamia1 Aug 14, 2024
97fbf5d
Fix slave implementation example
SRGDamia1 Aug 14, 2024
307de77
Reorder AVR interrupt attachment defines (no functional change)
SRGDamia1 Aug 14, 2024
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
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary

*.pdf binary
*.pdf export-ignore

# used to exclude files from archiving/compression

Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
interval: 'weekly'
labels:
- 'CI/CD'
commit-message:
Expand Down
138 changes: 33 additions & 105 deletions .github/workflows/build_documentation.yaml
Original file line number Diff line number Diff line change
@@ -1,111 +1,39 @@
name: Build and Publish Documentation
name: Check, Build, and Publish Documentation

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
# Triggers the workflow on push or pull request events
push:
branches:
- master
# Also trigger on page_build, as well as release created events
page_build:
pull_request:
# Trigger when a release is created
# NOTE: This will only trigger if the release is created from the UI or with a personal access token
release:
types: # This configuration does not affect the page_build event above
- created

env:
DOXYGEN_VERSION: Release_1_9_1
types:
- published
# Trigger with the release workflow finishes
workflow_run:
workflows: ['Create a New Release']
types: [completed]
branches: [master]
# Also give a manual trigger
workflow_dispatch:
inputs:
publish:
description: 'Publish Documentation to GitHub Pages'
required: false
type: boolean
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"

steps:
# check out the Arduino-SDI-12 repo
- uses: actions/checkout@v4
with:
path: code_docs/Arduino-SDI-12

- name: Restore or Cache pip
uses: actions/[email protected]
id: cache_pip
with:
path: ~/.cache/pip
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Restore or Cache PlatformIO and Libraries
uses: actions/[email protected]
id: cache_pio
with:
path: ~/.platformio
# if nothing in the lock files has changed, then it will be a "cache hit"
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

# This should be pulled from cache, if there's not a new version
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio

# Install *all* the dependencies!
# We're including the dependencies just so the includes can follow in the doxygen pre-processor
- name: Install the dependencies at global level
run: |
echo "::debug::Installing greygnome/EnableInterrupt"
pio lib -g install greygnome/EnableInterrupt

- name: Update Libraries from Cache
run: pio lib -g update

- name: Install GraphViz (dot)
run: sudo apt-get -y install graphviz

- name: Restore or Cache Doxygen
id: cache_doxygen
uses: actions/[email protected]
with:
path: doxygen-src
key: ${{ runner.os }}-doxygen-${{ env.DOXYGEN_VERSION }}

- name: Clone and build doxygen
if: steps.cache_doxygen.outputs.cache-hit != 'true'
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: |
cd ${{ github.workspace }}/code_docs/Arduino-SDI-12/
chmod +x continuous_integration/build-install-doxygen.sh
sh continuous_integration/build-install-doxygen.sh

# This should be pulled from cache, if there's not a new version
- name: Install Pygments and other m.css requirements
run: pip3 install jinja2 Pygments beautifulsoup4

# check out my fork of m.css, for processing Doxygen output
- name: Checkout m.css
uses: actions/checkout@v4
with:
# Repository name with owner. For example, actions/checkout
repository: SRGDamia1/m.css
path: code_docs/m.css

- name: Generate all the documentation
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: |
cd ${{ github.workspace }}/code_docs/Arduino-SDI-12/
chmod +x continuous_integration/generate-documentation.sh
sh continuous_integration/generate-documentation.sh

- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ github.workspace }}/code_docs/Arduino-SDI-12Doxygen/m.css
doc_build:
if: ${{ (! contains(github.event.head_commit.message, 'ci skip')) && (github.event_name != 'workflow_run' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')) }}
name: Build documentation
uses: EnviroDIY/workflows/.github/workflows/build_documentation.yaml@main
with:
use_graphviz: false
publish: ${{ (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')}}
rebuild_cache_number: 1
secrets: inherit
105 changes: 27 additions & 78 deletions .github/workflows/build_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,37 @@ name: Build Examples
# Triggers the workflow on push or pull request events
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
build_examples:
name: Build standard examples with PlatformIO and the Arduino CLI
if: ${{ ! contains(github.event.head_commit.message, 'ci skip') }}
uses: EnviroDIY/workflows/.github/workflows/build_examples.yaml@main
with:
boards_to_build: 'mayfly,uno,megaatmega2560,leonardo,zeroUSB,arduino_nano_esp32,feather328p,feather32u4,adafruit_feather_m0,adafruit_feather_m4,huzzah,featheresp32,esp32-c3-devkitm-1,esp32-s3-devkitm-1'
examples_to_build: 'examples/a_wild_card,examples/b_address_change,examples/c_check_all_addresses,examples/d_simple_logger,examples/e_continuous_measurement,examples/f_basic_data_request,examples/g_terminal_window,examples/h_SDI-12_slave_implementation,examples/i_SDI-12_interface,examples/k_concurrent_logger,examples/l_verify_crc'
secrets: inherit


build_ext_ints:
name: Build the External Interrupt Example
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"

strategy:
matrix:
example:
[
examples/a_wild_card/,
examples/b_address_change/,
examples/c_check_all_addresses/,
examples/d_simple_logger/,
examples/e_continuous_measurement/,
examples/f_basic_data_request/,
examples/g_terminal_window/,
examples/h_SDI-12_slave_implementation/,
examples/i_SDI-12_interface/,
examples/j_external_pcint_library/,
examples/k_concurrent_logger/,
]
if: ${{ ! contains(github.event.head_commit.message, 'ci skip') }}
env:
PLATFORMIO_BUILD_CACHE_DIR: ~/.platformio/caches

steps:
- uses: actions/checkout@v4

- name: Set variables
run: |
if [[ -z "${GITHUB_HEAD_REF}" ]]; then
echo "::debug::Push to commit ${GITHUB_SHA}"
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_SHA}" >> $GITHUB_ENV
else
echo "::debug::Pull Request from the ${GITHUB_HEAD_REF} branch"
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi

- name: Restore or Cache pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Checkout code
uses: actions/checkout@v4

- name: Restore or Cache PlatformIO and Libraries
uses: actions/[email protected]
with:
path: ~/.platformio
# if nothing in the lock files has changed, then it will be a "cache hit" and pip will be restored
# otherwise, it will be a "cache miss" and a new cache of libraries will be created if the job completes successfully
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

# This should be pulled from cache, if there's not a new version
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio

- name: Run PlatformIO
if: matrix.example != 'examples/j_external_pcint_library/'
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
run: |
echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
pio lib --global install ${{ env.LIBRARY_INSTALL_SOURCE }}
pio lib --global install EnableInterrupt
platformio ci --board=mayfly --board=feather32u4 --board=adafruit_feather_m0 --board=uno --board=megaatmega2560 --board=huzzah --board=featheresp32
pio lib --global uninstall SDI-12
- name: Setup PlatformIO
uses: EnviroDIY/[email protected]

- name: Run PlatformIO
if: matrix.example == 'examples/j_external_pcint_library/'
- name: Build PlatformIO examples
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
PLATFORMIO_BUILD_FLAGS: -DSDI12_EXTERNAL_PCINT
run: |
echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
pio lib --global install ${{ env.LIBRARY_INSTALL_SOURCE }}
pio lib --global install EnableInterrupt
platformio ci --board=mayfly --board=feather32u4 --board=adafruit_feather_m0 --board=uno --board=megaatmega2560
pio lib --global uninstall SDI-12
PLATFORMIO_BUILD_FLAGS: -D SDI12_EXTERNAL_PCINT
PLATFORMIO_CI_SRC: examples/j_external_pcint_library
run: pio ci --board=mayfly --board=uno --board=megaatmega2560 --board=leonardo --board=zeroUSB --board=feather328p --board=feather32u4 --board=adafruit_feather_m0 --lib="." --project-option="lib_deps=greygnome/EnableInterrupt@^1.1.0"
4 changes: 2 additions & 2 deletions .github/workflows/changelog_reminder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Changelog Reminder
uses: peterjgrainger/[email protected]
with:
changelog_regex: '/ChangeLog\/.*\/*.md'
changelog_regex: '/CHANGELOG\/.*\/*.md/i'
customPrMessage: 'Please add your changes to the change log!'
env:
GITHUB_TOKEN: ${{ secrets.SARA_PUSH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87 changes: 31 additions & 56 deletions .github/workflows/prepare_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,43 @@ on:
- 'VERSION' # Push events when the VERSION file changes
workflow_dispatch:

name: Prepare a new release
name: Create a New Release

env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}

jobs:
release:
name: Prepare a new release
wait_for_checks:
if: ${{ github.event_name != 'workflow_dispatch' }}
strategy:
matrix:
req_workflow:
[
verify_library_structure.yaml,
build_examples.yaml,
build_documentation.yaml,
]
name: Wait for Checks to complete
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set variables
run: |
echo "::debug::Get the current version number"
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV

- name: Restore or Cache pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Set up Python
uses: actions/setup-python@v5
- name: Wait on Workflow
uses: ArcticLampyrid/[email protected]
with:
python-version: '3.x'
workflow: ${{ matrix.req_workflow }}
sha: ${{ github.sha || github.event.pull_request.head.sha || github.event.pull_request.head.ref }} # optional
allowed-conclusions: |
success
cancelled
skipped

# This should be pulled from cache, if there's not a new version
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio

- name: Get notes
id: generate_notes
uses: anmarkoulis/commitizen-changelog-reader@master
with:
# NOTE: Need to add the refs/tags to work with the generate notes action
tag_name: ${{ format('refs/tags/{0}', env.VERSION) }}
changelog: ChangeLog.md

# Create a new release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false
body: ${{join(fromJson(steps.generate_notes.outputs.notes).notes, '')}}

# Publish the new release to the pio package manager
- name: Publish release to PIO
id: publish-pio
run: pio package publish
release:
name: Prepare a new release
needs: [wait_for_checks]
if: |
always() &&
(needs.wait_for_checks.result == 'success' || needs.wait_for_checks.result == 'skipped')
uses: EnviroDIY/workflows/.github/workflows/prepare_release.yaml@main
secrets: inherit
with:
library-manager: 'update'
library-compliance: 'strict'
Loading
Loading