Skip to content

Commit

Permalink
Merge branch 'prepare-merge-0.2.66-into-0.2.63' into calliope
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Jun 24, 2024
2 parents e1ec5d3 + 498c64c commit fab9b0d
Show file tree
Hide file tree
Showing 29 changed files with 519 additions and 170 deletions.
101 changes: 87 additions & 14 deletions .github/tools/gitchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,25 @@

import os
import json
import re
from natsort import natsorted
from optparse import OptionParser

outBuffer = []
def output( data, forcePrint = False ):
outBuffer.append( data )

if forcePrint:
print( data )

def writeOutput():
if options.outFile != None:
with open( options.outFile, mode="w", encoding="utf-8" ) as out:
for line in outBuffer:
out.write( f"{line}\n" )
else:
for line in outBuffer:
print( line )

def getTags():
tags = os.popen('git -P tag').read().strip().splitlines()
Expand All @@ -42,24 +60,79 @@ def getRepoURL():
def printLibraryLinks():
config = json.loads(open( 'target-locked.json' ).read())
for lib in config['libraries']:
print( F" - {lib['name']} = {lib['url']}/tree/{lib['branch']}" )

print( '# Changelog' )
print( '*This file is autogenerated and will be overwritten on the next tag.*' )
print( '' )
print( 'For official release notes, please see Releases.md' )
print( '' )
print( 'The current tag uses the following library versions:' )
printLibraryLinks()
print( '' )
output( F" - {lib['name']} = {lib['url']}/tree/{lib['branch']}" )

tags = getTags()

defaultTag = "v0.0.1"
if( len(tags) > 0 ):
defaultTag = tags[0]

parser = OptionParser()
parser.add_option( "--input", dest="inFile", help="read existing changelog from FILE", metavar="FILE" )
parser.add_option( "--output", dest="outFile", help="write updated changelog to FILE", metavar="FILE" )
parser.add_option( "--tag", dest="tag", help="Force this to be the tag to update to", default=defaultTag )

(options, args) = parser.parse_args()

if options.tag not in tags:
print( f"No such tag '{options.tag}' found, unable to continue." )
exit( 1 )

if options.outFile == None:
options.outFile = options.inFile

output( '# Changelog' )
output( '*The head of this file is autogenerated and will be overwritten on the next tag.*' )
output( '' )
output( 'For official release notes, please see Releases.md' )
output( '' )
output( 'The current tag uses the following library versions:' )
printLibraryLinks()
output( '' )

if options.inFile != None:
with open( options.inFile, mode="r", encoding="utf-8" ) as input:
lastTag = None

url = getRepoURL()

try:
for line in input.readlines():
line = line.replace( "\n", "" )
if lastTag == None:
if line.startswith( "##" ):
matches = re.search( "\[(v.+)\]", line )
lastTag = matches.group(1)

if lastTag == options.tag:
print( "Nothing to do, Stop." )
exit( 0 )

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

output( f"## [{options.tag}]({logURL})", forcePrint=True )
output( '', forcePrint=True )
output( getCommitsBetween( lastTag, options.tag ), forcePrint=True )
output( '', forcePrint=True )
output( line )
else:
output( line )
except:
exit( 1 )

writeOutput()
exit( 0 )

for i in range(0, len(tags)-1):
output( tags[i] )
url = getRepoURL()
logURL = f"{url}compare/{tags[i+1]}...{tags[i]}"
treeURL = f"{url}tree/{tags[i]}"

print('')
print(f"## [{tags[i]}]({logURL})" )
print('')
print( getCommitsBetween( tags[i+1], tags[i] ) )
output('')
output(f"## [{tags[i]}]({logURL})" )
output('')
output( getCommitsBetween( tags[i+1], tags[i] ) )

