From 121c7c12fb4972be652eb81ae76b081a9ac0629d Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 5 Mar 2024 20:06:28 +0100 Subject: [PATCH] Swap values 2 and 3 of the pointer mode Swapping values 2 and 3 of the pointer mode has the advantage that only the mode with the largest value uses bytes as its unit, while all others use the page size as their unit. --- src/oceanic_atom2.c | 4 ++-- src/oceanic_common.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index 0c63e16..5eb60a6 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -101,7 +101,7 @@ static const oceanic_common_layout_t aeris_f10_layout = { 0x0D80, /* rb_profile_begin */ 0x10000, /* rb_profile_end */ 0, /* pt_mode_global */ - 2, /* pt_mode_logbook */ + 3, /* pt_mode_logbook */ 0, /* pt_mode_serial */ }; @@ -116,7 +116,7 @@ static const oceanic_common_layout_t aeris_f11_layout = { 0x0D80, /* rb_profile_begin */ 0x20000, /* rb_profile_end */ 0, /* pt_mode_global */ - 3, /* pt_mode_logbook */ + 2, /* pt_mode_logbook */ 0, /* pt_mode_serial */ }; diff --git a/src/oceanic_common.c b/src/oceanic_common.c index e79406a..f09e629 100644 --- a/src/oceanic_common.c +++ b/src/oceanic_common.c @@ -49,7 +49,7 @@ get_profile_first (const unsigned char data[], const oceanic_common_layout_t *la value = array_uint16_le (data + 5); } else if (layout->pt_mode_logbook == 1) { value = array_uint16_le (data + 4); - } else if (layout->pt_mode_logbook == 3) { + } else if (layout->pt_mode_logbook == 2) { value = array_uint16_le (data + 16); } else { return array_uint16_le (data + 16); @@ -79,7 +79,7 @@ get_profile_last (const unsigned char data[], const oceanic_common_layout_t *lay value = array_uint16_le (data + 6) >> 4; } else if (layout->pt_mode_logbook == 1) { value = array_uint16_le (data + 6); - } else if (layout->pt_mode_logbook == 3) { + } else if (layout->pt_mode_logbook == 2) { value = array_uint16_le (data + 18); } else { return array_uint16_le(data + 18);