From 1d3920188ad4461863b9834473cec5bd11724f77 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Mon, 21 Feb 2022 17:48:08 +0530 Subject: [PATCH] fixes to get CW working --- gpio.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gpio.c b/gpio.c index e5afe7e..6bb2132 100644 --- a/gpio.c +++ b/gpio.c @@ -518,7 +518,7 @@ static void process_edge(int offset,int value) { keyer_event(1, CW_ACTIVE_LOW ? (value==PRESSED) : value); found=TRUE; } else if(offset==CWR_BUTTON) { - keyer_event(1, CW_ACTIVE_LOW ? (value==PRESSED) : value); + keyer_event(0, CW_ACTIVE_LOW ? (value==PRESSED) : value); found=TRUE; } } @@ -977,6 +977,20 @@ int gpio_init() { goto err; } + +#ifdef LOCALCW + if(controller == NO_CONTROLLER) { + // radioberry plugged into the RPI + // GPIO is on only for LOCALCW. + // Users do have to choose for no controller; + // for local CW the following pins are set. + CWL_BUTTON=17; + CWR_BUTTON=21; + g_print("LOCALCW is on ; NO controller selected; CW Buttons reconfigured\n"); + } + // Radioberry device driver uses GPIO ports. + if(controller != NO_CONTROLLER) { +#endif // setup encoders g_print("%s: setup encoders\n",__FUNCTION__); for(int i=0;i