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/09/21 23:36:01 UTC

[GitHub] vrahane closed pull request #1412: drivers/lp5523: remove static delays from config

vrahane closed pull request #1412: drivers/lp5523: remove static delays from config
URL: https://github.com/apache/mynewt-core/pull/1412
 
 
   

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/led/lp5523/src/lp5523.c b/hw/drivers/led/lp5523/src/lp5523.c
index 9e2ab0d07b..f260c322c6 100644
--- a/hw/drivers/led/lp5523/src/lp5523.c
+++ b/hw/drivers/led/lp5523/src/lp5523.c
@@ -995,6 +995,9 @@ lp5523_config(struct led_itf *itf, struct lp5523_cfg *cfg)
         goto err;
     }
 
+    /* delay of 500us for startup sequence */
+    os_cputime_delay_usecs(MYNEWT_VAL(LP5523_STARTUP_SEQ_DELAY));
+
     misc_val = 0;
     if (cfg->auto_inc_en) {
         misc_val = LP5523_EN_AUTO_INCR.mask;
@@ -1053,28 +1056,20 @@ lp5523_config(struct led_itf *itf, struct lp5523_cfg *cfg)
             goto err;
         }
 
-        lp5523_wait(1);
-
         rc = lp5523_set_output_log_dim(itf, i, cfg->per_led_cfg[i - 1].log_dim_en);
         if (rc) {
             goto err;
         }
 
-        lp5523_wait(1);
-
         rc = lp5523_set_output_temp_comp(itf, i, cfg->per_led_cfg[i - 1].temp_comp);
         if (rc) {
             goto err;
         }
 
-        lp5523_wait(1);
-
         rc = lp5523_set_output_on(itf, i, cfg->per_led_cfg[i - 1].output_on);
         if (rc) {
             goto err;
         }
-
-        lp5523_wait(1);
     }
 
 err:
diff --git a/hw/drivers/led/lp5523/syscfg.yml b/hw/drivers/led/lp5523/syscfg.yml
index 0e9df5897b..5ef042c6cd 100644
--- a/hw/drivers/led/lp5523/syscfg.yml
+++ b/hw/drivers/led/lp5523/syscfg.yml
@@ -44,3 +44,8 @@ syscfg.defs:
             Number of retries to use for failed I2C communication.  A retry is
             used when the LP5523 sends an unexpected NACK.
         value: 2
+    LP5523_STARTUP_SEQ_DELAY:
+        description: >
+            Startup sequence delay for chip to finish start sequence
+            in micro-seconds
+        value: 500


 

----------------------------------------------------------------
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