xiaoxiang781216 edited a comment on pull request #1520:
URL: https://github.com/apache/incubator-nuttx/pull/1520#issuecomment-683581640


   @patacongo could you point out what your requirement doesn't be considered? 
USB transport layer can be implemented by one function now:
   ```
   void note_add(FAR const uint8_t *note, uint8_t notelen);
   ```
   which is much simpler than to implement a bunch of functions:
   ```
   void sched_note_start(FAR struct tcb_s *tcb);
   void sched_note_stop(FAR struct tcb_s *tcb);
   void sched_note_suspend(FAR struct tcb_s *tcb);
   void sched_note_resume(FAR struct tcb_s *tcb);
   #ifdef CONFIG_SMP
   void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu);
   void sched_note_cpu_started(FAR struct tcb_s *tcb);
   void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu);
   void sched_note_cpu_paused(FAR struct tcb_s *tcb);
   void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu);
   void sched_note_cpu_resumed(FAR struct tcb_s *tcb);
   #endif
   #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
   void sched_note_premption(FAR struct tcb_s *tcb, bool locked);
   #endif
   #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
   void sched_note_csection(FAR struct tcb_s *tcb, bool enter);
   #endif
   #ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS
   void sched_note_spinlock(FAR struct tcb_s *tcb,
                            FAR volatile void *spinlock);
   void sched_note_spinlocked(FAR struct tcb_s *tcb,
                              FAR volatile void *spinlock);
   void sched_note_spinunlock(FAR struct tcb_s *tcb,
                              FAR volatile void *spinlock);
   void sched_note_spinabort(FAR struct tcb_s *tcb,
                             FAR volatile void *spinlock);
   #endif
   #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
   void sched_note_syscall_enter(int nr, int argc, ...);
   void sched_note_syscall_leave(int nr, uintptr_t result);
   #endif
   #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
   void sched_note_irqhandler(int irq, FAR void *handler, bool enter);
   #endif
   ```
   The implementation of ```sche_note_*``` in sched/sched/sched_note.c just 
pacakage the various arguments into ```struct note_*``` and pass ```note_add``` 
directly without any buffering. It's decided by the transport layer(RAM, USB 
etc.) whether to buffer the data and how to transfer the data.


----------------------------------------------------------------
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:
[email protected]


Reply via email to