fix LPC812 PWM

Dependents:   IR_LED_Send

Fork of mbed-dev by mbed official

Revision:
43:e3d4af315dd8
Parent:
34:bb6061527455
Child:
46:cb4f85f96d35
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/system_stm32f0xx.c	Mon Jan 04 09:30:11 2016 +0000
+++ b/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/system_stm32f0xx.c	Mon Jan 04 12:15:11 2016 +0000
@@ -82,7 +82,7 @@
   */
 
 #include "stm32f0xx.h"
-
+#include "hal_tick.h"
 /**
   * @}
   */
@@ -161,6 +161,7 @@
   * @{
   */
 
+
 /**
   * @brief  Setup the microcontroller system.
   *         Initialize the default HSI clock source, vector table location and the PLL configuration is reset.
@@ -225,6 +226,18 @@
 
   /* Disable all interrupts */
   RCC->CIR = 0x00000000;
+
+  /* Configure the Cube driver */
+  SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
+  HAL_Init();
+
+  /* Configure the System clock source, PLL Multiplier and Divider factors,
+     AHB/APBx prescalers and Flash settings */
+  SetSysClock();
+
+  /* Reset the timer to avoid issues after the RAM initialization */
+  TIM_MST_RESET_ON;
+  TIM_MST_RESET_OFF;
 }
 
 /**