From: Ramakrishnan Muthukrishnan Date: Thu, 1 Dec 2022 14:13:10 +0000 (+0530) Subject: midi cw: paddle reverse control via midi to cw key X-Git-Url: https://git.rkrishnan.org/vdrive/%22file:/listings//%22%22?a=commitdiff_plain;h=39eeebd043efd97a198ef7ac90721d2d33328cea;p=pihpsdr.git midi cw: paddle reverse control via midi to cw key --- diff --git a/midi2.c b/midi2.c index a8967db..68bc74c 100644 --- a/midi2.c +++ b/midi2.c @@ -435,13 +435,17 @@ g_print("%s:TAB:Insert desc=%p in CMDS[%d] table\n",__FUNCTION__,desc,key); void midi_keyer_update(void) { // read the global cw_keyer_speed and send midi commands char wpmctrl[4] = {0xb1, 0, cw_keyer_speed}; // 0xb0, lower nibble is channel number. - + char paddleReverseCtl[4] = {0xb1, 2, cw_keys_reversed}; int status; if (cw_midi_output != NULL) { fprintf(stderr, "MIDI Keyer: setting WPM to %d\n", cw_keyer_speed); if ((status = snd_rawmidi_write(cw_midi_output, wpmctrl, 4)) < 0) { fprintf(stderr, "Problem writing to MIDI output: %s", snd_strerror(status)); } + + if ((status = snd_rawmidi_write(cw_midi_output, paddleReverseCtl, 4)) < 0) { + fprintf(stderr, "Problem writing to MIDI output: %s", snd_strerror(status)); + } } else { fprintf(stderr, "MIDI device is not open yet\n"); }