From 59dd6a2a564882b078e848c2e53d1fe547a6b69a Mon Sep 17 00:00:00 2001 From: Greg McLaughlin Date: Mon, 31 Oct 2022 22:40:06 +0100 Subject: [PATCH] Increase the memory size for the Aqualung i770R The Aqualung i770R appears to have 6M instead of 4M (high) memory. Confirmed by trying to read past the 6M limit, which fails with a NAK response. This amount also matches with the capacity stated in the manual (6553 hours of profile data at a 60 second sample rate). --- src/oceanic_atom2.c | 4 ++-- src/oceanic_common.c | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index 88efbc3..f8699ea 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -365,7 +365,7 @@ static const oceanic_common_layout_t oceanic_proplusx_layout = { }; static const oceanic_common_layout_t aqualung_i770r_layout = { - 0x440000, /* memsize */ + 0x640000, /* memsize */ 0x40000, /* highmem */ 0x0000, /* cf_devinfo */ 0x0040, /* cf_pointers */ @@ -373,7 +373,7 @@ static const oceanic_common_layout_t aqualung_i770r_layout = { 0x10000, /* rb_logbook_end */ 16, /* rb_logbook_entry_size */ 0x40000, /* rb_profile_begin */ - 0x440000, /* rb_profile_end */ + 0x640000, /* rb_profile_end */ 0, /* pt_mode_global */ 1, /* pt_mode_logbook */ 0, /* pt_mode_serial */ diff --git a/src/oceanic_common.c b/src/oceanic_common.c index c33655b..f876d28 100644 --- a/src/oceanic_common.c +++ b/src/oceanic_common.c @@ -56,8 +56,9 @@ get_profile_first (const unsigned char data[], const oceanic_common_layout_t *la } unsigned int npages = (layout->memsize - layout->highmem) / pagesize; - - if (npages > 0x2000) { + if (npages > 0x4000) { + value &= 0x7FFF; + } else if (npages > 0x2000) { value &= 0x3FFF; } else if (npages > 0x1000) { value &= 0x1FFF; @@ -86,7 +87,9 @@ get_profile_last (const unsigned char data[], const oceanic_common_layout_t *lay unsigned int npages = (layout->memsize - layout->highmem) / pagesize; - if (npages > 0x2000) { + if (npages > 0x4000) { + value &= 0x7FFF; + } else if (npages > 0x2000) { value &= 0x3FFF; } else if (npages > 0x1000) { value &= 0x1FFF;