Browse Source

orb nuttx: add irqsave() guard around 64bit timestamp readout

sbg
Beat Küng 9 years ago committed by Lorenz Meier
parent
commit
825d754036
  1. 9
      src/modules/uORB/uORBDevices_nuttx.cpp

9
src/modules/uORB/uORBDevices_nuttx.cpp

@ -267,9 +267,12 @@ uORB::DeviceNode::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -267,9 +267,12 @@ uORB::DeviceNode::ioctl(struct file *filp, int cmd, unsigned long arg)
SubscriberData *sd = filp_to_sd(filp);
switch (cmd) {
case ORBIOCLASTUPDATE:
*(hrt_abstime *)arg = _last_update;
return OK;
case ORBIOCLASTUPDATE: {
irqstate_t state = irqsave();
*(hrt_abstime *)arg = _last_update;
irqrestore(state);
return OK;
}
case ORBIOCUPDATED:
*(bool *)arg = appears_updated(sd);

Loading…
Cancel
Save