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 2021/02/04 14:40:57 UTC

[GitHub] [mynewt-nimble] v01d commented on pull request #906: NuttX fixes

v01d commented on pull request #906:
URL: https://github.com/apache/mynewt-nimble/pull/906#issuecomment-773359617


   sorry, I missed a small change, I just force pushed. The change I added is this:
   ```
   diff --git a/porting/npl/nuttx/src/os_callout.c b/porting/npl/nuttx/src/os_callout.c
   index fe12a8e3..e4580da9 100644
   --- a/porting/npl/nuttx/src/os_callout.c
   +++ b/porting/npl/nuttx/src/os_callout.c
   @@ -28,6 +28,10 @@
    
    #include "nimble/nimble_npl.h"
    
   +#ifndef CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE
   +#define CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE 1024
   +#endif
   +
    struct ble_npl_callout *pending_callout = NULL;
    
    bool thread_started = false;
   @@ -81,7 +85,10 @@ ble_npl_callout_init(struct ble_npl_callout *c,
        struct sigevent         event;
    
        if (!thread_started) {
   -        pthread_create(&callout_thread, NULL, callout_handler, NULL);
   +        pthread_attr_t attr;
   +        pthread_attr_init(&attr);
   +        pthread_attr_setstacksize(&attr, CONFIG_NIMBLE_CALLOUT_THREAD_STACKSIZE);
   +        pthread_create(&callout_thread, &attr, callout_handler, NULL);
            thread_started = true;
        }
    
   diff --git a/porting/npl/nuttx/src/os_task.c b/porting/npl/nuttx/src/os_task.c
   index 2e020236..ab535a36 100644
   --- a/porting/npl/nuttx/src/os_task.c
   +++ b/porting/npl/nuttx/src/os_task.c
   @@ -60,8 +60,10 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
        if (err) return err;
        err = pthread_attr_getschedparam (&t->attr, &t->param);
        if (err) return err;
   +#if CONFIG_RR_INTERVAL > 0
        err = pthread_attr_setschedpolicy(&t->attr, SCHED_RR);
        if (err) return err;
   +#endif
        t->param.sched_priority = prio;
        err = pthread_attr_setschedparam (&t->attr, &t->param);
        if (err) return err;
   @@ -69,6 +71,11 @@ ble_npl_task_init(struct ble_npl_task *t, const char *name, ble_npl_task_func_t
        t->name = name;
        err = pthread_create(&t->handle, &t->attr, func, arg);
    
   +    if (err == ENOMEM)
   +      {
   +        err = OS_ENOMEM;
   +      }
   +
        return err;
    }
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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