summaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2016-01-22 14:17:50 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-26 09:21:07 +0100
commit7ae578ae6a9b588009a8b1e90db484531c6690a9 (patch)
treee84c8ef33ed2345e8dc2a1200d4a98d6ef40d23c /configuredivecomputerthreads.cpp
parentc13da59ecc257ac71092605d7e959e6cbc73e301 (diff)
downloadsubsurface-7ae578ae6a9b588009a8b1e90db484531c6690a9.tar.gz
configure OSTC/OSTC3: Add safety stop parameters
This adds the configure parameters for safety stops on the hwOS(OSTC3) and OSTC computers. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'configuredivecomputerthreads.cpp')
-rw-r--r--configuredivecomputerthreads.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 7c5c7b9d5..53a8aa7f1 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -53,6 +53,10 @@
#define OSTC3_GRAPHICAL_SPEED_INDICATOR 0x40
#define OSTC3_ALWAYS_SHOW_PPO2 0x41
#define OSTC3_TEMP_SENSOR_OFFSET 0x42
+#define OSTC3_SAFETY_STOP_LENGTH 0x43
+#define OSTC3_SAFETY_STOP_START_DEPTH 0x44
+#define OSTC3_SAFETY_STOP_END_DEPTH 0x45
+#define OSTC3_SAFETY_STOP_RESET_DEPTH 0x46
#define OSTC3_HW_OSTC_3 0x0A
#define OSTC3_HW_OSTC_3P 0x1A
@@ -407,7 +411,7 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
dc_status_t rc;
dc_event_progress_t progress;
progress.current = 0;
- progress.maximum = 53;
+ progress.maximum = 57;
unsigned char hardware[1];
//Read hardware type
@@ -650,6 +654,10 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
READ_SETTING(OSTC3_DYNAMIC_ASCEND_RATE, dynamicAscendRate);
READ_SETTING(OSTC3_GRAPHICAL_SPEED_INDICATOR, graphicalSpeedIndicator);
READ_SETTING(OSTC3_ALWAYS_SHOW_PPO2, alwaysShowppO2);
+ READ_SETTING(OSTC3_SAFETY_STOP_LENGTH, safetyStopLength);
+ READ_SETTING(OSTC3_SAFETY_STOP_START_DEPTH, safetyStopStartDepth);
+ READ_SETTING(OSTC3_SAFETY_STOP_END_DEPTH, safetyStopEndDepth);
+ READ_SETTING(OSTC3_SAFETY_STOP_RESET_DEPTH, safetyStopResetDepth);
#undef READ_SETTING
@@ -913,6 +921,11 @@ static dc_status_t write_ostc3_settings(dc_device_t *device, DeviceDetails *m_de
WRITE_SETTING(OSTC3_DYNAMIC_ASCEND_RATE, dynamicAscendRate);
WRITE_SETTING(OSTC3_GRAPHICAL_SPEED_INDICATOR, graphicalSpeedIndicator);
WRITE_SETTING(OSTC3_ALWAYS_SHOW_PPO2, alwaysShowppO2);
+ WRITE_SETTING(OSTC3_TEMP_SENSOR_OFFSET, tempSensorOffset);
+ WRITE_SETTING(OSTC3_SAFETY_STOP_LENGTH, safetyStopLength);
+ WRITE_SETTING(OSTC3_SAFETY_STOP_START_DEPTH, safetyStopStartDepth);
+ WRITE_SETTING(OSTC3_SAFETY_STOP_END_DEPTH, safetyStopEndDepth);
+ WRITE_SETTING(OSTC3_SAFETY_STOP_RESET_DEPTH, safetyStopResetDepth);
#undef WRITE_SETTING
@@ -1256,6 +1269,16 @@ static dc_status_t read_ostc_settings(dc_device_t *device, DeviceDetails *m_devi
m_deviceDetails->aGFHigh = read_ostc_cf(data, 68);
// CF69: Allow Gradient Factor change
m_deviceDetails->aGFSelectable = read_ostc_cf(data, 69);
+ // CF70: Safety Stop Duration [s]
+ m_deviceDetails->safetyStopLength = read_ostc_cf(data, 70);
+ // CF71: Safety Stop Start Depth [m]
+ m_deviceDetails->safetyStopStartDepth = read_ostc_cf(data, 71);
+ // CF72: Safety Stop End Depth [m]
+ m_deviceDetails->safetyStopEndDepth = read_ostc_cf(data, 72);
+ // CF73: Safety Stop Reset Depth [m]
+ m_deviceDetails->safetyStopResetDepth = read_ostc_cf(data, 73);
+ // CF74: Battery Timeout [min]
+
#ifdef DEBUG_OSTC_CF
for (int cf = 64; cf <= 95 && cf <= max_CF; cf++)
printf("CF %d: %d\n", cf, read_ostc_cf(data, cf));
@@ -1557,6 +1580,16 @@ static dc_status_t write_ostc_settings(dc_device_t *device, DeviceDetails *m_dev
write_ostc_cf(data, 68, max_CF, m_deviceDetails->aGFHigh);
// CF69: Allow Gradient Factor change
write_ostc_cf(data, 69, max_CF, m_deviceDetails->aGFSelectable);
+ // CF70: Safety Stop Duration [s]
+ write_ostc_cf(data, 70, max_CF, m_deviceDetails->safetyStopLength);
+ // CF71: Safety Stop Start Depth [m]
+ write_ostc_cf(data, 71, max_CF, m_deviceDetails->safetyStopStartDepth);
+ // CF72: Safety Stop End Depth [m]
+ write_ostc_cf(data, 72, max_CF, m_deviceDetails->safetyStopEndDepth);
+ // CF73: Safety Stop Reset Depth [m]
+ write_ostc_cf(data, 73, max_CF, m_deviceDetails->safetyStopResetDepth);
+ // CF74: Battery Timeout [min]
+
#ifdef DEBUG_OSTC_CF
for (int cf = 64; cf <= 95 && cf <= max_CF; cf++)
printf("CF %d: %d\n", cf, read_ostc_cf(data, cf));