This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-blinky.git


The following commit(s) were added to refs/heads/master by this push:
     new 76f6cc0  Add LED state print
76f6cc0 is described below

commit 76f6cc08027ecec6bcfd848a4e99879af0267f3c
Author: Slawomir Kasenberg <[email protected]>
AuthorDate: Tue Jul 8 15:58:32 2025 +0200

    Add LED state print
    
    This adds prints to console about LED status.
    To enable prints set BLINKY_PRINT_LED_STATE to 1.
---
 apps/blinky/src/main.c | 4 ++++
 apps/blinky/syscfg.yml | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/apps/blinky/src/main.c b/apps/blinky/src/main.c
index 3dd75ee..100e275 100755
--- a/apps/blinky/src/main.c
+++ b/apps/blinky/src/main.c
@@ -56,6 +56,10 @@ mynewt_main(int argc, char **argv)
 
         /* Toggle the LED */
         hal_gpio_toggle(g_led_pin);
+
+        if (MYNEWT_VAL(BLINKY_PRINT_LED_STATE)) {
+            printf("LED was toggled %d times.\n", g_task1_loops);
+        }
     }
     assert(0);
 
diff --git a/apps/blinky/syscfg.yml b/apps/blinky/syscfg.yml
index 6102850..44d9609 100644
--- a/apps/blinky/syscfg.yml
+++ b/apps/blinky/syscfg.yml
@@ -20,9 +20,13 @@ syscfg.defs:
     LED_BLINK_PIN:
         description: Pin which blinks led.
         value: LED_BLINK_PIN
+    BLINKY_PRINT_LED_STATE:
+        description: Print led status.
+        value: 0
 
 syscfg.vals:
-    CONSOLE_IMPLEMENTATION: stub
     LOG_IMPLEMENTATION: stub
     STATS_IMPLEMENTATION: stub
+syscfg.vals.BLINKY_PRINT_LED_STATE:
+    CONSOLE_IMPLEMENTATION: full
 

Reply via email to