Skip to content

Commit

Permalink
Merge branch 'network+arturia' into dawdisplay
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd authored Dec 21, 2024
2 parents 1457059 + ac27acc commit cc419ce
Show file tree
Hide file tree
Showing 32 changed files with 3,835 additions and 24 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
export PATH=$(readlink -f ./gcc-*arm-none*/bin/):$PATH
RPI=1 bash -ex build.sh
cp ./src/kernel*.img ./kernels/
- name: Get Raspberry Pi boot files
- name: Get Raspberry Pi boot files and WLAN firmware
run: |
set -ex
export PATH=$(readlink -f ./gcc-*aarch64-none*/bin/):$PATH
Expand All @@ -77,12 +77,18 @@ jobs:
cd sdcard
cp ../kernels/* . || true
cd -
# WLAN firmware
cp circle-stdlib/libs/circle/addon/wlan/sample/hello_wlan/wpa_supplicant.conf sdcard/
mkdir -p sdcard/firmware
cd sdcard/firmware
make -f ../../circle-stdlib/libs/circle/addon/wlan/firmware/Makefile
cd -
- name: Get performance files
run: |
git clone https://github.com/Banana71/Soundplantage --depth 1 # depth 1 means only the latest commit
cp -r ./Soundplantage/performance ./Soundplantage/*.pdf ./sdcard/
cd sdcard
zip -r ../MiniDexed_$GITHUB_RUN_NUMBER_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD).zip *
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
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ sdcard
*.swp
*.swo

CMSIS_5/
Synth_Dexed/
circle-stdlib/
CMSIS_5/**
Synth_Dexed/**
circle-stdlib/**
.vscode/
minidexed_*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[submodule "circle-stdlib"]
path = circle-stdlib
url = https://github.com/smuehlst/circle-stdlib
ignore = all
[submodule "Synth_Dexed"]
path = Synth_Dexed
url = https://codeberg.org/dcoredump/Synth_Dexed.git
ignore = all
[submodule "CMSIS_5"]
path = CMSIS_5
url = https://github.com/ARM-software/CMSIS_5
ignore = all
2 changes: 1 addition & 1 deletion Synth_Dexed
Submodule Synth_Dexed updated from 8c677c to c9f527
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ if [ "${RPI}" -gt "1" ]; then
OPTIONS="${OPTIONS} -o ARM_ALLOW_MULTI_CORE"
fi

# For wireless access
if [ "${RPI}" == "3" ]; then
OPTIONS="${OPTIONS} -o USE_SDHOST"
fi

# USB Vendor and Device ID for use with USB Gadget Mode
source USBID.sh
if [ "${USB_VID}" ] ; then
Expand All @@ -39,6 +44,11 @@ make -j
cd libs/circle/addon/display/
make clean || true
make -j

cd ../wlan/
make clean || true
make -j

cd ../sensor/
make clean || true
make -j
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
CIRCLE_STDLIB_DIR = ../circle-stdlib
SYNTH_DEXED_DIR = ../Synth_Dexed/src
CMSIS_DIR = ../CMSIS_5/CMSIS
NET_DIR = ./net

OBJS = main.o kernel.o minidexed.o config.o userinterface.o uimenu.o \
mididevice.o midikeyboard.o serialmididevice.o pckeyboard.o \
mididevice.o udpmididevice.o midikeyboard.o serialmididevice.o pckeyboard.o \
sysexfileloader.o performanceconfig.o perftimer.o \
effect_compressor.o effect_platervbstereo.o uibuttons.o midipin.o \
dawcontroller.o
dawcontroller.o \
net/ftpdaemon.o net/ftpworker.o net/applemidi.o net/udpmidi.o net/mdnspublisher.o

OPTIMIZE = -O3

Expand Down
10 changes: 8 additions & 2 deletions src/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ include $(CIRCLEHOME)/Rules.mk

INCLUDE += \
-I $(CIRCLE_STDLIB_DIR)/include \
-I $(NEWLIBDIR)/include
-I $(NEWLIBDIR)/include \
-I $(NET_DIR)

LIBS += \
$(NEWLIBDIR)/lib/libm.a \
Expand All @@ -28,6 +29,11 @@ LIBS += \
$(CIRCLEHOME)/addon/fatfs/libfatfs.a \
$(CIRCLEHOME)/lib/fs/libfs.a \
$(CIRCLEHOME)/lib/sched/libsched.a \
$(CIRCLEHOME)/lib/libcircle.a
$(CIRCLEHOME)/lib/libcircle.a \
$(CIRCLEHOME)/addon/wlan/hostap/wpa_supplicant/libwpa_supplicant.a \
$(CIRCLEHOME)/addon/wlan/libwlan.a \
$(CIRCLEHOME)/lib/net/libnet.a

EXTRACLEAN += $(NET_DIR)/*.d $(NET_DIR)/*.o

-include $(DEPS)
1 change: 1 addition & 0 deletions src/circle_stdlib_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class CStdlibAppStdio: public CStdlibAppScreen
CEMMCDevice mEMMC;
FATFS mFileSystem;
CConsole mConsole;
CScheduler mScheduler;
};

/**
Expand Down
62 changes: 62 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,22 @@ void CConfig::Load (void)
m_bProfileEnabled = m_Properties.GetNumber ("ProfileEnabled", 0) != 0;
m_bPerformanceSelectToLoad = m_Properties.GetNumber ("PerformanceSelectToLoad", 1) != 0;
m_bPerformanceSelectChannel = m_Properties.GetNumber ("PerformanceSelectChannel", 0);

// Network
m_bNetworkEnabled = m_Properties.GetNumber ("NetworkEnabled", 0) != 0;
m_bNetworkDHCP = m_Properties.GetNumber ("NetworkDHCP", 0) != 0;
m_NetworkType = m_Properties.GetString ("NetworkType", "wifi");
m_NetworkHostname = m_Properties.GetString ("NetworkHostname", "MiniDexed");
m_INetworkIPAddress = m_Properties.GetIPAddress("NetworkIPAddress") != 0;
m_INetworkSubnetMask = m_Properties.GetIPAddress("NetworkSubnetMask") != 0;
m_INetworkDefaultGateway = m_Properties.GetIPAddress("NetworkDefaultGateway") != 0;
m_INetworkDNSServer = m_Properties.GetIPAddress("NetworkDNSServer") != 0;

const u8 *pSyslogServerIP = m_Properties.GetIPAddress ("NetworkSyslogServerIPAddress");
if (pSyslogServerIP)
{
m_INetworkSyslogServerIPAddress.Set (pSyslogServerIP);
}
}

unsigned CConfig::GetToneGenerators (void) const
Expand Down Expand Up @@ -847,3 +863,49 @@ unsigned CConfig::GetPerformanceSelectChannel (void) const
{
return m_bPerformanceSelectChannel;
}

// Network
bool CConfig::GetNetworkEnabled (void) const
{
return m_bNetworkEnabled;
}

bool CConfig::GetNetworkDHCP (void) const
{
return m_bNetworkDHCP;
}

const char *CConfig::GetNetworkType (void) const
{
return m_NetworkType.c_str();
}

const char *CConfig::GetNetworkHostname (void) const
{
return m_NetworkHostname.c_str();
}

CIPAddress CConfig::GetNetworkIPAddress (void) const
{
return m_INetworkIPAddress;
}

CIPAddress CConfig::GetNetworkSubnetMask (void) const
{
return m_INetworkSubnetMask;
}

CIPAddress CConfig::GetNetworkDefaultGateway (void) const
{
return m_INetworkDefaultGateway;
}

CIPAddress CConfig::GetNetworkDNSServer (void) const
{
return m_INetworkDNSServer;
}

CIPAddress CConfig::GetNetworkSyslogServerIPAddress (void) const
{
return m_INetworkSyslogServerIPAddress;
}
23 changes: 23 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#ifndef _config_h
#define _config_h

#include <circle/net/ipaddress.h>
#include <fatfs/ff.h>
#include <Properties/propertiesfatfsfile.h>
#include <circle/sysconfig.h>
Expand Down Expand Up @@ -270,6 +271,17 @@ class CConfig // Configuration for MiniDexed
bool GetPerformanceSelectToLoad (void) const;
unsigned GetPerformanceSelectChannel (void) const;

// Network
bool GetNetworkEnabled (void) const;
const char *GetNetworkType (void) const;
bool GetNetworkDHCP (void) const;
const char *GetNetworkHostname (void) const;
CIPAddress GetNetworkIPAddress (void) const;
CIPAddress GetNetworkSubnetMask (void) const;
CIPAddress GetNetworkDefaultGateway (void) const;
CIPAddress GetNetworkDNSServer (void) const;
CIPAddress GetNetworkSyslogServerIPAddress (void) const;

private:
CPropertiesFatFsFile m_Properties;

Expand Down Expand Up @@ -397,6 +409,17 @@ class CConfig // Configuration for MiniDexed
bool m_bProfileEnabled;
bool m_bPerformanceSelectToLoad;
unsigned m_bPerformanceSelectChannel;

// Network
bool m_bNetworkEnabled;
bool m_bNetworkDHCP;
std::string m_NetworkType;
std::string m_NetworkHostname;
CIPAddress m_INetworkIPAddress;
CIPAddress m_INetworkSubnetMask;
CIPAddress m_INetworkDefaultGateway;
CIPAddress m_INetworkDNSServer;
CIPAddress m_INetworkSyslogServerIPAddress;
};

#endif
5 changes: 4 additions & 1 deletion src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
#include <circle/usb/usbhcidevice.h>
#include "usbminidexedmidigadget.h"

#define NET_DEVICE_TYPE NetDeviceTypeWLAN // or: NetDeviceTypeWLAN

LOGMODULE ("kernel");

CKernel *CKernel::s_pThis = 0;

CKernel::CKernel (void)
: CStdlibAppStdio ("minidexed"),
:
CStdlibAppStdio ("minidexed"),
m_Config (&mFileSystem),
m_GPIOManager (&mInterrupt),
m_I2CMaster (CMachineInfo::Get ()->GetDevice (DeviceI2CMaster), TRUE),
Expand Down
1 change: 1 addition & 0 deletions src/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <circle/i2cmaster.h>
#include <circle/spimaster.h>
#include <circle/usb/usbcontroller.h>
#include <circle/sched/scheduler.h>
#include "config.h"
#include "minidexed.h"

Expand Down
14 changes: 6 additions & 8 deletions src/mididevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
if ( pMessage[0] != MIDI_TIMING_CLOCK
&& pMessage[0] != MIDI_ACTIVE_SENSING)
{
fprintf (stderr, "MIDI%u: %02X\n", nCable, (unsigned) pMessage[0]);
LOGNOTE ("MIDI%u: %02X\n", nCable, (unsigned) pMessage[0]);
}
break;

case 2:
fprintf (stderr, "MIDI%u: %02X %02X\n", nCable,
LOGNOTE ("MIDI%u: %02X %02X\n", nCable,
(unsigned) pMessage[0], (unsigned) pMessage[1]);
break;

case 3:
fprintf (stderr, "MIDI%u: %02X %02X %02X\n", nCable,
LOGNOTE ("MIDI%u: %02X %02X %02X\n", nCable,
(unsigned) pMessage[0], (unsigned) pMessage[1],
(unsigned) pMessage[2]);
break;
Expand All @@ -142,17 +142,17 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
switch(pMessage[0])
{
case MIDI_SYSTEM_EXCLUSIVE_BEGIN:
fprintf(stderr, "MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength));
LOGNOTE("MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength));
for (uint16_t i = 0; i < nLength; i++)
{
if((i % 16) == 0)
fprintf(stderr, "\n%04d:",i);
fprintf(stderr, " 0x%02x",pMessage[i]);
}
fprintf(stderr, "\n");
LOGNOTE("\n");
break;
default:
fprintf(stderr, "MIDI%u: Unhandled MIDI event type %0x02x\n",nCable,pMessage[0]);
LOGNOTE("MIDI%u: Unhandled MIDI event type %0x02x\n",nCable,pMessage[0]);
}
break;
}
Expand Down Expand Up @@ -350,12 +350,10 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
{
break;
}

m_pSynthesizer->keyup (ucP1, nTG);
break;

case MIDI_CHANNEL_AFTERTOUCH:

m_pSynthesizer->setAftertouch (ucP1, nTG);
m_pSynthesizer->ControllersRefresh (nTG);
break;
Expand Down
Loading

0 comments on commit cc419ce

Please sign in to comment.