You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/05/22 23:39:38 UTC

[GitHub] mlaz closed pull request #1117: set nRF52 PWM instance->playing to true when enabling the pwm playback

mlaz closed pull request #1117: set nRF52 PWM instance->playing to true when enabling the pwm playback
URL: https://github.com/apache/mynewt-core/pull/1117
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c b/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c
index aad8cc06c..336ed6bf6 100644
--- a/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c
+++ b/hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c
@@ -409,8 +409,8 @@ nrf52_pwm_configure_device(struct pwm_dev *dev, struct pwm_dev_cfg *cfg)
     if (instance->playing) {
         nrfx_pwm_uninit(&instance->drv_instance);
         nrfx_pwm_init(&instance->drv_instance,
-                         &instance->config,
-                         instance->internal_handler);
+                      &instance->config,
+                      instance->internal_handler);
 
         play_current_config(instance);
     }
@@ -446,8 +446,8 @@ nrf52_pwm_configure_channel(struct pwm_dev *dev,
     if (instance->playing) {
         nrfx_pwm_uninit(&instance->drv_instance);
         nrfx_pwm_init(&instance->drv_instance,
-                         &instance->config,
-                         instance->internal_handler);
+                      &instance->config,
+                      instance->internal_handler);
 
         play_current_config(instance);
     }
@@ -509,6 +509,7 @@ nrf52_pwm_enable(struct pwm_dev *dev)
                   &instance->config,
                   instance->internal_handler);
     play_current_config(instance);
+    instance->playing = true;
 
     return (0);
 }
@@ -545,6 +546,7 @@ nrf52_pwm_disable(struct pwm_dev *dev)
     if (!nrfx_pwm_stop(&instances[inst_id].drv_instance, true)) {
         return (-EINVAL);
     }
+    instances[inst_id].playing = false;
 
     nrfx_pwm_uninit(&instances[inst_id].drv_instance);
     return (0);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services