}
static void cwAlert(int gpio, int level, uint32_t tick) {
+fprintf(stderr,"cwAlert: gpio=%d level=%d internal=%d\n",gpio,level,cw_keyer_internal);
if (cw_keyer_internal == 0)
keyer_event(gpio, cw_active_level == 0 ? level : (level==0));
}
}
#endif
+fprintf(stderr,"GPIO: ENABLE_CW_BUTTONS=%d CWL_BUTTON=%d CWR_BUTTON=%d\n",ENABLE_CW_BUTTONS, CWL_BUTTON, CWR_BUTTON);
if(ENABLE_CW_BUTTONS) {
setup_button(CWL_BUTTON, cwAlert);
setup_button(CWR_BUTTON, cwAlert);
struct timespec loop_delay;
int interval = 1000000; // 1 ms
+fprintf(stderr,"keyer_thread\n");
while(running) {
sem_wait(&cw_event);
+
key_state = CHECK;
while (key_state != EXITLOOP) {
}
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &loop_delay, NULL);
}
+
}
+fprintf(stderr,"keyer_thread: EXIT\n");
}
void keyer_close() {
//stack_prefault();
+/*
if (wiringPiSetup () < 0) {
fprintf(stderr,"pthread_create for keyer_thread failed %d\n", rc);
exit(-1);
}
+*/
+
+ if (SIDETONE_GPIO)
+ softToneCreate(SIDETONE_GPIO);
+ else {
+ beep_init();
+ beep_vol(cw_keyer_sidetone_volume);
+ }
+
+ rc = sem_init(&cw_event, 0, 0);
+ rc |= pthread_create(&keyer_thread_id, NULL, keyer_thread, NULL);
+ running = 1;
+ if(rc < 0) {
+ fprintf(stderr,"pthread_create for keyer_thread failed %d\n", rc);
+ exit(-1);
+ }
return 0;
}
gtk_widget_show(sliders);
}
gtk_widget_show_all(sliders);
+ linein_changed();
y+=SLIDERS_HEIGHT;
} else {
gtk_widget_hide(sliders);
--- /dev/null
+/* Copyright (C)
+* 2015 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <sys/resource.h>
+#include <stdio.h>
+
+void show_memory(char *title) {
+ struct rusage r_usage;
+ getrusage(RUSAGE_SELF,&r_usage);
+ fprintf(stderr, "%s: Memory usage: %ld bytes\n",title,r_usage.ru_maxrss);
+}
--- /dev/null
+/* Copyright (C)
+* 2015 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+extern void show_memory(char *title);
--- /dev/null
+#define MAX_RECEIVERS 2
+
+struct _receiver {
+ int sample_rate;
+ int buffer_size;
+ int band;
+ int bandstack;
+ int mode;
+ int filter;
+ int audio;
+} rx[MAX_RECEIVERS];
+
+
}
void mox_cb(GtkWidget *widget, gpointer data) {
+
+
if(getTune()==1) {
setTune(0);
}
} else {
mox_cb((GtkWidget *)NULL, (gpointer)NULL);
}
- vfo_update(NULL);
+ //vfo_update(NULL);
}
void sim_function_cb(GtkWidget *widget, gpointer data) {
cr = cairo_create (vfo_surface);
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_paint (cr);
+ cairo_destroy(cr);
g_idle_add(vfo_update,NULL);