You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "bskdany (via GitHub)" <gi...@apache.org> on 2025/07/13 02:51:00 UTC
[PR] /drivers/sensors/nau7802: Added frequency control [nuttx]
bskdany opened a new pull request, #16717:
URL: https://github.com/apache/nuttx/pull/16717
## Summary
This pr extends the controls of the nau7802 by exposing the odr control function to the userspace
## Impact
A user can now control the frequency and interval via the orb_set_interval and orb_set_frequency commands, as well as ioctl
## Testing
Physical testing was performed confirming the desired outcome.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] /drivers/sensors/nau7802: Added frequency control [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #16717:
URL: https://github.com/apache/nuttx/pull/16717#discussion_r2204732703
##########
drivers/sensors/nau7802.c:
##########
@@ -124,20 +125,20 @@ static int nau7802_read_reg(FAR nau7802_dev_s *dev, uint8_t addr, void *buf,
uint8_t nbytes)
{
struct i2c_msg_s readcmd[2] = {
Review Comment:
Please move "{" to new line. The nxstyle in CI should have catch it early, it seems faulty, I will fix it.
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] /drivers/sensors/nau7802: Added frequency control [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #16717:
URL: https://github.com/apache/nuttx/pull/16717
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] /drivers/sensors/nau7802: Added frequency control [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #16717:
URL: https://github.com/apache/nuttx/pull/16717#discussion_r2204732703
##########
drivers/sensors/nau7802.c:
##########
@@ -124,20 +125,20 @@ static int nau7802_read_reg(FAR nau7802_dev_s *dev, uint8_t addr, void *buf,
uint8_t nbytes)
{
struct i2c_msg_s readcmd[2] = {
Review Comment:
Please move "{" to new line. The nxstyle in CI should have catch it early, it seems faulty, I will fix it.
More info: https://github.com/apache/nuttx/issues/16367
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] /drivers/sensors/nau7802: Added frequency control [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #16717:
URL: https://github.com/apache/nuttx/pull/16717#discussion_r2205485451
##########
drivers/sensors/nau7802.c:
##########
@@ -89,7 +89,7 @@
/* ODR to Interval */
static const uint32_t ODR_TO_INTERVAL[] =
-{
+ {
Review Comment:
why change
##########
drivers/sensors/nau7802.c:
##########
@@ -669,28 +702,28 @@ static int nau7802_control(FAR struct sensor_lowerhalf_s *lower,
}
switch (cmd)
- {
- case SNIOC_RESET:
- err = nau7802_reset(dev);
- break;
+ {
Review Comment:
why remove the indent
##########
drivers/sensors/nau7802.c:
##########
@@ -440,10 +442,41 @@ static int nau7802_set_gain(FAR nau7802_dev_s *dev, nau7802_gain_e gain)
* Name: nau7802_set_interval
****************************************************************************/
-static int nau7802_set_interval(FAR nau7802_dev_s *dev,
- nau7802_odr_e rate)
+static int nau7802_set_interval(FAR struct sensor_lowerhalf_s *lower,
+ FAR struct file *filep, uint32_t *period_us)
{
+ FAR nau7802_dev_s *dev = container_of(lower, FAR nau7802_dev_s, lower);
+
+ nau7802_odr_e rate;
+
+ if (*period_us >= 100000)
+ {
+ rate = NAU7802_ODR_10HZ;
Review Comment:
assign to dev->odr directly and remove rate
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org