-
Notifications
You must be signed in to change notification settings - Fork 53
As5600 #798
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
base: main
Are you sure you want to change the base?
Conversation
@brief Destructor for an AS5600 sensor. | ||
*/ | ||
/*******************************************************************************/ | ||
~WipperSnapper_I2C_Driver_AS5600() { delete _as5600; } |
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.
never called, check reinit of same sensor without reboot!
Otherwise if issues then check object in begin and delete if necessary
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.
Before deleting like this, check that the object does not refer to a nullptr otherwise it'll crash.
Something like this would check if the ptr == nullptr
if (_as5600)
delete _as5600;
Note to self - Do not merge without testing reinitialising the as5600 |
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.
@tyeth Requesting two changes
@brief Destructor for an AS5600 sensor. | ||
*/ | ||
/*******************************************************************************/ | ||
~WipperSnapper_I2C_Driver_AS5600() { delete _as5600; } |
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.
Before deleting like this, check that the object does not refer to a nullptr otherwise it'll crash.
Something like this would check if the ptr == nullptr
if (_as5600)
delete _as5600;
*/ | ||
/*******************************************************************************/ | ||
bool getEventRaw(sensors_event_t *rawEvent) { | ||
ulong start = millis(); |
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.
Unused variable, start
As mentioned in the MLX pull request, I believe (not verified 100%) the destructors are not being called, due to the |
Adds the magnetic angle sensor.
Worth noting the device zeros on reset/init.
Not sure my angular calculation from the "scaled" value correctly gives 0-359 which I think is what's expected.
Also didn't have a great magnet for testing, but did see rotation, and returning to approximate expected angle