From d66c40e98331eead29a4f3dc3aa60aab85e51e90 Mon Sep 17 00:00:00 2001 From: Jens Kerrinnes Date: Tue, 16 Jul 2019 19:46:13 +0200 Subject: [PATCH] synth commands --- UD31.cywrk | 2 +- common/min/min_id.h | 7 +++++++ common/ud3core/tasks/tsk_min.c | 26 ++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/UD31.cywrk b/UD31.cywrk index 1e3baf1..b5c3e34 100644 --- a/UD31.cywrk +++ b/UD31.cywrk @@ -3,7 +3,7 @@ - + diff --git a/common/min/min_id.h b/common/min/min_id.h index 0ab6865..1690788 100644 --- a/common/min/min_id.h +++ b/common/min/min_id.h @@ -7,6 +7,7 @@ #define MIN_ID_RESET 11 #define MIN_ID_COMMAND 12 #define MIN_ID_SOCKET 13 +#define MIN_ID_SYNTH 14 #define COMMAND_IP 1 #define COMMAND_GW 2 @@ -17,6 +18,12 @@ #define COMMAND_ETH_STATE 7 #define COMMAND_GET_CONFIG 8 +#define SYNTH_CMD_FLUSH 1 +#define SYNTH_CMD_SID 2 +#define SYNTH_CMD_MIDI 3 +#define SYNTH_CMD_OFF 4 + + #define SOCKET_DISCONNECTED 0 #define SOCKET_CONNECTED 1 diff --git a/common/ud3core/tasks/tsk_min.c b/common/ud3core/tasks/tsk_min.c index b2ac40e..109fba0 100644 --- a/common/ud3core/tasks/tsk_min.c +++ b/common/ud3core/tasks/tsk_min.c @@ -160,6 +160,29 @@ void process_command(uint8_t *min_payload, uint8_t len_payload){ } } +void process_synth(uint8_t *min_payload, uint8_t len_payload){ + len_payload--; + switch(*min_payload++){ + case SYNTH_CMD_FLUSH: + if(qSID!=NULL){ + xQueueReset(qSID); + } + break; + case SYNTH_CMD_SID: + param.synth=SYNTH_SID; + switch_synth(SYNTH_SID); + break; + case SYNTH_CMD_MIDI: + param.synth=SYNTH_MIDI; + switch_synth(SYNTH_MIDI); + break; + case SYNTH_CMD_OFF: + param.synth=SYNTH_OFF; + switch_synth(SYNTH_OFF); + break; + } +} + void min_application_handler(uint8_t min_id, uint8_t *min_payload, uint8_t len_payload, uint8_t port) { if(min_id<10){ @@ -201,6 +224,9 @@ void min_application_handler(uint8_t min_id, uint8_t *min_payload, uint8_t len_p case MIN_ID_COMMAND: process_command(min_payload,len_payload); break; + case MIN_ID_SYNTH: + process_synth(min_payload,len_payload); + break; }