Show program name on optional HD44780 display

Close #21
Thanks @rsta2
pull/31/head
probonopd 3 years ago committed by GitHub
parent 41f95023e6
commit b871fa1798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      build.sh
  2. 1
      src/Rules.mk
  3. 16
      src/minidexed.cpp
  4. 21
      src/minidexed.h

@ -20,12 +20,19 @@ make mrproper || true
./configure -r ${RPI} --prefix "${TOOLCHAIN_PREFIX}"
echo "DEFINE += -DSAVE_VFP_REGS_ON_IRQ" >> libs/circle/Config.mk
echo "DEFINE += -DREALTIME" >> libs/circle/Config.mk
make -j$(nproc)
make -j
# Build additional libraries
cd libs/circle/addon/display/
make clean || true
make -j
cd ../../../..
cd ..
# Build MiniDexed
cd src
make clean || true
make -j$(nproc)
make -j
ls *.img
cd ..

@ -17,6 +17,7 @@ LIBS += \
$(NEWLIBDIR)/lib/libm.a \
$(NEWLIBDIR)/lib/libc.a \
$(NEWLIBDIR)/lib/libcirclenewlib.a \
$(CIRCLEHOME)/addon/display/libdisplay.a \
$(CIRCLEHOME)/addon/SDCard/libsdcard.a \
$(CIRCLEHOME)/lib/usb/libusb.a \
$(CIRCLEHOME)/lib/input/libinput.a \

@ -35,6 +35,12 @@ bool CMiniDexed::Initialize (void)
return false;
}
if (!m_LCD.Initialize ())
{
return FALSE;
}
m_bUseSerial = true;
activate();
@ -178,6 +184,11 @@ void CMiniDexed::MIDIPacketHandler (unsigned nCable, u8 *pPacket, unsigned nLeng
memset(buf_name, 0, 11); // Initialize with 0x00 chars
s_pThis->setName(buf_name);
printf ("%s\n", buf_name);
// Print to optional HD44780 display
s_pThis->LCDWrite("\x1B[?25l"); // cursor off
CString String;
String.Format ("\n\r%i\n\r%s", pPacket[1], buf_name);
s_pThis->LCDWrite ((const char *) String);
return;
}
@ -338,3 +349,8 @@ unsigned CMiniDexedHDMI::GetChunk(u32 *pBuffer, unsigned nChunkSize)
return(nResult);
};
void CMiniDexed::LCDWrite (const char *pString)
{
m_LCD.Write (pString, strlen (pString));
}

@ -17,6 +17,7 @@
#include <circle/hdmisoundbasedevice.h>
#include "sysexfileloader.h"
#include "pckeyboard.h"
#include <display/hd44780device.h>
#define SAMPLE_RATE 48000
@ -25,6 +26,18 @@
#define DAC_I2C_ADDRESS 0 // I2C slave address of the DAC (0 for auto probing)
// HD44780 LCD configuration
#define COLUMNS 16
#define ROWS 2
// GPIO pins (Brcm numbering)
#define EN_PIN 17 // Enable
#define RS_PIN 18 // Register Select
#define RW_PIN 19 // Read/Write (set to 0 if not connected)
#define D4_PIN 22 // Data 4
#define D5_PIN 23 // Data 5
#define D6_PIN 24 // Data 6
#define D7_PIN 25 // Data 7
class CMiniDexed : public Dexed
{
public:
@ -34,14 +47,18 @@ class CMiniDexed : public Dexed
m_PCKeyboard (this),
m_Serial (pInterrupt, TRUE),
m_bUseSerial (FALSE),
m_nSerialState (0)
m_nSerialState (0),
m_LCD (COLUMNS, ROWS, D4_PIN, D5_PIN, D6_PIN, D7_PIN, EN_PIN, RS_PIN, RW_PIN)
{
s_pThis = this;
};
virtual bool Initialize (void);
void Process(boolean bPlugAndPlayUpdated);
private:
void LCDWrite (const char *pString);
private:
CHD44780Device m_LCD;
protected:
static void MIDIPacketHandler (unsigned nCable, u8 *pPacket, unsigned nLength);
static void KeyStatusHandlerRaw (unsigned char ucModifiers, const unsigned char RawKeys[6]);

Loading…
Cancel
Save