latest bullshit

trunk
alexis 2022-10-26 19:32:57 -05:00
parent fb3f597a1b
commit f0d2c1e61b
4 changed files with 16 additions and 11 deletions

View File

@ -22,12 +22,17 @@ void board_pins_init()
PORTA.PINCONFIG = PORT_ISC_INPUT_DISABLE_gc; // Mirrored to all PORTx
PORTA.PINCTRLUPD = 0xFF;
PORTB.PINCTRLUPD = 0xFF;
PORTB.PINCTRLUPD = 0; // This is PORT_ADDR
PORTC.PINCTRLUPD = 0xFF;
PORTD.PINCTRLUPD = 0xFF;
PORTE.PINCTRLUPD = 0xFF;
PORTF.PINCTRLUPD = 0xFF;
PORTG.PINCTRLUPD = 0xFF;
PINCTRL_FOR(PIN_GATE_IN) = 0;
PINCTRL_FOR(PIN_INTMIDI_RX) = 0;
PINCTRL_FOR(PIN_USBMIDI_RX) = 0;
PINCTRL_FOR(PIN_MIDI_RX) = 0;
PIN_DRIVE_TO(PIN_DEBUG0, 0);
PIN_DRIVE_TO(PIN_DEBUG1, 0);
PIN_DRIVE_TO(PIN_DEBUG2, 0);
@ -46,6 +51,7 @@ void board_pins_init()
PIN_DRIVE_TO(PIN_COPI, 0);
PIN_DRIVE_TO(PIN_SCK, 0);
PINCTRL_FOR(PIN_CIPO) = PORT_PULLUPEN_bm;
PINCTRL_FOR(PIN_SD_CIPO) = PORT_PULLUPEN_bm;
// Set the alternates and inversions (we invert usbmidi.rx to allow
// detection of cable disconnects - because the opto is ON by default,

View File

@ -46,10 +46,8 @@ int main(void)
if (cmd == MIDI_ICMD_SYSEX)
{
PIN_SET(PIN_DEBUG0);
sysex_handle(&m);
m.source->sysex_release_buffer(m.content);
PIN_CLR(PIN_DEBUG0);
}
else
{

View File

@ -16,14 +16,6 @@
void midix::rxc()
{
int c = m_serport.recv();
PIN_SET(PIN_DEBUG2);
PIN_CLR(PIN_DEBUG2);
if (c >= 0)
{
PIN_SET(PIN_DEBUG1);
PIN_CLR(PIN_DEBUG1);
}
if (c < 0)
{

View File

@ -3,6 +3,7 @@
#include "sysex.hpp"
#include "midix.hpp"
#include "stor.hpp"
#include "board.hpp"
extern "C" {
#include "base64.h"
@ -41,7 +42,15 @@ static size_t _convert_message_data(uint8_t * dest, size_t dest_len,
void sysex_handle(struct midi_message const * msg)
{
PIN_SET(PIN_DEBUG0);
size_t len = strlen((char const *) msg->content);
PIN_SET(PIN_DEBUG1);
// XXX
msg->source->send_sysex((const uint8_t *) "Hello");
PIN_SET(PIN_DEBUG2);
PIN_CLR(PIN_DEBUG0 | PIN_DEBUG1 | PIN_DEBUG2);
if (msg->content[0] != MIDI_MANUF_ID)
// Not for us - return