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

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

commit 3275f351d346d7e240043c115a30de8ba42e09a3
Author: Wiktor Kwiatkowski <[email protected]>
AuthorDate: Tue Jul 8 12:45:21 2025 +0200

    Add syscfg.value for LED pin
    
    This adds:
        - example syscfg.yml with blink configuration
        - code that uses defined value in syscfg file
---
 apps/blinky/pkg.yml                 |  4 ++--
 apps/blinky/src/main.c              |  2 +-
 apps/blinky/{pkg.yml => syscfg.yml} | 23 ++++++++++-------------
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/apps/blinky/pkg.yml b/apps/blinky/pkg.yml
index f571f08..6c5a269 100644
--- a/apps/blinky/pkg.yml
+++ b/apps/blinky/pkg.yml
@@ -27,5 +27,5 @@ pkg.keywords:
 pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
-    - "@apache-mynewt-core/sys/console/stub"
-    - "@apache-mynewt-core/sys/log/stub"
+    - "@apache-mynewt-core/sys/console"
+    - "@apache-mynewt-core/sys/log"
diff --git a/apps/blinky/src/main.c b/apps/blinky/src/main.c
index 04c7edf..3dd75ee 100755
--- a/apps/blinky/src/main.c
+++ b/apps/blinky/src/main.c
@@ -45,7 +45,7 @@ mynewt_main(int argc, char **argv)
 
     sysinit();
 
-    g_led_pin = LED_BLINK_PIN;
+    g_led_pin = MYNEWT_VAL(LED_BLINK_PIN);
     hal_gpio_init_out(g_led_pin, 1);
 
     while (1) {
diff --git a/apps/blinky/pkg.yml b/apps/blinky/syscfg.yml
similarity index 67%
copy from apps/blinky/pkg.yml
copy to apps/blinky/syscfg.yml
index f571f08..6102850 100644
--- a/apps/blinky/pkg.yml
+++ b/apps/blinky/syscfg.yml
@@ -1,4 +1,3 @@
-#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -6,7 +5,7 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing,
@@ -17,15 +16,13 @@
 # under the License.
 #
 
-pkg.name: apps/blinky
-pkg.type: app
-pkg.description: Basic example application which blinks an LED.
-pkg.author: "Apache Mynewt <[email protected]>"
-pkg.homepage: "http://mynewt.apache.org/";
-pkg.keywords:
+syscfg.defs:
+    LED_BLINK_PIN:
+        description: Pin which blinks led.
+        value: LED_BLINK_PIN
+
+syscfg.vals:
+    CONSOLE_IMPLEMENTATION: stub
+    LOG_IMPLEMENTATION: stub
+    STATS_IMPLEMENTATION: stub
 
-pkg.deps:
-    - "@apache-mynewt-core/kernel/os"
-    - "@apache-mynewt-core/hw/hal"
-    - "@apache-mynewt-core/sys/console/stub"
-    - "@apache-mynewt-core/sys/log/stub"

Reply via email to