Skip to content

Commit

Permalink
hosted/jlink: Fixed the new frequency calculation which was accidenta…
Browse files Browse the repository at this point in the history
…lly using the old divisor value
  • Loading branch information
dragonmux authored and esden committed Jul 31, 2023
1 parent 98cb837 commit 6d20f20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platforms/hosted/jlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static bool jlink_set_interface_frequency(const uint8_t interface, const uint32_
divisor = interface_frequency->min_divisor;

/* Get the approximate frequency we'll actually be running at, convert to kHz in the process */
const uint16_t frequency_khz = (interface_frequency->base / interface_frequency->current_divisor) / 1000U;
const uint16_t frequency_khz = (interface_frequency->base / divisor) / 1000U;

if (!jlink_simple_request_16(JLINK_CMD_INTERFACE_SET_FREQUENCY_KHZ, frequency_khz, NULL, 0))
return false;
Expand Down

0 comments on commit 6d20f20

Please sign in to comment.