Skip to content

Commit

Permalink
Merge remote-tracking branch 'lancaster-university/master' into calliope
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Aug 7, 2024
2 parents fab9b0d + 50ae994 commit b152a1e
Show file tree
Hide file tree
Showing 72 changed files with 488 additions and 170 deletions.
42 changes: 37 additions & 5 deletions .github/tools/gitchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,14 @@ def getTags():
tags = filter(lambda x: "-" not in x, tags)
return natsorted(tags,reverse=True)

def getCommitsBetween( tagA, tagB = "HEAD" ):
commits = os.popen(f"git -P shortlog {tagA}..{tagB}").read().strip().splitlines()
return "\n".join(map( lambda x: x.replace(" ", " - "), commits ))
def getCommitsBetween( tagA, tagB = "HEAD", dir=None):
if dir:
original_dir = os.getcwd()
os.chdir(dir)
commits = os.popen(f'git log --format="%s (by %an)" --no-merges --reverse {tagA}..{tagB}').read().strip().splitlines()
if dir:
os.chdir(original_dir)
return "\n - ".join([""] + commits)

def getRepoURL():
origin = os.popen("git remote get-url origin").read().strip().split( "github.com/", maxsplit=1 )
Expand All @@ -62,6 +67,22 @@ def printLibraryLinks():
for lib in config['libraries']:
output( F" - {lib['name']} = {lib['url']}/tree/{lib['branch']}" )

def getOldAndNewLibCommits(old_commit, new_commit):
old_target_locked = json.loads(os.popen(f"git show {old_commit}:target-locked.json").read())
new_target_locked = json.loads(os.popen(f"git show {new_commit}:target-locked.json").read())
lib_versions = {}
# We only have a handful of libraries in the list, okay to be inefficient
for old_lib in old_target_locked["libraries"]:
for new_lib in new_target_locked["libraries"]:
if old_lib["name"] == new_lib["name"]:
lib_versions[old_lib["name"]] = {
"old": old_lib["branch"],
"new": new_lib["branch"],
"url": old_lib["url"]
}
return lib_versions


tags = getTags()

defaultTag = "v0.0.1"
Expand Down Expand Up @@ -109,12 +130,23 @@ def printLibraryLinks():
print( "Nothing to do, Stop." )
exit( 0 )

# Target commits
logURL = f"{url}compare/{lastTag}...{options.tag}"

output( f"## [{options.tag}]({logURL})", forcePrint=True )
output( '', forcePrint=True )
output( getCommitsBetween( lastTag, options.tag ), forcePrint=True )

# Library commits
libInfo = getOldAndNewLibCommits( lastTag, options.tag )
for libName, lib in libInfo.items():
libCommits = getCommitsBetween(lib['old'], lib['new'], dir=f"../{libName}")
if libCommits:
diffUrl = f"{lib['url']}/compare/{lib['old']}...{lib['new']}"
diffUrlMarkdown = f"[{lib['old'][:7]}...{lib['new'][:7]}]({diffUrl})"
output(f"\n### {libName} ({diffUrlMarkdown})", forcePrint=True)
output(libCommits, forcePrint=True)

output( '', forcePrint=True )

