Skip to content

Commit 5ba9392

Browse files
committed
Merge branch 'nordic_sdk_integration' of https://github.com/nvlsianpu/mbed-nordic into nordic_sdk_integration
# Conflicts: # hal/targets.json
2 parents a664be0 + 441a665 commit 5ba9392

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

hal/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@
13751375
"supported_form_factors": ["ARDUINO"],
13761376
"inherits": ["MCU_NRF51_32K"],
13771377
"progen": {"target": "nrf51-dk"},
1378-
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH"]
1378+
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH"]
13791379
},
13801380
"NRF51_DK_BOOT": {
13811381
"supported_form_factors": ["ARDUINO"],

hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822/pwmout_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void pwmout_init(pwmout_t *obj, PinName pin)
138138

139139
void pwmout_free(pwmout_t *obj)
140140
{
141-
MBED_ASSERT(obj->pwm != (PWMName)NC);
141+
MBED_ASSERT(obj->pwm_name != (PWMName)NC);
142142
MBED_ASSERT(obj->pwm_channel < PWM_CHANNELS_PER_INSTANCE);
143143

144144
pwm_t * pwm = (pwm_t *) obj->pwm_struct;
@@ -160,7 +160,8 @@ void pwmout_write(pwmout_t *obj, float value)
160160
if (value > 1.0f) {
161161
value = 1.0f;
162162
}
163-
uint16_t ticks = (uint16_t)((float)app_pwm_cycle_ticks_get(pwm->instance) * value);
163+
164+
app_pwm_channel_duty_set(pwm->instance, obj->pwm_channel, (app_pwm_duty_t)(value * 100.0f) );
164165
}
165166

166167
float pwmout_read(pwmout_t *obj)

0 commit comments

Comments
 (0)