Skip to content

Commit

Permalink
cdc update
Browse files Browse the repository at this point in the history
  • Loading branch information
tehn committed Jun 3, 2021
1 parent 33cc216 commit bf77640
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ CSRCS = \
../libavr32/src/timers.c \
../libavr32/src/usb.c \
../libavr32/src/util.c \
../libavr32/src/usb/cdc/cdc.c \
../libavr32/src/usb/cdc/uhi_cdc.c \
../libavr32/src/usb/ftdi/ftdi.c \
../libavr32/src/usb/ftdi/uhi_ftdi.c \
../libavr32/src/usb/hid/hid.c \
Expand Down Expand Up @@ -110,6 +112,7 @@ INC_PATH = \
../../src \
../src \
../src/usb \
../src/usb/cdc \
../src/usb/ftdi \
../src/usb/hid \
../src/usb/midi \
Expand Down
9 changes: 8 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "timers.h"
#include "adc.h"
#include "util.h"
#include "cdc.h"
#include "ftdi.h"

// this
Expand Down Expand Up @@ -550,7 +551,7 @@ static void adcTimer_callback(void* o) {
static void monome_poll_timer_callback(void* obj) {
// asynchronous, non-blocking read
// UHC callback spawns appropriate events
ftdi_read();
serial_read();
}

// monome refresh callback
Expand Down Expand Up @@ -588,6 +589,10 @@ static void handler_FtdiDisconnect(s32 data) {
// event_post(&e);
}

static void handler_SerialConnect(s32 data) {
monome_setup_mext();
}

static void handler_MonomeConnect(s32 data) {
u8 i1;
// print_dbg("\r\n// monome connect /////////////////");
Expand Down Expand Up @@ -1943,6 +1948,8 @@ static inline void assign_main_event_handlers(void) {
app_event_handlers[ kEventMonomePoll ] = &handler_MonomePoll ;
app_event_handlers[ kEventMonomeRefresh ] = &handler_MonomeRefresh ;
app_event_handlers[ kEventMonomeGridKey ] = &handler_MonomeGridKey ;
app_event_handlers[ kEventSerialConnect ] = &handler_SerialConnect ;
app_event_handlers[ kEventSerialDisconnect ] = &handler_FtdiDisconnect ;
}

// app event loop
Expand Down

0 comments on commit bf77640

Please sign in to comment.