diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8df5911..4d62881 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,6 +82,13 @@ jobs: zip -r ../MiniDexed_$GITHUB_RUN_NUMBER_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD).zip * echo "artifactName=MiniDexed_$GITHUB_RUN_NUMBER_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV cd - + - name: Hardware configration files + run: | + cd hwconfig + sh -ex ./customize.sh + cd - + mkdir -p ./sdcard/hardware/ + cp -r ./hwconfig/minidexed_* ./sdcard/minidexed.ini ./sdcard/hardware/ - uses: actions/upload-artifact@v3 with: name: ${{ env.artifactName }} # Exported above diff --git a/.gitignore b/.gitignore index 93bd001..5e9f987 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,5 @@ sdcard CMSIS_5/ Synth_Dexed/ -circle-stdlib/ \ No newline at end of file +circle-stdlib/ +minidexed_* \ No newline at end of file diff --git a/hwconfig/DT-DX.override b/hwconfig/DT-DX.override new file mode 100644 index 0000000..1e6ba75 --- /dev/null +++ b/hwconfig/DT-DX.override @@ -0,0 +1,46 @@ +# DTronics DT-DX +# https://www.dtronics.nl/dt-dx + +SoundDevice=i2s +SampleRate=22000 +ChunkSize=256 +DACI2CAddress=0x0 +ChannelsSwapped=1 + +LCDEnabled=1 +LCDPinEnable=17 +LCDPinRegisterSelect=27 +LCDPinReadWrite=16 +LCDPinData4=22 +LCDPinData5=23 +LCDPinData6=24 +LCDPinData7=25 +LCDI2CAddress=0x00 + +SSD1306LCDI2CAddress=0x00 +SSD1306LCDWidth=128 +SSD1306LCDHeight=32 +SSD1306LCDRotate=0 +SSD1306LCDMirror=0 + +LCDColumns=16 +LCDRows=2 + +ButtonPinPrev=0 +ButtonActionPrev=0 +ButtonPinNext=0 +ButtonActionNext=0 +ButtonPinBack=26 +ButtonActionBack=longpress +ButtonPinSelect=26 +ButtonActionSelect=click +ButtonPinHome=26 +ButtonActionHome=doubleclick +ButtonPinShortcut=26 + +DoubleClickTimeout=400 +LongPressTimeout=400 + +EncoderEnabled=1 +EncoderPinClock=6 +EncoderPinData=5 \ No newline at end of file diff --git a/hwconfig/customize.sh b/hwconfig/customize.sh new file mode 100755 index 0000000..687b568 --- /dev/null +++ b/hwconfig/customize.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# This script creates a set of ini files from the *.override files +# to provide customized configurations for well-known hardware + +# Find all files named *.override, and run the following on each of them +for file in *.override; do + # Copy the file minidexed.ini to the name of this file but with .ini extension instead + name_of_ini_file=minidexed_$(echo "$file" | sed 's/\.override$/.ini/') + cp ../src/minidexed.ini "$name_of_ini_file" + + # Change the values in the ini file, leaving the rest of the file unchanged + while IFS='=' read -r key value; do + # Skip empty lines and comments + if [ -z "$key" ] || [ "${key#\#}" != "$key" ]; then + continue + fi + value=$(echo "$value" | tr -d '\r') + if [ -n "$value" ]; then + sed -i "s/^$key=.*/$key=$value/" "$name_of_ini_file" + fi + done < "$file" + + # Process the last line of the override file separately, if it doesn't end with a newline + if [ -n "$key" ]; then + value=$(echo "$value" | tr -d '\r') + if [ -n "$value" ]; then + sed -i "s/^$key=.*/$key=$value/" "$name_of_ini_file" + fi + fi + + echo "Created $name_of_ini_file" +done diff --git a/hwconfig/pirate_audio.override b/hwconfig/pirate_audio.override new file mode 100644 index 0000000..680f3fe --- /dev/null +++ b/hwconfig/pirate_audio.override @@ -0,0 +1,32 @@ +# Pimoroni Pirate Audio (screen, buttons and audio output) +# https://shop.pimoroni.com/search?q=pirate%20audio + +SoundDevice=i2s +LCDEnabled=1 + +SPIBus=0 +ST7789Enabled=1 +ST7789Data=9 +ST7789Select=1 +ST7789Reset= +ST7789Backlight=13 +ST7789Width=240 +ST7789Height=240 +ST7789Rotation=90 + +LCDColumns=15 +LCDRows=2 + +ButtonPinPrev=5 +ButtonActionPrev=click +ButtonPinNext=6 +ButtonActionNext=click +ButtonPinBack=16 +ButtonActionBack=click +ButtonPinSelect=24 +ButtonActionSelect=click +ButtonPinHome=16 +ButtonActionHome=doubleclick +ButtonPinShortcut=0 + +EncoderEnabled=0 \ No newline at end of file