output( line )
else:
output( line )
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ jobs:
build-microbit-v2-samples:
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
os: [ubuntu-20.04, macos-12, windows-2019]
gcc: ['7-2017-q4', 'latest']
cmake: ['3.6.0', ''] # Empty string installs the latest CMake release
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}, gcc ${{ matrix.gcc }}, cmake ${{ matrix.cmake || 'latest'}}
steps:
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Setup arm-none-eabi-gcc ${{ matrix.gcc }}
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: ${{ matrix.gcc }}
- name: Setup CMake ${{ matrix.cmake }}
uses: jwlawson/actions-setup-cmake@v1
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ matrix.cmake }}
- name: Install latest Ninja release via PyPI
Expand All @@ -38,14 +38,14 @@ jobs:
ninja --version
python --version
- name: Clone the microbit-v2-samples repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'calliope-edu/microbit-v2-samples'
ref: 'calliope'
# We need to use the checkout action (instead of build.py cloning the
# repository) so that on PRs we can get the commit from the PR merge
- name: Clone this repository in the libraries folder
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: libraries/codal-microbit-v2
submodules: 'recursive'
Expand All @@ -71,7 +71,7 @@ jobs:
run: python build.py
- name: Upload non-ble hex file
if: runner.os == 'Windows' && matrix.gcc == 'latest' && matrix.cmake == ''
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: codal-microbit-v2-${{ github.sha }}
path: MICROBIT.hex
Expand All @@ -90,7 +90,7 @@ jobs:
run: python build.py --clean
- name: Upload BLE hex file
if: runner.os == 'Windows' && matrix.gcc == 'latest' && matrix.cmake == ''
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: codal-microbit-v2-BLE-${{ github.sha }}
path: MICROBIT.hex
29 changes: 17 additions & 12 deletions .github/workflows/makecode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@ jobs:
strategy:
matrix:
# One job builds with the local toolchain, the other with Docker
# FIXME: The current docker image used by pxt-calliope is not publicly accessible via
# a known public registry, so the builds using docker will fail.
# As a temporary measure, let's only build the "nodocker" version and reneable the
# docker build in the future, once we can access the build image.
# https://github.com/lancaster-university/codal-microbit-v2/issues/338#issuecomment-1658767316
# pxt-flags: ["PXT_NODOCKER=1", ""]
pxt-flags: ["PXT_NODOCKER=1"]
pxt-flags: ["PXT_NODOCKER=1", ""]
fail-fast: false
name: Build MakeCode ${{ matrix.pxt-flags && '(nodocker)' }}
runs-on: ubuntu-22.04
steps:
- name: Setup Python 3.7
uses: actions/setup-python@v4
- name: Setup Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.9'
- name: Setup arm-none-eabi-gcc v10.3
if: ${{ matrix.pxt-flags }}
uses: carlosperate/arm-none-eabi-gcc-action@v1
Expand All @@ -45,11 +39,11 @@ jobs:
sudo apt update
sudo apt install srecord
- name: Setup Node.js v16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Clone the pxt-calliope repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'microsoft/pxt-calliope'
- name: Install MakeCode dependencies
Expand Down Expand Up @@ -91,6 +85,17 @@ jobs:
f.write(json.dumps(pxt_target, indent=4))
EOF
git diff pxtarget.json
# https://github.com/microsoft/pxt-microbit/issues/5721
# https://docs.docker.com/engine/deprecated/#pushing-and-pulling-with-image-manifest-v2-schema-1
# https://stackoverflow.com/a/51357915/775259
- name: Workaround for issue with pext/yotta:latest docker image type being deprecated
run: |
echo "[Service]" > docker-service-override.conf
echo 'Environment="DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE=1"' >> docker-service-override.conf
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo mv docker-service-override.conf /etc/systemd/system/docker.service.d/docker-service-override.conf
sudo systemctl daemon-reload
sudo systemctl restart docker
- name: Build MakeCode targets
# Because pxt runs docker with "--user build" it doesn't have write access to some mounted files,
# so we need to force all files created by the pxt cli to have write/execute rights for everyone
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Build MicroPython
steps:
- name: Clone MicroPython
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'calliope-edu/micropython-microbit-v2'
ref: 'v2.1.2-cmini3'
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
cd src
make -j4
- name: Upload hex file
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: micropython-${{ github.sha }}.hex
path: src/MICROBIT.hex
4 changes: 2 additions & 2 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-20.04
name: Build against Ubuntu-20.04 for release assets
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install CppCheck
run: |
sudo apt-get update
Expand All @@ -22,7 +22,7 @@ jobs:
release: latest

- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1
uses: jwlawson/actions-setup-cmake@v2

- name: Build default project using build.py
run: python build.py
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/size-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# Install the toolchain #
#########################
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Setup arm-none-eabi-gcc 10.3
Expand All @@ -42,7 +42,7 @@ jobs:
# Set up the CODAL project and build it #
#########################################
- name: Clone the microbit-v2-samples repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'calliope-edu/microbit-v2-samples'
# Unless manually triggered via workflow_dispatch this will be 'calliope'
Expand All @@ -51,7 +51,7 @@ jobs:
# We need to use the checkout action (instead of build.py cloning the
# repository) so that on PRs we can get the commit from the PR merge
- name: Clone this repository in the libraries folder
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: libraries/codal-microbit-v2
fetch-depth: '0'
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
- name: "PR only: Add comment to PR with the bloaty diff"
if: ${{ github.event.pull_request }}
continue-on-error: true
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
let prComment = '## Build diff\n' +
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python3 -m pip install natsort
Expand Down
85 changes: 63 additions & 22 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,76 @@
For official release notes, please see Releases.md

