aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2017-08-20 20:39:52 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-08-20 21:03:52 -0700
commit6554e4f21e4deaa6b140ff09e07f629474257308 (patch)
tree5e19e8648787c7df5e78a733d81c6995f540023f
parent0bb93c76fd913be2f7c0fd7dda66ec867a1ca1e1 (diff)
downloadsubsurface-6554e4f21e4deaa6b140ff09e07f629474257308.tar.gz
Update the OSTC dive computer configuration to use the generic 'timesync' interface
Jef made the OSTC interface be a generic 'dc_device_timesync()' and so the old OSTC-specific code doesn't exist any more. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--core/configuredivecomputerthreads.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/core/configuredivecomputerthreads.cpp b/core/configuredivecomputerthreads.cpp
index 9499332d7..5ef7e5eb9 100644
--- a/core/configuredivecomputerthreads.cpp
+++ b/core/configuredivecomputerthreads.cpp
@@ -85,7 +85,6 @@
// Fake io to ostc memory banks
#define hw_ostc_device_eeprom_read local_hw_ostc_device_eeprom_read
#define hw_ostc_device_eeprom_write local_hw_ostc_device_eeprom_write
-#define hw_ostc_device_clock local_hw_ostc_device_clock
#define OSTC_FILE "../OSTC-data-dump.bin"
// Fake the open function.
@@ -125,10 +124,6 @@ static dc_status_t local_hw_ostc_device_eeprom_write(void *ignored, unsigned cha
return DC_STATUS_SUCCESS;
}
-static dc_status_t local_hw_ostc_device_clock(void *ignored, dc_datetime_t *time)
-{
- return DC_STATUS_SUCCESS;
-}
#endif
static int read_ostc_cf(unsigned char data[], unsigned char cf)
@@ -892,7 +887,7 @@ static dc_status_t write_ostc4_settings(dc_device_t *device, DeviceDetails *m_de
dc_datetime_t now;
dc_datetime_localtime(&now, dc_datetime_now());
- rc = hw_ostc3_device_clock(device, &now);
+ rc = dc_device_timesync(device, &now);
}
EMIT_PROGRESS();
@@ -1435,7 +1430,7 @@ static dc_status_t write_ostc3_settings(dc_device_t *device, DeviceDetails *m_de
dc_datetime_t now;
dc_datetime_localtime(&now, dc_datetime_now());
- rc = hw_ostc3_device_clock(device, &now);
+ rc = dc_device_timesync(device, &now);
}
EMIT_PROGRESS();
@@ -2079,14 +2074,15 @@ static dc_status_t write_ostc_settings(dc_device_t *device, DeviceDetails *m_dev
//sync date and time
if (m_deviceDetails->syncTime) {
QDateTime timeToSet = QDateTime::currentDateTime();
- dc_datetime_t time;
+ dc_datetime_t time = { 0 };
time.year = timeToSet.date().year();
time.month = timeToSet.date().month();
time.day = timeToSet.date().day();
time.hour = timeToSet.time().hour();
time.minute = timeToSet.time().minute();
time.second = timeToSet.time().second();
- rc = hw_ostc_device_clock(device, &time);
+ time.timezone == DC_TIMEZONE_NONE;
+ rc = dc_device_timesync(device, &time);
}
EMIT_PROGRESS();
return rc;