xiaoxiang781216 commented on PR #7678:
URL: https://github.com/apache/nuttx/pull/7678#issuecomment-1328085547

   > I have changed to initializing the RTT buffer in lib_rttoutstream, but I 
still feel like this is not a good design.
   > 
   > This can cause some unnecessary troubles: When calling lib_rttinstream to 
initialize channel 0, it will cause an internal static buffer leak, which we 
cannot release or use
   > 
   
   Since channel 0 is initialized by RTT internally, you can just skip the 
stream initialization code for channel 0.
   
   > We need to get some internal data structures of Segger RTT in the code, 
its style is not compatible with nuttx
   > 
   
   you can simply save fields in lib_rttoutstream_s:
   ```
   struct lib_rttoutstream_s
   {
     struct lib_outstream_s public;
     char name[32];
     int channel;
     FAR void *buffer;
   };
   ```
   
   > The initialization of the segger RTT channel is a very independent thing 
that only needs to be done once. There is no need to process it once in 
different codes, and there is no need for uninitialization
   


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