mbed library sources

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Thu Aug 13 11:30:09 2015 +0100
Parent:
604:19d487c995ec
Child:
606:12ecb532fd15
Commit message:
Synchronized with git revision 163a66abdd17c224129f0199f6ed2f3c626cacab

Full URL: https://github.com/mbedmicro/mbed/commit/163a66abdd17c224129f0199f6ed2f3c626cacab/

STMF4 - pwmout_api.c freq fix

Changed in this revision

targets/cmsis/TARGET_NXP/TARGET_LPC15XX/LPC15xx.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_STM32F4/pwmout_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/cmsis/TARGET_NXP/TARGET_LPC15XX/LPC15xx.h	Thu Aug 13 11:00:09 2015 +0100
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC15XX/LPC15xx.h	Thu Aug 13 11:30:09 2015 +0100
@@ -159,9 +159,9 @@
 
 typedef struct {                                    /*!< GPIO_PORT Structure                                                   */
   __IO uint8_t   B[76];                             /*!< Byte pin registers                                                    */
-  __I  uint32_t  RESERVED0[45];
+  __I  uint32_t  RESERVED0[1005];
   __IO uint32_t  W[76];                             /*!< Word pin registers                                                    */
-  __I  uint32_t  RESERVED1[1908];
+  __I  uint32_t  RESERVED1[948];
   __IO uint32_t  DIR[3];                            /*!< Port Direction registers                                              */
   __I  uint32_t  RESERVED2[29];
   __IO uint32_t  MASK[3];                           /*!< Port Mask register                                                    */
--- a/targets/hal/TARGET_STM/TARGET_STM32F4/pwmout_api.c	Thu Aug 13 11:00:09 2015 +0100
+++ b/targets/hal/TARGET_STM/TARGET_STM32F4/pwmout_api.c	Thu Aug 13 11:30:09 2015 +0100
@@ -241,9 +241,9 @@
 
     TimHandle.Init.Period        = us - 1;
     if (APBxCLKDivider == RCC_HCLK_DIV1)
-      TimHandle.Init.Prescaler   = (uint16_t)((PclkFreq*2) / 1000000) - 1; // 1 µs tick
+      TimHandle.Init.Prescaler   = (uint16_t)((PclkFreq) / 1000000) - 1; // 1 µs tick
     else
-      TimHandle.Init.Prescaler   = (uint16_t)((PclkFreq) / 1000000) - 1; // 1 µs tick
+      TimHandle.Init.Prescaler   = (uint16_t)((PclkFreq)*2 / 1000000) - 1; // 1 µs tick
     TimHandle.Init.ClockDivision = 0;
     TimHandle.Init.CounterMode   = TIM_COUNTERMODE_UP;
     HAL_TIM_PWM_Init(&TimHandle);