From b2480b511cec06cdbfcc568347e24cf7b5e75daf Mon Sep 17 00:00:00 2001 From: mpeex Date: Sun, 19 Jan 2025 15:08:42 +0100 Subject: [PATCH] updated for XT1 latest firmware 5.52 --- indi-gphoto/gphoto_driver.cpp | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/indi-gphoto/gphoto_driver.cpp b/indi-gphoto/gphoto_driver.cpp index 3fb599268..e64eebe5f 100644 --- a/indi-gphoto/gphoto_driver.cpp +++ b/indi-gphoto/gphoto_driver.cpp @@ -627,26 +627,13 @@ static void *stop_bulb(void *arg) DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing DSUSB shutter."); gphoto->dsusb->closeShutter(); } - if (gphoto->bulb_widget) - { - DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing internal shutter."); - DEBUGFDEVICE(device, INDI::Logger::DBG_DEBUG, "Using widget:%s", gphoto->bulb_widget->name); - if (strcmp(gphoto->bulb_widget->name, "eosremoterelease") == 0) - { - //600D eosremoterelease RELEASE FULL - gphoto_set_widget_num(gphoto, gphoto->bulb_widget, EOS_RELEASE_FULL); - } - else - { - gphoto_set_widget_num(gphoto, gphoto->bulb_widget, FALSE); - } - } + if (gphoto->bulb_port[0] && (gphoto->bulb_fd >= 0)) { - DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing remote serial shutter."); + DEBUGFDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing remote serial shutter (%s)",gphoto->bulb_port); // Close Nikon Shutter - if (!strstr(device, "Nikon")) + if (strstr(device, "Nikon")) { uint8_t close_shutter[3] = {0xFF, 0x01, 0x00}; if (write(gphoto->bulb_fd, close_shutter, 3) != 3) @@ -656,6 +643,20 @@ static void *stop_bulb(void *arg) ioctl(gphoto->bulb_fd, TIOCMBIC, &RTS_flag); close(gphoto->bulb_fd); } + else if (gphoto->bulb_widget) + { + DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing internal shutter."); + DEBUGFDEVICE(device, INDI::Logger::DBG_DEBUG, "Using widget:%s", gphoto->bulb_widget->name); + if (strcmp(gphoto->bulb_widget->name, "eosremoterelease") == 0) + { + //600D eosremoterelease RELEASE FULL + gphoto_set_widget_num(gphoto, gphoto->bulb_widget, EOS_RELEASE_FULL); + } + else + { + gphoto_set_widget_num(gphoto, gphoto->bulb_widget, FALSE); + } + } gphoto->command |= DSLR_CMD_DONE; pthread_cond_signal(&gphoto->signal); } @@ -1221,7 +1222,7 @@ int gphoto_start_exposure(gphoto_driver *gphoto, uint32_t exptime_usec, int mirr } // Open Nikon Shutter - if (!strstr(device, "Nikon")) + if (strstr(device, "Nikon")) { uint8_t open_shutter[3] = {0xFF, 0x01, 0x01}; if (write(gphoto->bulb_fd, open_shutter, 3) != 3) @@ -1418,10 +1419,12 @@ int gphoto_read_exposure_fd(gphoto_driver *gphoto, int fd) return GP_OK; case GP_EVENT_FILE_ADDED: + if (downloadComplete) break; DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "File added event completed."); fn = static_cast(data); if (gphoto->handle_sdcard_image != IGNORE_IMAGE) download_image(gphoto, fn, fd); + downloadComplete = true; // Wait 1 second for GP_EVENT_CAPTURE_COMPLETE // If that times out, we already marked downloadComplete as true so we will exist gracefully.