]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Adapted to new WDSP (Version 1.18) wisdom procedure
authorc vw <dl1ycf@darc.de>
Tue, 21 May 2019 09:57:37 +0000 (11:57 +0200)
committerc vw <dl1ycf@darc.de>
Tue, 21 May 2019 09:57:37 +0000 (11:57 +0200)
Makefile.mac
main.c

index e3e7f5e9f9afbc9152b16b42d47a718dbb565ed8..980dca8c770a33df708e8aa6b63db4462253242f 100644 (file)
@@ -480,7 +480,7 @@ hpsdrsim:       hpsdrsim.o
 #       ATTENTION
 #       =========
 #       Upon starting a freshly built application in an "app" bundle,
-#       it will do the FFT calculations required for wdspWisdom, since
+#       it will do the FFT calculations required for wdsp-Wisdom, since
 #       this is then stored *within* the app bundle.
 #
 #############################################################################
@@ -512,10 +512,10 @@ app:      $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) \
 # Make "app" and copy local files app bundle
 #
 localapp:      app
-       cp wdspWisdom pihpsdr.app/Contents/Resources
-       cp *.props    pihpsdr.app/Contents/Resources
-       cp midi.inp   pihpsdr.app/Contents/Resources
-       cp ip.addr    pihpsdr.app/Contents/Resources
+       cp wdspWisdom00 pihpsdr.app/Contents/Resources
+       cp *.props      pihpsdr.app/Contents/Resources
+       cp midi.inp     pihpsdr.app/Contents/Resources
+       cp ip.addr      pihpsdr.app/Contents/Resources
 
 #############################################################################
 
diff --git a/main.c b/main.c
index 74e8099aff6bc532098ea9ea8d85c8df42868dc4..4265922353af8d3c6cab825c0144418ac85ca045 100644 (file)
--- a/main.c
+++ b/main.c
@@ -99,7 +99,7 @@ static gint save_cb(gpointer data) {
 static pthread_t wisdom_thread_id;
 
 static void* wisdom_thread(void *arg) {
-fprintf(stderr,"Creating wisdom file: %s\n", (char *)arg);
+  fprintf(stderr,"Securing wisdom file in directory: %s\n", (char *)arg);
   status_text("Creating FFTW Wisdom file ...");
   WDSPwisdom ((char *)arg);
 #ifdef __APPLE__
@@ -162,6 +162,7 @@ static int init(void *data) {
   char *res;
   char wisdom_directory[1024];
   char wisdom_file[1024];
+  int rc;
 
   fprintf(stderr,"init\n");
 
@@ -172,30 +173,29 @@ static int init(void *data) {
 
   gdk_window_set_cursor(gtk_widget_get_window(top_window),cursor_watch);
 
-  // check if wisdom file exists
+  //
+  // Let WDSP (via FFTW) check for wisdom file in current dir
+  // If there is one, the "wisdom thread" takes no time
+  // Depending on the WDSP version, the file is wdspWisdom or wdspWisdom00.
+  //
   res=getcwd(wisdom_directory, sizeof(wisdom_directory));
   strcpy(&wisdom_directory[strlen(wisdom_directory)],"/");
   strcpy(wisdom_file,wisdom_directory);
-  strcpy(&wisdom_file[strlen(wisdom_file)],"wdspWisdom");
-  status_text("Checking FFTW Wisdom file ...");
-  if(access(wisdom_file,F_OK)<0) {
 #ifdef __APPLE__
-      int rc;
-      wisdom_sem=sem_open("WISDOM", O_CREAT, 0700, 0);
+  wisdom_sem=sem_open("WISDOM", O_CREAT, 0700, 0);
 #else
-      int rc=sem_init(&wisdom_sem, 0, 0);
+  rc=sem_init(&wisdom_sem, 0, 0);
 #endif
-      rc=pthread_create(&wisdom_thread_id, NULL, wisdom_thread, (void *)wisdom_directory);
+  rc=pthread_create(&wisdom_thread_id, NULL, wisdom_thread, (void *)wisdom_directory);
 #ifdef __APPLE__
-      while(sem_trywait(wisdom_sem)<0) {
+  while(sem_trywait(wisdom_sem)<0) {
 #else
-      while(sem_trywait(&wisdom_sem)<0) {
+  while(sem_trywait(&wisdom_sem)<0) {
 #endif
-        status_text(wisdom_get_status());
-        while (gtk_events_pending ())
-          gtk_main_iteration ();
-        usleep(100000); // 100ms
-      }
+      status_text("WDSP wisdom done.");
+      while (gtk_events_pending ())
+        gtk_main_iteration ();
+      usleep(100000); // 100ms
   }
 
   g_idle_add(ext_discovery,NULL);