mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Revision:
227:7bd0639b8911
Parent:
215:83cf97a28428
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/pwmout_api.c	Wed Jun 11 09:45:09 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/pwmout_api.c	Wed Jun 11 16:00:09 2014 +0100
@@ -27,13 +27,13 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *******************************************************************************
  */
+#include "mbed_assert.h"
 #include "pwmout_api.h"
 
 #if DEVICE_PWMOUT
 
 #include "cmsis.h"
 #include "pinmap.h"
-#include "error.h"
 
 // TIM5 cannot be used because already used by the us_ticker
 static const PinMap PinMap_PWM[] = {
@@ -77,10 +77,7 @@
 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 pinout mapping failed");
-    }
+    MBED_ASSERT(obj->pwm != (PWMName)NC);
 
     // Enable TIM clock
     if (obj->pwm == PWM_2) RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);