mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Revision:
227:7bd0639b8911
Parent:
159:3b23f6d9ecb9
Child:
242:7074e42da0b2
--- a/targets/hal/TARGET_STM/TARGET_DISCO_F407VG/pwmout_api.c	Wed Jun 11 09:45:09 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_DISCO_F407VG/pwmout_api.c	Wed Jun 11 16:00:09 2014 +0100
@@ -27,6 +27,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *******************************************************************************
  */
+#include "mbed_assert.h"
 #include "pwmout_api.h"
 
 #include "cmsis.h"
@@ -87,11 +88,8 @@
 void pwmout_init(pwmout_t* obj, PinName pin) {  
     // Get the peripheral name from the pin and assign it to the object
     obj->pwm = (PWMName)pinmap_peripheral(pin, PinMap_PWM);
-  
-    if (obj->pwm == (PWMName)NC) {
-        error("PWM error: pinout mapping failed.");
-    }
-    
+    MBED_ASSERT(obj->pwm != (PWMName)NC);
+
     // Enable TIM clock
     if (obj->pwm == PWM_1) __TIM1_CLK_ENABLE();
     if (obj->pwm == PWM_2) __TIM2_CLK_ENABLE();