From 0ebe778aab2114ed2ad50d2bc03a679b0b1f48b8 Mon Sep 17 00:00:00 2001 From: c vw Date: Wed, 26 Jan 2022 11:55:52 +0100 Subject: [PATCH] Small cosmetic changes as preparation for next merge step. --- actions.c | 16 ++++++++-------- gpio.c | 5 +++-- i2c.c | 45 +++++++++++++++++++++++++++------------------ sliders.c | 6 ++++-- 4 files changed, 42 insertions(+), 30 deletions(-) diff --git a/actions.c b/actions.c index f7af4ee..5a95acd 100644 --- a/actions.c +++ b/actions.c @@ -188,9 +188,9 @@ ACTION_TABLE ActionTable[] = { // CW speed (only MIDI) // CW side tone frequency (only MIDI) // - {CW_KEYER_KEYDOWN, "KeyDown\n(keyer)", NULL, MIDI_KEY | CONTROLLER_SWITCH}, - {CW_KEYER_SPEED, "Speed\n(keyer)", NULL, MIDI_KNOB}, - {CW_KEYER_SIDETONE, "ST freq\n(keyer)", NULL, MIDI_KNOB}, + {CW_KEYER_KEYDOWN, "CW Key\n(keyer)", NULL, MIDI_KEY | CONTROLLER_SWITCH}, + {CW_KEYER_SPEED, "CW Speed\n(keyer)", NULL, MIDI_KNOB}, + {CW_KEYER_SIDETONE, "CW pitch\n(keyer)", NULL, MIDI_KNOB}, {ACTIONS, "", NULL, TYPE_NONE} }; @@ -568,7 +568,7 @@ int process_action(void *data) { } break; case CW_FREQUENCY: - value=KnobOrWheel(a, (double)cw_keyer_sidetone_frequency, 400.0, 1000.0, 10.0); + value=KnobOrWheel(a, (double)cw_keyer_sidetone_frequency, 300.0, 1000.0, 10.0); cw_keyer_sidetone_frequency=(int)value; g_idle_add(ext_vfo_update,NULL); break; @@ -1227,8 +1227,8 @@ int process_action(void *data) { // however the range 0-127 is internally converted to 0-100 upstream // cw_keyer_speed=(127*a->val + 50)/100; - if (cw_keyer_speed < 1) cw_keyer_speed=1; - if (cw_keyer_speed > 99) cw_keyer_speed=99; + if (cw_keyer_speed < 1) cw_keyer_speed=1; + if (cw_keyer_speed > 99) cw_keyer_speed=99; g_idle_add(ext_vfo_update,NULL); } break; @@ -1237,9 +1237,9 @@ int process_action(void *data) { if (a->mode==ABSOLUTE) { // // The MIDI keyer encodes the frequency as a value between 0 and 127, - // freq = 250 + 8*val + // freq = 250 + 8*val // however the range 0-127 is internally converted to 0-100 upstream - // + // cw_keyer_sidetone_frequency=250 + (254*a->val + 12)/25; g_idle_add(ext_vfo_update,NULL); } diff --git a/gpio.c b/gpio.c index c4afa7e..2c134e9 100644 --- a/gpio.c +++ b/gpio.c @@ -349,7 +349,7 @@ static void initialiseEpoch() { epochMilli = (uint64_t)ts.tv_sec * (uint64_t)1000 + (uint64_t)(ts.tv_nsec / 1000000L) ; } -static uint32_t millis () { +static unsigned int millis () { uint64_t now ; struct timespec ts ; clock_gettime (CLOCK_MONOTONIC_RAW, &ts) ; @@ -510,7 +510,7 @@ static void process_encoder(int e,int l,int addr,int val) { g_mutex_unlock(&encoder_mutex); } -static void process_edge(int offset, enum ACTION_MODE value) { +static void process_edge(int offset,int value) { gint i; unsigned int t; gboolean found; @@ -552,6 +552,7 @@ static void process_edge(int offset, enum ACTION_MODE value) { found=TRUE; break; } else if(encoders[i].switch_enabled && encoders[i].switch_address==offset) { + //g_print("%s: found %d encoder %d switch\n",__FUNCTION__,offset,i); t=millis(); //g_print("%s: found %d encoder %d switch value=%d t=%u\n",__FUNCTION__,offset,i,value,t); if (tsquelch_enable = (rx->squelch > 0.5); setSquelch(rx); -- 2.45.2