tests: drivers: can: timing: print core clock to aid in debugging
Print the CAN core clock frequency along with the device name to aid in debugging CAN timing test case errors. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
e9b288b713
commit
7a5116acb2
1 changed files with 7 additions and 1 deletions
|
@ -285,9 +285,15 @@ void test_set_timing_max(void)
|
||||||
void test_main(void)
|
void test_main(void)
|
||||||
{
|
{
|
||||||
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
|
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
|
||||||
|
uint32_t core_clock;
|
||||||
|
int err;
|
||||||
|
|
||||||
zassert_true(device_is_ready(dev), "CAN device not ready");
|
zassert_true(device_is_ready(dev), "CAN device not ready");
|
||||||
printk("testing on device %s\n", dev->name);
|
|
||||||
|
err = can_get_core_clock(dev, &core_clock);
|
||||||
|
zassert_equal(err, 0, "failed to get core CAN clock");
|
||||||
|
|
||||||
|
printk("testing on device %s @ %u Hz\n", dev->name, core_clock);
|
||||||
|
|
||||||
k_object_access_grant(dev, k_current_get());
|
k_object_access_grant(dev, k_current_get());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue