xiaoxiang781216 commented on pull request #2215: URL: https://github.com/apache/incubator-nuttx/pull/2215#issuecomment-725497073
> > ``` > > 1. When fetch isn't NULL, the intermediate buffer is disabled on sensor_register to save ram. Done on this patch. > > ``` > > I see. But the call to the buffer creation function is still done and if I understand correctly, due to the rounding up, one struct will be allocated in the buffer still. It isn't an issue more with new mm/circ_buf, so we can temporarily ignore it here. > > > ``` > > 2. I think we should move towards unification. If there is no conforming type or structure, we should add them and make them as versatile as possible. It's especially good for application developers. > > ``` > > I agree, but I'm thinking in the lines of something that wouldn't necessarily be ported upstream, leaving downstream user the possibility of defining a particular driver with specific needs. But we can go back to this later on. > Ok, we can add a special register api later. > > Thank you. > > > > I'm looking at the changes. I wanted to ask, any reason why you are defining your own queue structure instead of using definitions in queue.h? > > > > > > > > > The circualr buffer and queue are different for their behavior. We need to overwrite old data when buffer is full, and it's better to operate buffer directly rather than queue node. > > > > > > I will add mm/circ_buf for circular buffer management on other patch later, and driver/sensor and driver/rc will call these api about circ_buf_xxx to use circular buffer. > > Are you sure there's no circular buffer structure defined anywhere else in NuttX? We can't find one, could you point to a general and standalone implementation? > > Also, shouldn't the buffer be released on close() on the last reference? Right now it requires the unregistration of the sensor > > What about this? Since the upcomming patch will replace the buffer implemenation to a common one, how about move this change to that PR? ---------------------------------------------------------------- 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: us...@infra.apache.org