aboutsummaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-10-27 21:55:03 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-27 14:41:44 -0700
commit0afc52579b6827497b6a808556ac0c9e1f7c982d (patch)
treebdf89b63db01169c54eb6a5286ea1311160f9bec /configuredivecomputerthreads.cpp
parente2b579881f8157a186d738889e25a352299a3990 (diff)
downloadsubsurface-0afc52579b6827497b6a808556ac0c9e1f7c982d.tar.gz
Debug code for OSTC CF
This code is to debug the rest of the existing CF's, so we can look at the rest of the values. 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.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index e35585e81..7c7c912d4 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -492,7 +492,9 @@ void ReadSettingsThread::run()
case DC_FAMILY_HW_OSTC: {
supported = true;
unsigned char data[256] = {};
+#ifdef DEBUG_OSTC_CF
unsigned char max_CF = 0;
+#endif
rc = hw_ostc_device_eeprom_read(m_data->device, 0, data, sizeof(data));
if (rc == DC_STATUS_SUCCESS) {
m_deviceDetails->setSerialNo(QString::number(data[1] << 8 ^ data[0]));
@@ -641,7 +643,9 @@ void ReadSettingsThread::run()
m_deviceDetails->setDateFormat(data[91]);
// Byte93:
// Total number of CF used in installed firmware
+#ifdef DEBUG_OSTC_CF
max_CF = data[92];
+#endif
// Byte94:
// Last selected view for customview area in surface mode
// Byte95:
@@ -726,6 +730,11 @@ void ReadSettingsThread::run()
m_deviceDetails->setSamplingRate(read_ostc_cf(data, 20));
// CF29: Depth of last decompression stop
m_deviceDetails->setLastDeco(read_ostc_cf(data, 29));
+
+#ifdef DEBUG_OSTC_CF
+ for(int cf = 0; cf <= 31 && cf <= max_CF; cf++)
+ printf("CF %d: %d\n", cf, read_ostc_cf(data, cf));
+#endif
#ifdef DEBUG_OSTC
local_hw_ostc_device_eeprom_write(m_data->device, 0, data, sizeof(data));
#endif
@@ -753,6 +762,10 @@ void ReadSettingsThread::run()
m_deviceDetails->setGfHigh(read_ostc_cf(data, 33));
// CF58: Future time to surface setFutureTTS
m_deviceDetails->setFutureTTS(read_ostc_cf(data, 58));
+#ifdef DEBUG_OSTC_CF
+ for(int cf = 32; cf <= 63 && cf <= max_CF; cf++)
+ printf("CF %d: %d\n", cf, read_ostc_cf(data, cf));
+#endif
#ifdef DEBUG_OSTC
local_hw_ostc_device_eeprom_write(m_data->device, 1, data, sizeof(data));
#endif
@@ -775,6 +788,10 @@ void ReadSettingsThread::run()
m_deviceDetails->setAGFHigh(read_ostc_cf(data, 68));
// CF69: Allow Gradient Factor change
m_deviceDetails->setAGFSelectable(read_ostc_cf(data, 69));
+#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));
+#endif
#ifdef DEBUG_OSTC
local_hw_ostc_device_eeprom_write(m_data->device, 2, data, sizeof(data));
#endif