The current tag uses the following library versions:
- codal-core = https://github.com/lancaster-university/codal-core/tree/7b6f9df3b586f8dd9bede4bd0baa0cdc212b6ba2
- codal-nrf52 = https://github.com/lancaster-university/codal-nrf52/tree/0643733703b4f8f788af81a996f40d1f1a1527bc
- codal-core = https://github.com/lancaster-university/codal-core/tree/509086cc8590465041b15493ab52b56e7071c110
- codal-nrf52 = https://github.com/lancaster-university/codal-nrf52/tree/8802eb49140e0389e535cb6160d9080efd951ba7
- codal-microbit-nrf5sdk = https://github.com/microbit-foundation/codal-microbit-nrf5sdk/tree/d41d5c7ebe53a1d01935e61d4ffa891e5112e119

## [v0.2.67](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.66...v0.2.67)

- Updated the Changelog (by Github Actions)
- Update Changelog.md (by Dr John Vidler)
- CI: Restore building MakeCode with Docker. (#407) (by Carlos Pereira Atencio)
- CI: Update versions of actions to remove warnings about node 16. (#408) (by Carlos Pereira Atencio)
- Remove uBit.io.face as it was a temp additional that is no longer needed. (#410) (by Carlos Pereira Atencio)
- Added definitions to match the Makecode effects parameters (#417) (by Dr John Vidler)
- CI:Update Changelog script to include changes in lib dependencies. (#420) (by Carlos Pereira Atencio)
- Set uBit.io.logo to capacitive touch mode by default. (#418) (by Carlos Pereira Atencio)
- CI: PXT build workaround due to deprecated PXT docker image type. (#435) (by Carlos Pereira Atencio)
- CI: Update macOS runner version as 11 is deprecated. (#436) (by Carlos Pereira Atencio)
- Populate MICROBIT_DAL_VERSION and add microbit_dal_version(). (#434) (by Carlos Pereira Atencio)
- Addition of getRows(n, k) and getNumberOfRows(n) to the datalogger. (#431) (by KierPalin)
- Ensure header files and .cpp files use the codal namespace appropriately. (#437) (by Carlos Pereira Atencio)
- Snapshot v0.2.67 (by Carlos Pereira Atencio)

### codal-core ([992c0b1...509086c](https://github.com/lancaster-university/codal-core/compare/992c0b11a0eb2a1edca9c2f76821f89a99a3acec...509086cc8590465041b15493ab52b56e7071c110))

- Update docstrings for LevelDetector threshold methods. (#167) (by Carlos Pereira Atencio)
- Display scroll an empty char if the requested char is out-of-range. (#168) (by Carlos Pereira Atencio)
- Better version support symbols for user applications (#169) (by Dr John Vidler)
- Ensure .cpp files are `using namespace codal`. (#170) (by Carlos Pereira Atencio)
- Add config flag to enable/disable adding codal to the global namespace. (#171) (by Carlos Pereira Atencio)

### codal-nrf52 ([0643733...8802eb4](https://github.com/lancaster-university/codal-nrf52/compare/0643733703b4f8f788af81a996f40d1f1a1527bc...8802eb49140e0389e535cb6160d9080efd951ba7))

- NRF52Pin::wasTouched() default w/o args to use current pin touch mode state. (#53) (by Carlos Pereira Atencio)
- Ensure all .cpp files have `using namespace codal`. (#54) (by Carlos Pereira Atencio)
- Set neopixel functions inside the codal namespace. (by Carlos Pereira Atencio)
- Wrap `using namespace` in headers with codal config flag. (#43) (by Carlos Pereira Atencio)

## [v0.2.66](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.65...v0.2.66)

- Updated the Changelog (by Github Actions)
- Update Changelog.md (by Dr John Vidler)
- Snapshot v0.2.66 (by Dr John Vidler)

### codal-core ([7b6f9df...992c0b1](https://github.com/lancaster-university/codal-core/compare/7b6f9df3b586f8dd9bede4bd0baa0cdc212b6ba2...992c0b11a0eb2a1edca9c2f76821f89a99a3acec))

- Applying the patch suggested by @dpgeorge to handle large receiving buffers for pullInto() (by Dr John Vidler)

## [v0.2.65](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.63...v0.2.65)

Carlos Pereira Atencio (1):
- Set MICROBIT_RADIO_MAX_PACKET_SIZE as a configurable value. (#387)

Dr John Vidler (10):
- Merged patch to fix the various sample rate issues
- Corrected Changelog.md after my tag snarfu
- Refined the changelog script to only update the head of the log under normal cases
- Resolved conflict in the manual updates to the ChangeLog
- Added a new CONFIG_MIXER_DEFAULT_CHANNEL_SAMPLERATE constant for channels with no defined rate to use
- Fixed a bug where in some conditions the microphone would not auto-start
- Added MicroBitButton.h to the required includes for MicroBitCompat.h so its still included in the build when not using bluetooth
- Moved the MicroBitButton inclusion to the tail of MicroBitCompat to avoid circular dependencies or a bunch of needless forward declarations
- Bumped the default Mixer2 channel sample rate back up to 44100
- Snapshot v0.2.65
- Updated the Changelog (by Github Actions)
- Corrected Changelog.md after my tag snarfu (by Dr John Vidler)
- Refined the changelog script to only update the head of the log under normal cases (by Dr John Vidler)
- Set MICROBIT_RADIO_MAX_PACKET_SIZE as a configurable value. (#387) (by Carlos Pereira Atencio)
- Change datalog CSV download mime type from text/plain to text/csv (#339) (by Martin Williams)
- Added a new CONFIG_MIXER_DEFAULT_CHANNEL_SAMPLERATE constant for channels with no defined rate to use (by Dr John Vidler)
- Fixed a bug where in some conditions the microphone would not auto-start (by Dr John Vidler)
- Update MicroBitLog to support 3 header formats (#399) (by Matt Hillsdon)
- Added MicroBitButton.h to the required includes for MicroBitCompat.h so its still included in the build when not using bluetooth (by Dr John Vidler)
- Moved the MicroBitButton inclusion to the tail of MicroBitCompat to avoid circular dependencies or a bunch of needless forward declarations (by Dr John Vidler)
- Bumped the default Mixer2 channel sample rate back up to 44100 (by Dr John Vidler)
- Snapshot v0.2.65 (by Dr John Vidler)

Github Actions (1):
- Updated the Changelog
### codal-core ([63f017f...7b6f9df](https://github.com/lancaster-university/codal-core/compare/63f017fdcd12aca769264c36fe47e6071a40e502...7b6f9df3b586f8dd9bede4bd0baa0cdc212b6ba2))

Martin Williams (1):
- Change datalog CSV download mime type from text/plain to text/csv (#339)
- Updated to correctly restore mic state on returning from a deep sleep (by Dr John Vidler)
- Typo (by Dr John Vidler)
- Working audio resampling rates if requested by downstream components of a SplitterChannel (by Dr John Vidler)

Matt Hillsdon (1):
- Update MicroBitLog to support 3 header formats (#399)
### codal-microbit-nrf5sdk ([5714cbe...d41d5c7](https://github.com/microbit-foundation/codal-microbit-nrf5sdk/compare/5714cbe338c3544793bbb841a7ae81708a3ffae1...d41d5c7ebe53a1d01935e61d4ffa891e5112e119))

- Revert "Quieted a warning on fallthrough, as this is intended behaviour" (by Dr John Vidler)

## [v0.2.63](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.62...v0.2.63)

Expand Down
7 changes: 5 additions & 2 deletions inc/MicroBitBLEChar.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ DEALINGS IN THE SOFTWARE.

#include "MicroBitBLETypes.h"

namespace codal
{

/**
* Class definition for MicroBitBLEChar.
Expand Down Expand Up @@ -67,6 +69,7 @@ class MicroBitBLEChar
uint16_t cccd;
};

} // namespace codal

#endif
#endif
#endif // CONFIG_ENABLED(DEVICE_BLE)
#endif // MICROBIT_BLE_CHAR_H
Loading

0 comments on commit b152a1e

Please sign in to comment.