drivers: can: shell: add debug log for calculated timing parameters

Add debug logs for the timing parameters calculated by the shell commands.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-03-16 13:57:55 +01:00 committed by Carles Cufí
parent 1c7feb3fd4
commit 37b3a11d72

View file

@ -421,6 +421,10 @@ static int cmd_can_bitrate_set(const struct shell *sh, size_t argc, char **argv)
timing.sjw);
}
LOG_DBG("sjw %u, prop_seg %u, phase_seg1 %u, phase_seg2 %u, prescaler %u",
timing.sjw, timing.prop_seg, timing.phase_seg1, timing.phase_seg2,
timing.prescaler);
err = can_set_timing(dev, &timing);
if (err != 0) {
shell_error(sh, "failed to set timing (err %d)", err);
@ -495,6 +499,10 @@ static int cmd_can_dbitrate_set(const struct shell *sh, size_t argc, char **argv
timing.sjw);
}
LOG_DBG("sjw %u, prop_seg %u, phase_seg1 %u, phase_seg2 %u, prescaler %u",
timing.sjw, timing.prop_seg, timing.phase_seg1, timing.phase_seg2,
timing.prescaler);
err = can_set_timing_data(dev, &timing);
if (err != 0) {
shell_error(sh, "failed to set data timing (err %d)", err);