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>
This commit is contained in:
Linus Torvalds 2017-08-20 20:39:52 -07:00 committed by Dirk Hohndel
parent 0bb93c76fd
commit 6554e4f21e

View file

@ -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;