mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add more OSTC 3 settings
I am adding more OSTC 3 settings as I go along. Here, I have added dive mode and saturation. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
parent
8ccf2e8f1d
commit
5292bcbf21
4 changed files with 95 additions and 20 deletions
|
@ -34,6 +34,14 @@ void ReadSettingsThread::run()
|
|||
|
||||
//Read general settings
|
||||
unsigned char uData[1] = {0};
|
||||
//DiveMode
|
||||
rc = hw_ostc3_device_config_read(m_data->device, 0x20, uData, sizeof(uData));
|
||||
if (rc == DC_STATUS_SUCCESS)
|
||||
m_deviceDetails->setDiveMode(uData[0]);
|
||||
//Saturation
|
||||
rc = hw_ostc3_device_config_read(m_data->device, 0x2A, uData, sizeof(uData));
|
||||
if (rc == DC_STATUS_SUCCESS)
|
||||
m_deviceDetails->setSaturation(uData[0]);
|
||||
//LastDeco
|
||||
rc = hw_ostc3_device_config_read(m_data->device, 0x2D, uData, sizeof(uData));
|
||||
if (rc == DC_STATUS_SUCCESS)
|
||||
|
@ -122,6 +130,14 @@ void WriteSettingsThread::run()
|
|||
hw_ostc3_device_customtext(m_data->device, m_deviceDetails->customText().toUtf8().data());
|
||||
unsigned char data[1] = {0};
|
||||
|
||||
//dive mode
|
||||
data[0] = m_deviceDetails->diveMode();
|
||||
hw_ostc3_device_config_write(m_data->device, 0x20, data, sizeof(data));
|
||||
|
||||
//saturation
|
||||
data[0] = m_deviceDetails->saturation();
|
||||
hw_ostc3_device_config_write(m_data->device, 0x2A, data, sizeof(data));
|
||||
|
||||
//last deco
|
||||
data[0] = m_deviceDetails->lastDeco();
|
||||
hw_ostc3_device_config_write(m_data->device, 0x2C, data, sizeof(data));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue