From ad297c1cc90a309ec58797c6de23c48235278424 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sun, 15 Dec 2019 22:24:16 +0100 Subject: [PATCH 1/3] Strip the source directory from file names Use the GCC 8 -fmacro-prefix-map option to strip the source directory and change the __FILE__ macro into a relative path. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 2d32a35..51592b8 100644 --- a/configure.ac +++ b/configure.ac @@ -188,6 +188,7 @@ AX_APPEND_COMPILE_FLAGS([ \ -Wmissing-prototypes \ -Wmissing-declarations \ -Wno-unused-parameter \ + -fmacro-prefix-map='$(top_srcdir)/'= \ ]) # Windows specific compiler options. From 9f3e0a7026d01ef7ec305b3f0a19d8499be23b5c Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 20 Dec 2019 21:59:18 +0100 Subject: [PATCH 2/3] Add support for the Oceanic Pro Plus 4 --- src/descriptor.c | 1 + src/oceanic_atom2.c | 1 + src/oceanic_atom2_parser.c | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/descriptor.c b/src/descriptor.c index 2f8a2e0..1002b36 100644 --- a/src/descriptor.c +++ b/src/descriptor.c @@ -242,6 +242,7 @@ static const dc_descriptor_t g_descriptors[] = { {"Aqualung", "i770R", DC_FAMILY_OCEANIC_ATOM2, 0x4651, DC_TRANSPORT_SERIAL, NULL}, {"Aqualung", "i550C", DC_FAMILY_OCEANIC_ATOM2, 0x4652, DC_TRANSPORT_SERIAL, NULL}, {"Oceanic", "Geo 4.0", DC_FAMILY_OCEANIC_ATOM2, 0x4653, DC_TRANSPORT_SERIAL, NULL}, + {"Oceanic", "Pro Plus 4", DC_FAMILY_OCEANIC_ATOM2, 0x4656, DC_TRANSPORT_SERIAL, NULL}, /* Mares Nemo */ {"Mares", "Nemo", DC_FAMILY_MARES_NEMO, 0, DC_TRANSPORT_SERIAL, NULL}, {"Mares", "Nemo Steel", DC_FAMILY_MARES_NEMO, 0, DC_TRANSPORT_SERIAL, NULL}, diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index 1bc18c8..0ea5317 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -147,6 +147,7 @@ static const oceanic_common_version_t sherwood_wisdom_version[] = { static const oceanic_common_version_t oceanic_proplus3_version[] = { {"PROPLUS3 \0\0 512K"}, + {"PROPLUS4 \0\0 512K"}, }; static const oceanic_common_version_t tusa_zenair_version[] = { diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index 892ee1f..ed38802 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -93,6 +93,7 @@ #define I770R 0x4651 #define I550C 0x4652 #define GEO40 0x4653 +#define PROPLUS4 0x4656 #define NORMAL 0 #define GAUGE 1 @@ -171,7 +172,8 @@ oceanic_atom2_parser_create (dc_parser_t **out, dc_context_t *context, unsigned parser->headersize += PAGESIZE; } else if (model == TX1) { parser->headersize += 2 * PAGESIZE; - } else if (model == ATOM1 || model == I100) { + } else if (model == ATOM1 || model == I100 || + model == PROPLUS4) { parser->headersize -= 2 * PAGESIZE; } else if (model == F10A || model == F10B || model == MUNDIAL2 || model == MUNDIAL3) { @@ -288,6 +290,7 @@ oceanic_atom2_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetim case I100: case I300C: case GEO40: + case PROPLUS4: datetime->year = ((p[3] & 0xE0) >> 1) + (p[4] & 0x0F) + 2000; datetime->month = (p[4] & 0xF0) >> 4; datetime->day = p[3] & 0x1F; @@ -899,7 +902,8 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ } else { unsigned int sign; if (parser->model == DG03 || parser->model == PROPLUS3 || - parser->model == I550 || parser->model == I550C) + parser->model == I550 || parser->model == I550C || + parser->model == PROPLUS4) sign = (~data[offset + 5] & 0x04) >> 2; else if (parser->model == VOYAGER2G || parser->model == AMPHOS || parser->model == AMPHOSAIR || parser->model == ZENAIR) @@ -932,7 +936,7 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ parser->model == DG03 || parser->model == PROPLUS3 || parser->model == AMPHOSAIR || parser->model == I550 || parser->model == VISION || parser->model == XPAIR || - parser->model == I550C) + parser->model == I550C || parser->model == PROPLUS4) pressure = (((data[offset + 0] & 0x03) << 8) + data[offset + 1]) * 5; else if (parser->model == TX1 || parser->model == A300CS || parser->model == VTX || parser->model == I750TC || From 02ae8d3fdb0f77875ac857f57631301e1e8f236b Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 23 Dec 2019 19:38:06 +0100 Subject: [PATCH 3/3] Fix the Aeris Manta memory layout For the Aeris Manta, the end of the profile ringbuffer appears to depend on the firmware version. For older firmware versions (1x), the end of the ringbuffer is at address 0xFFF0, while for the newer versions (2x), it's 0xFE00. The code checks for firmware version 2B, because that's the lowest known version in the 2x range. Reported-by: Nick Shore --- src/oceanic_atom2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index 0ea5317..553d2d2 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -96,6 +96,10 @@ static const oceanic_common_version_t aeris_f11_version[] = { {"OCEANF11 \0\0 1024"}, }; +static const oceanic_common_version_t aeris_manta_version[] = { + {"MANTA R\0\0 512K"}, +}; + static const oceanic_common_version_t oceanic_atom1_version[] = { {"ATOM rev\0\0 256K"}, }; @@ -105,7 +109,6 @@ static const oceanic_common_version_t oceanic_atom2_version[] = { }; static const oceanic_common_version_t oceanic_atom2a_version[] = { - {"MANTA R\0\0 512K"}, {"INSIGHT2 \0\0 512K"}, {"OCEVEO30 \0\0 512K"}, {"ATMOSAI R\0\0 512K"}, @@ -736,6 +739,12 @@ oceanic_atom2_device_open (dc_device_t **out, dc_context_t *context, dc_iostream } else if (OCEANIC_COMMON_MATCH (device->base.version, aeris_f11_version)) { device->base.layout = &aeris_f11_layout; device->bigpage = 8; + } else if (OCEANIC_COMMON_MATCH (device->base.version, aeris_manta_version)) { + if (array_uint16_be (device->base.version + 0x08) >= 0x3242) { + device->base.layout = &oceanic_atom2a_layout; + } else { + device->base.layout = &oceanic_atom2c_layout; + } } else if (OCEANIC_COMMON_MATCH (device->base.version, oceanic_atom1_version)) { device->base.layout = &oceanic_atom1_layout; } else if (OCEANIC_COMMON_MATCH (device->base.version, oceanic_atom2_version)) {