From 85fd0c524fa100af9022b1c082c1fd48fe19ee71 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 6 Sep 2013 22:24:47 +0200 Subject: [PATCH] Fix the memory layout descriptors. The profile ringbuffer appears to be slightly smaller than expected for some models. For the Mares Matrix (and all compatible devices) it ends earlier, while for the Icon HD Net Ready it starts later. This bug resulted in missing dives, because all remaining dives were getting dropped once a dive that crossed the ringbuffer boundary was reached. --- src/mares_iconhd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mares_iconhd.c b/src/mares_iconhd.c index 0189d32..5e09ea3 100644 --- a/src/mares_iconhd.c +++ b/src/mares_iconhd.c @@ -90,10 +90,16 @@ static const mares_iconhd_layout_t mares_iconhd_layout = { 0x100000, /* rb_profile_end */ }; +static const mares_iconhd_layout_t mares_iconhdnet_layout = { + 0x100000, /* memsize */ + 0x00E000, /* rb_profile_begin */ + 0x100000, /* rb_profile_end */ +}; + static const mares_iconhd_layout_t mares_matrix_layout = { 0x40000, /* memsize */ 0x0A000, /* rb_profile_begin */ - 0x40000, /* rb_profile_end */ + 0x3E000, /* rb_profile_end */ }; static unsigned int @@ -268,6 +274,9 @@ mares_iconhd_device_open (dc_device_t **out, dc_context_t *context, const char * if (model == NEMOWIDE2 || model == MATRIX || model == PUCKPRO || model == PUCK2) { device->layout = &mares_matrix_layout; device->packetsize = 64; + } else if (model == ICONHDNET) { + device->layout = &mares_iconhdnet_layout; + device->packetsize = 0; } else { device->layout = &mares_iconhd_layout; device->packetsize = 0;