writeOutput()
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Generate a new Changelog
run: |
git checkout master
python3 .github/tools/gitchanges.py > Changelog.md
python3 .github/tools/gitchanges.py --input Changelog.md
- name: Commit the new Changelog
run: |
Expand Down
39 changes: 27 additions & 12 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
# Changelog
*This file is autogenerated and will be overwritten on the next tag.*
*The head of this file is autogenerated and will be overwritten on the next tag.*

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/63f017fdcd12aca769264c36fe47e6071a40e502
- codal-core = https://github.com/lancaster-university/codal-core/tree/7b6f9df3b586f8dd9bede4bd0baa0cdc212b6ba2
- codal-nrf52 = https://github.com/lancaster-university/codal-nrf52/tree/0643733703b4f8f788af81a996f40d1f1a1527bc
- codal-microbit-nrf5sdk = https://github.com/microbit-foundation/codal-microbit-nrf5sdk/tree/5714cbe338c3544793bbb841a7ae81708a3ffae1
- codal-microbit-nrf5sdk = https://github.com/microbit-foundation/codal-microbit-nrf5sdk/tree/d41d5c7ebe53a1d01935e61d4ffa891e5112e119

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

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

Dr John Vidler (3):
- Reverted the power saving for the LED Matrix to avoid strange issues with Pins.
- Merge branch 'master' of ssh://github.com/lancaster-university/codal-microbit-v2
- Snapshot v0.2.64
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

Github Actions (1):
- Updated the Changelog

