Skip to content

Commit fdc5780

Browse files
committed
[DWT] Init at startup
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 8650f6a commit fdc5780

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cores/arduino/stm32/hw_config.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "stm32_def.h"
3939
#include "hw_config.h"
4040
#include "usbd_if.h"
41+
#include "dwt.h"
4142

4243
#ifdef __cplusplus
4344
extern "C" {
@@ -50,15 +51,21 @@ extern "C" {
5051
*/
5152
void hw_config_init(void)
5253
{
53-
//Initialize the HAL
54+
/* Init DWT if present */
55+
#ifdef DWT_BASE
56+
dwt_init();
57+
#endif
58+
59+
/* Initialize the HAL */
5460
HAL_Init();
5561

56-
// Configure the system clock
62+
/* Configure the system clock */
5763
SystemClock_Config();
5864

5965
#if defined (USBCON) && defined(USBD_USE_CDC)
6066
USBD_CDC_init();
6167
#endif
68+
6269
}
6370
#ifdef __cplusplus
6471
}

0 commit comments

Comments
 (0)