-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sensors): Share sync line control bitmasks #799
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely want to get these prints out. Also wait why &= 0xff ^ thing
rather than &= ~thing
?
[[nodiscard]] auto mask_satisfied() const -> bool { | ||
if (set_sync_required_mask != | ||
static_cast<uint8_t>(SensorIdBitMask::UNUSED)) { | ||
printf("%x is required\n", set_sync_required_mask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm don't like these even they compile out
|
||
auto reset_sync(can::ids::SensorId sensor) -> void { | ||
// force the bit for this sensor to 0 | ||
sync_state_mask &= 0xFF ^ get_mask_from_id(sensor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync_state_mask &= 0xFF ^ get_mask_from_id(sensor); | |
sync_state_mask &= ~get_mask_from_id(sensor); |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the more common way I've seen, anyway
69683e8
to
5d1fa27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
I had been mistaken about the sensor hardware being shared instances but I see now that they were not, so I broke out the bitmask communication between sensor tasks into another singleton that the sensor hardware tasks can share.
I also updated the tests so that when we test with multiple sensors they actually use two different hardware instances.