Martin Williams (1):
- Change datalog CSV download mime type from text/plain to text/csv (#339)

Matt Hillsdon (1):
- Update MicroBitLog to support 3 header formats (#399)

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

Dr John Vidler (5):
Dr John Vidler (9):
- Removed deactivateLevelSPL entirely as per codal-microbit-v2 issue #222
- Fix for the microphone failing to wake after a sleep event
- Commented out a temporary alias for the face/logo touch button, staged for removal
- Revert for the face alias removal, for v0.2.63 release
- Reverted the power saving for the LED Matrix to avoid strange issues with Pins.
- Snapshot v0.2.63

Github Actions (1):
Github Actions (3):
- Updated the Changelog

## [v0.2.62](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.61...v0.2.62)
Expand Down
3 changes: 2 additions & 1 deletion inc/MicroBitAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ namespace codal
LowPassFilter *micFilter; // Low pass filter to remove high frequency noise on the mic

private:
bool micEnabled; // State of on board mic
volatile bool micEnabled; // State of on board mic
volatile bool micSleepState; // State of on board mic when we went to sleep last
bool speakerEnabled; // State of on board speaker
bool pinEnabled; // State of on auxiliary output pin
NRF52Pin *pin; // Auxiliary pin to route audio to
Expand Down
18 changes: 17 additions & 1 deletion inc/MicroBitConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,14 @@
// Set to '1' to enable
#ifndef MICROBIT_BLE_NORDIC_STYLE_UART
#define MICROBIT_BLE_NORDIC_STYLE_UART 0
#endif
#endif

// Configure the radio maximum packet size
// TODO: Update the range here once issue codal-microbit-v2#383 has been resolved
// https://github.com/lancaster-university/codal-microbit-v2/issues/383
#ifndef MICROBIT_RADIO_MAX_PACKET_SIZE
#define MICROBIT_RADIO_MAX_PACKET_SIZE 32
#endif

// Versioning options.
// We use semantic versioning (http://semver.org/) to identify differnet versions of the micro:bit runtime.
Expand Down Expand Up @@ -306,3 +313,12 @@
#ifndef CONFIG_MICROBIT_ERASE_USER_DATA_ON_REFLASH
#define CONFIG_MICROBIT_ERASE_USER_DATA_ON_REFLASH 1
#endif


// Defines the MicrobitLog HTML header used
// 0: data.microbit.org data logging experience
// 1: basic experience supported by dl.js in this repository hosted on microbit.org
// 2: "BBC micro:bit - the next gen" playground survey experience (this requires a specific HEX to generate the relevant data format)
#ifndef MICROBIT_LOG_MODE
#define MICROBIT_LOG_MODE 0
#endif
9 changes: 8 additions & 1 deletion inc/MicroBitRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace codal
#include "CodalConfig.h"
#include "codal-core/inc/types/Event.h"
#include "PacketBuffer.h"
#include "MicroBitConfig.h"
#include "MicroBitRadioDatagram.h"
#include "MicroBitRadioEvent.h"

Expand Down Expand Up @@ -71,11 +72,17 @@ namespace codal
#define MICROBIT_RADIO_DEFAULT_GROUP 0
#define MICROBIT_RADIO_DEFAULT_TX_POWER 6
#define MICROBIT_RADIO_DEFAULT_FREQUENCY 7
#define MICROBIT_RADIO_MAX_PACKET_SIZE 32
#define MICROBIT_RADIO_HEADER_SIZE 4
#define MICROBIT_RADIO_MAXIMUM_RX_BUFFERS 4
#define MICROBIT_RADIO_POWER_LEVELS 8

// Max packet size is configurable, so ensure maximum value is not exceeded
// TODO: Update this value once issue codal-microbit-v2#383 is resolved
// https://github.com/lancaster-university/codal-microbit-v2/issues/383
#if MICROBIT_RADIO_MAX_PACKET_SIZE > 250
#error "MICROBIT_RADIO_MAX_PACKET_SIZE cannot be larger than 250 bytes"
#endif

// Known Protocol Numbers
#define MICROBIT_RADIO_PROTOCOL_DATAGRAM 1 // A simple, single frame datagram. a little like UDP but with smaller packets. :-)
#define MICROBIT_RADIO_PROTOCOL_EVENTBUS 2 // Transparent propogation of events from one micro:bit to another.
Expand Down
11 changes: 10 additions & 1 deletion inc/Mixer2.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ DEALINGS IN THE SOFTWARE.
#define CONFIG_MIXER_DEFAULT_SAMPLERATE 44100
#endif

// The default sample rate, for when the user does not supply us with anything
// This applies to both ADC input rates and mixer output rates.
//
// This is distinct from CONFIG_MIXER_DEFAULT_SAMPLERATE which sets the mixer's absolute maximum rate
// whereas this is simply the 'normal' operating rate for audio peripherals.
#ifndef CONFIG_MIXER_DEFAULT_CHANNEL_SAMPLERATE
#define CONFIG_MIXER_DEFAULT_CHANNEL_SAMPLERATE 44100
#endif

#define DEVICE_ID_MIXER 3030

#define DEVICE_MIXER_EVT_SILENCE 1
Expand Down Expand Up @@ -156,7 +165,7 @@ class Mixer2 : public DataSource
* @param sampleRate (samples per second) - if set to zero, defaults to the output sample rate of the Mixer
* @param sampleRange (quantization levels) the difference between the maximum and minimum sample level on the input channel
*/
MixerChannel *addChannel(DataSource &stream, float sampleRate = 0, int sampleRange = CONFIG_MIXER_INTERNAL_RANGE);
MixerChannel *addChannel(DataSource &stream, float sampleRate = CONFIG_MIXER_DEFAULT_CHANNEL_SAMPLERATE, int sampleRange = CONFIG_MIXER_INTERNAL_RANGE);

/**
* Removes a channel from the mixer
Expand Down
9 changes: 9 additions & 0 deletions inc/compat/MicroBitCompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,13 @@ namespace codal

using namespace codal;

//
// MicroBitButton has dependencies on the definitions here, so needs to be included
// after these are defined to avoid having to redeclare everything needlessly or have
// user code manually include this after MicroBitCompat.h
//
// Without this, we end up with circular dependencies.
//
#include "MicroBitButton.h"

#endif
2 changes: 1 addition & 1 deletion resources/logfs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
test.html
/sample-*.html
/samples/*.html
Loading

0 comments on commit fab9b0d

Please sign in to comment.