diff --git a/cpu/stm32/periph/eth_common.c b/cpu/stm32/periph/eth_common.c index 59d346bfbf..a3bec50311 100644 --- a/cpu/stm32/periph/eth_common.c +++ b/cpu/stm32/periph/eth_common.c @@ -71,9 +71,9 @@ void isr_eth(void) if (IS_USED(MODULE_PERIPH_PTP_TIMER)) { if (ETH->MACSR & ETH_MACSR_TSTS) { - ptp_timer_cb(); /* clear interrupt by reading PTPTSSR */ (void)ETH->PTPTSSR; + ptp_timer_cb(); } } diff --git a/cpu/stm32/periph/ptp.c b/cpu/stm32/periph/ptp.c index fc43cbc5e9..1dc7a34a97 100644 --- a/cpu/stm32/periph/ptp.c +++ b/cpu/stm32/periph/ptp.c @@ -29,7 +29,8 @@ #include "periph_cpu.h" #include "timex.h" -#define ENABLE_DEBUG 0 +#define ENABLE_DEBUG 0 +#define DEBUG_VERBOSE 0 #include "debug.h" /* Workaround for typos in vendor files; drop when fixed upstream */ @@ -198,7 +199,7 @@ void ptp_timer_clear(void) void ptp_timer_set_absolute(const ptp_timestamp_t *target) { assert(target); - DEBUG("[periph_ptp] Set timer: %" PRIu32 ".%" PRIu32 "\n", + DEBUG("[periph_ptp] Set timer: %" PRIu32 ".%09" PRIu32 "\n", (uint32_t)target->seconds, target->nanoseconds); unsigned state = irq_disable(); /* Mask PTP timer IRQ first, so that an interrupt is not triggered @@ -212,7 +213,9 @@ void ptp_timer_set_absolute(const ptp_timestamp_t *target) /* Unmask the time stamp trigger interrupt */ ETH->MACIMR &= ~ETH_MACIMR_TSTIM; irq_restore(state); - DEBUG("PTPTSCR: 0x%08x, MACIMR: 0x%08x, MACSR: 0x%08x\n", - (unsigned)ETH->PTPTSCR, (unsigned)ETH->MACIMR, (unsigned)ETH->MACSR); + if (IS_ACTIVE(DEBUG_VERBOSE)) { + DEBUG("PTPTSCR: 0x%08x, MACIMR: 0x%08x, MACSR: 0x%08x\n", + (unsigned)ETH->PTPTSCR, (unsigned)ETH->MACIMR, (unsigned)ETH->MACSR); + } } #endif /* IS_USED(MODULE_PTP_TIMER) */