You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2023/07/08 20:08:13 UTC

[mynewt-nimble] branch master updated (66c86646 -> 62cfff48)

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

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


    from 66c86646 host/dtm: add doxygen comments for the header file
     new a0f74cd1 porting/examples/nuttx: align parameters passed to ble_npl_task_init()
     new 62cfff48 porting/npl/nuttx: add support for thread names

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 porting/examples/nuttx/main.c      | 8 ++++----
 porting/npl/nuttx/src/os_callout.c | 1 +
 porting/npl/nuttx/src/os_task.c    | 4 ++++
 3 files changed, 9 insertions(+), 4 deletions(-)


[mynewt-nimble] 02/02: porting/npl/nuttx: add support for thread names

Posted by ja...@apache.org.
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-nimble.git

commit 62cfff48402e503a8163948044f5ef8d9504a874
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Fri Jul 7 19:47:28 2023 +0300

    porting/npl/nuttx: add support for thread names
    
    Use pthread_setname_np() to set names for created tasks
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 porting/npl/nuttx/src/os_callout.c | 1 +
 porting/npl/nuttx/src/os_task.c    | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/porting/npl/nuttx/src/os_callout.c b/porting/npl/nuttx/src/os_callout.c
index eb69bb8b..3b4ee5fb 100644
--- a/porting/npl/nuttx/src/os_callout.c
+++ b/porting/npl/nuttx/src/os_callout.c
@@ -91,6 +91,7 @@ ble_npl_callout_init(struct ble_npl_callout *c,
         pthread_attr_init(&attr);
         pthread_attr_setstacksize(&attr, CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE);
         pthread_create(&callout_thread, &attr, callout_handler, NULL);
+        pthread_setname_np(callout_thread, "ble_npl_callout");
         thread_started = true;
     }
 
diff --git a/porting/npl/nuttx/src/os_task.c b/porting/npl/nuttx/src/os_task.c
index 40f8c8c7..075928a7 100644
--- a/porting/npl/nuttx/src/os_task.c
+++ b/porting/npl/nuttx/src/os_task.c
@@ -77,6 +77,10 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
       {
         err = OS_ENOMEM;
       }
+    else
+      {
+        pthread_setname_np(t->handle, t->name);
+      }
 
     return err;
 }


[mynewt-nimble] 01/02: porting/examples/nuttx: align parameters passed to ble_npl_task_init()

Posted by ja...@apache.org.
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-nimble.git

commit a0f74cd1812423006e6700c05bbe5b07c9ff8881
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Fri Jul 7 19:46:14 2023 +0300

    porting/examples/nuttx: align parameters passed to ble_npl_task_init()
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 porting/examples/nuttx/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/porting/examples/nuttx/main.c b/porting/examples/nuttx/main.c
index 9eeddec8..7e289be7 100644
--- a/porting/examples/nuttx/main.c
+++ b/porting/examples/nuttx/main.c
@@ -111,8 +111,8 @@ int main(int argc, char *argv[])
 
     printf("hci_sock task init\n");
     ret = ble_npl_task_init(&s_task_hci, "hci_sock", ble_hci_sock_task,
-                      NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER,
-                      TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE);
+                            NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER,
+                            TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE);
 
     if (ret != 0)
       {
@@ -122,8 +122,8 @@ int main(int argc, char *argv[])
     /* Create task which handles default event queue for host stack. */
     printf("ble_host task init\n");
     ret = ble_npl_task_init(&s_task_host, "ble_host", ble_host_task,
-                      NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER,
-                      TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE);
+                            NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER,
+                            TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE);
 
 
     if (ret != 0)