diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index 94bbbf4..cb0a3ef 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -507,7 +507,7 @@ static const oceanic_common_layout_t aqualung_i770r_layout = { 0x40000, /* highmem */ 0x0000, /* cf_devinfo */ 0x0040, /* cf_pointers */ - 0x1000, /* rb_logbook_begin */ + 0x2000, /* rb_logbook_begin */ 0x10000, /* rb_logbook_end */ 16, /* rb_logbook_entry_size */ 0x40000, /* rb_profile_begin */ @@ -871,10 +871,8 @@ oceanic_atom2_device_open (dc_device_t **out, dc_context_t *context, dc_iostream case VTX: case I750TC: case PROPLUSX: - baudrate = 115200; - break; case I770R: - baudrate = 1000000; + baudrate = 115200; break; default: baudrate = 38400; diff --git a/src/oceanic_common.c b/src/oceanic_common.c index 184e5f9..1e6639b 100644 --- a/src/oceanic_common.c +++ b/src/oceanic_common.c @@ -496,10 +496,14 @@ oceanic_common_device_profile (dc_device_t *abstract, dc_event_progress_t *progr // Remove padding from the profile. if (layout->highmem) { - // The logbook entry contains the total number of pages containing - // profile data, excluding the footer page. Limit the profile size - // to this size. - unsigned int npages = (array_uint16_le (profiles + offset + 12) & 0x0FFF) + 1; + unsigned char *profile = profiles + offset; + // profile+12 and the bottom 4 bits of profile+13 and the top 3 bits of profile+13 + // is the number of pages of profile data until the start of the footer + // (not including the prepended logbook entry). + unsigned int high_part = array_uint16_le (profile + 12) & 0xE000; + unsigned int low_part = array_uint16_le (profile + 12) & 0x0FFF; + unsigned int npages = ((high_part >> 1) | low_part) + 1; + // INFO (abstract->context, "profile npages: 0x%X (%d)", npages, npages); unsigned int length = npages * PAGESIZE; if (rb_entry_size > length) { rb_entry_size = length;