fixed drive strength
Fork of mbed-dev by
Diff: targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/pwmout_api.c
- Revision:
- 150:02e0a0aed4ec
- Parent:
- 149:156823d33999
--- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/pwmout_api.c Fri Oct 28 11:17:30 2016 +0100 +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/pwmout_api.c Tue Nov 08 17:45:16 2016 +0000 @@ -107,6 +107,27 @@ static void internal_pwmout_exe(pwmout_t *obj, bool new_period, bool initialization); +// extern PWM nIRQ handler implementations +void PWM0_IRQHandler(void); +void PWM1_IRQHandler(void); +void PWM2_IRQHandler(void); + +static const peripheral_handler_desc_t pwm_handlers[PWM_INSTANCE_COUNT] = +{ + { + PWM0_IRQn, + (uint32_t)PWM0_IRQHandler + }, + { + PWM1_IRQn, + (uint32_t)PWM1_IRQHandler + }, + { + PWM2_IRQn, + (uint32_t)PWM2_IRQHandler + } +}; + void pwmout_init(pwmout_t *obj, PinName pin) { uint32_t i; @@ -115,6 +136,8 @@ { if (m_pwm[i].p_pwm_driver == NULL) // a driver instance not assigned to the obj? { + NVIC_SetVector(pwm_handlers[i].IRQn, pwm_handlers[i].vector); + obj->pin = pin; obj->pwm_channel = i; @@ -346,7 +369,7 @@ NRF_DRV_PWM_PIN_NOT_USED, // channel 2 NRF_DRV_PWM_PIN_NOT_USED, // channel 3 }, - .irq_priority = APP_IRQ_PRIORITY_LOW, + .irq_priority = PWM0_CONFIG_IRQ_PRIORITY, .base_clock = pulsewidth_set.pwm_clk, .count_mode = NRF_PWM_MODE_UP, .top_value = pulsewidth_set.period_hwu,