Skip to content

Commit

Permalink
synth commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Netzpfuscher committed Jul 16, 2019
1 parent be732fd commit d66c40e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion UD31.cywrk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--This file is machine generated and read. It is not intended to be edited by hand.-->
<!--Due to this, there is no schema for this file.-->
<CyGuid_2867d519-54d2-4c01-9830-c51cb08bc3dd type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtWorkspaceSerialize" version="5" xml_contents_version="3" name="UD31" persistent="UD31.cywrk" platform="NOT_USED">
<current_project name=".\UD3_TQFP.cydsn\UD3_TQFP.cyprj" />
<current_project name=".\UD3_QFN.cydsn\UD3_QFN.cyprj" />
<wrkspc_folders />
<files />
<projects>
Expand Down
7 changes: 7 additions & 0 deletions common/min/min_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
26 changes: 26 additions & 0 deletions common/ud3core/tasks/tsk_min.c
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -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;


}
Expand Down

0 comments on commit d66c40e

Please sign in to comment.