[PATCH 2/2] Cochran: RBstream pagesize is smaller and device specific

John Van Ostrand john at vanostrand.com
Fri Jul 14 16:50:57 PDT 2017


Progress bar was taking 18 seconds between updates on a Cmdr-II
when using a 128K pagesize. Since devices differ in their baud
rates it makes sense to use smaller pages on slower devices.
This change reduces it to 32K on Cmdr-II and to 64K on EMC devices.
---
 src/cochran_commander.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/cochran_commander.c b/src/cochran_commander.c
index a21478d..e517027 100644
--- a/src/cochran_commander.c
+++ b/src/cochran_commander.c
@@ -69,6 +69,7 @@ typedef struct cochran_device_layout_t {
 	unsigned int address_bits;
 	cochran_endian_t endian;
 	unsigned int baudrate;
+	unsigned int rbstream_size;
 	// Config data.
 	unsigned int cf_dive_count;
 	unsigned int cf_last_log;
@@ -121,6 +122,7 @@ static const cochran_device_layout_t cochran_cmdr_1_device_layout = {
 	24,         // address_bits
 	ENDIAN_WORD_BE,  // endian
 	115200,     // baudrate
+	32768,		// rbstream_size
 	0x046,      // cf_dive_count
 	0x6c,       // cf_last_log
 	0x70,       // cf_last_interdive
@@ -145,6 +147,7 @@ static const cochran_device_layout_t cochran_cmdr_device_layout = {
 	24,         // address_bits
 	ENDIAN_WORD_BE,  // endian
 	115200,     // baudrate
+	32768,		// rbstream_size
 	0x046,      // cf_dive_count
 	0x06C,      // cf_last_log
 	0x070,      // cf_last_interdive
@@ -168,6 +171,7 @@ static const cochran_device_layout_t cochran_emc14_device_layout = {
 	32,         // address_bits
 	ENDIAN_LE,  // endian
 	806400,     // baudrate
+	65536,		// rbstream_size
 	0x0D2,      // cf_dive_count
 	0x13E,      // cf_last_log
 	0x142,      // cf_last_interdive
@@ -191,6 +195,7 @@ static const cochran_device_layout_t cochran_emc16_device_layout = {
 	32,         // address_bits
 	ENDIAN_LE,  // endian
 	806400,     // baudrate
+	65536,		// rbstream_size
 	0x0D2,      // cf_dive_count
 	0x13E,      // cf_last_log
 	0x142,      // cf_last_interdive
@@ -214,6 +219,7 @@ static const cochran_device_layout_t cochran_emc20_device_layout = {
 	32,         // address_bits
 	ENDIAN_LE,  // endian
 	806400,     // baudrate
+	65536,		// rbstream_size
 	0x0D2,      // cf_dive_count
 	0x13E,      // cf_last_log
 	0x142,      // cf_last_interdive
@@ -934,7 +940,7 @@ cochran_commander_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
 
 	// Create rbstream
 	unsigned int last_start_address = array_uint32_le( data.logbook + ((head_dive - 1) * layout->rb_logbook_entry_size) + layout->pt_profile_end );
-	rc = dc_rbstream_new (&rbstream, abstract, 1, 131072, layout->rb_profile_begin, layout->rb_profile_end, last_start_address );
+	rc = dc_rbstream_new (&rbstream, abstract, 1, layout->rbstream_size, layout->rb_profile_begin, layout->rb_profile_end, last_start_address );
 
 	int invalid_profile_flag = 0;
 
-- 
2.4.11



More information about the devel mailing list