pussuw commented on PR #6197:
URL: https://github.com/apache/incubator-nuttx/pull/6197#issuecomment-1120977896

   Does someone know what this snippet in 
`arch/risc-v/src/esp32c3/esp32c3_wifi_adapter.c` should do, people on espressif 
/ anyone ? Blame points to @donghengqaz:
   ```
   
   static void *esp_thread_semphr_get(void)
   {
     int ret;
     int i;
     void *sem;
     struct tcb_s *tcb = this_task();
     struct task_group_s *group = tcb->group;
   
     for (i = 0; i < CONFIG_SCHED_EXIT_MAX; i++)
       {
         if (group->tg_exit[i].func.on == esp_thread_semphr_free)
           {
             break;
           }
       }
   
     if (i >= CONFIG_SCHED_EXIT_MAX)
       {
         sem = esp_semphr_create(1, 0);
         if (!sem)
           {
             wlerr("ERROR: Failed to create semaphore\n");
             return NULL;
           }
   
         ret = on_exit(esp_thread_semphr_free, sem);
         if (ret < 0)
           {
             wlerr("ERROR: Failed to bind semaphore\n");
             esp_semphr_delete(sem);
             return NULL;
           }
       }
     else
       {
         sem = group->tg_exit[i].arg;
       }
   
     return sem;
   }
   ```


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

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to