Skip to content

Commit

Permalink
hosted/jlink: fixup! Query and log extended capabilities
Browse files Browse the repository at this point in the history
* Try to print extended capabilities. If the adapter doesn't advertise
  support for them, then just print standard capabilities, like it was before.
  • Loading branch information
ALTracer committed Nov 6, 2023
1 parent f1a4fc4 commit f0a8b8a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/platforms/hosted/jlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,9 @@ static bool jlink_get_extended_capabilities(void)
return false;

uint32_t ext_caps[4];
ext_caps[0] = read_le4(buffer, 0);
ext_caps[1] = read_le4(buffer, 4);
ext_caps[2] = read_le4(buffer, 8);
ext_caps[3] = read_le4(buffer, 12);
for (size_t i = 0; i < 4; i++)
ext_caps[i] = read_le4(buffer, i * 4U);

DEBUG_INFO("Extended capabilities: 0x%08" PRIx32, ext_caps[0]);
DEBUG_INFO(" 0x%08" PRIx32 " 0x%08" PRIx32 " 0x%08" PRIx32 "\n", ext_caps[1], ext_caps[2], ext_caps[3]);

Expand All @@ -350,11 +349,10 @@ static bool jlink_get_capabilities(void)
return false;

jlink.capabilities = read_le4(buffer, 0);
DEBUG_INFO("Capabilities: 0x%08" PRIx32 "\n", jlink.capabilities);

if (jlink.capabilities & JLINK_CAPABILITY_EXTENDED_CAPABILITIES)
jlink_get_extended_capabilities();
return jlink_get_extended_capabilities();

DEBUG_INFO("Capabilities: 0x%08" PRIx32 "\n", jlink.capabilities);
return true;
}

Expand Down

0 comments on commit f0a8b8a

Please sign in to comment.