Donny9 commented on pull request #2039:
URL: https://github.com/apache/incubator-nuttx/pull/2039#issuecomment-714185676


   > 
   > 
   > Where is this wtgahrs.c file? It does not seem to be part of this PR. 
Maybe I'm missing something.
   > 
   > Regarding the sensor model itself, it is difficult for me to evaluate how 
well it maps to existing sensors. I think there's a risk of this being too 
restrictive and it is something that you will only find out when you try to 
look at various drivers and see if they all can work the same way or their 
behaviour would change.
   > 
   > That said, we could merge this and consider it a feature that needs more 
evaluation before fully embracing it (and porting all drivers to it). I 
wouldn't want to have two sets of drivers: those that work with this interface 
and a lot of others that do not. Maybe as you say, it is a matter of slowly 
evolving this into something that considers all scenarios.
   > 
   > Regarding the buffer, there are two points here. First, I think that for 
some drivers it is better to have the option of having no _extra_ buffer at 
all. The posix read() will supply a buffer where the driver can directly write 
into. I don't think it makes sense for all cases to have an intermediate 
buffer. In that case, I would expect the intermediate buffer be skipped. 
Second, consider adding support for dropping old values when the queue is full. 
This came up recently with the ADC driver: most times you care more about last 
N values than first N values until buffer is full.
   
   Yes, Your concerns are understandable, but it is almost impossible for me to 
transplant all the existing sensors to this model at present. We can only 
recommend us to use the sensor model, and then gradually add new functions to 
improve it and replace the previous disordered model. 
   
   On the two points thar you mentioned, the first one needs to add by read 
function directly read register content to save intermediate buffer, i will 
finish it as soon as possible; the seconds one for intermediate buffer, it's 
been taken into account in the design, we will overwire old sensor event when 
intermediate buffer is fulls.
   
   Finally, you can see wthahrs2.c in this commits, 
url:https://github.com/apache/incubator-nuttx/pull/2039/commits/15c5ab7d0b5b4dcd7b7ec2753b7e086568fae9b7.
   
   Thanks for your advice.


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


Reply via email to