-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
Probe for rm3100 #10581
Probe for rm3100 #10581
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,13 +117,14 @@ bool AP_Compass_RM3100::init() | |
ccy1 != CCP1_DEFAULT || ccy0 != CCP0_DEFAULT || | ||
ccz1 != CCP1_DEFAULT || ccz0 != CCP0_DEFAULT) { | ||
// couldn't read one of the cycle count registers or didn't recognize the default cycle count values | ||
goto fail; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change doesn't seem to do anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it just remove the goto that is useless |
||
// hal.console->printf("RM3100: Unable to read the register for whoami test\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Left-over? |
||
dev->get_semaphore()->give(); | ||
return false; | ||
} | ||
|
||
dev->setup_checked_registers(8); | ||
|
||
dev->write_register(RM3100_TMRC_REG, TMRC, true); // cycle count z | ||
dev->write_register(RM3100_CMM_REG, CMM, false); // CMM configuration | ||
dev->write_register(RM3100_CMM_REG, CMM, true); // CMM configuration | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have you flight tested the use of CMM? If so, can you please give a flight log? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use this code to test the sensors, and the reading looks fine and agree with other compass. Surely with wrong TMRC, it get back to default value . here are some logs with the RM3100 as compass2 with this code : https://drive.google.com/open?id=19pSJBCCyfYx-mhPedg6KyBzomxzbfQEy |
||
dev->write_register(RM3100_CCX1_REG, CCP1, true); // cycle count x | ||
dev->write_register(RM3100_CCX0_REG, CCP0, true); // cycle count x | ||
dev->write_register(RM3100_CCY1_REG, CCP1, true); // cycle count y | ||
|
@@ -141,7 +142,7 @@ bool AP_Compass_RM3100::init() | |
/* register the compass instance in the frontend */ | ||
compass_instance = register_compass(); | ||
|
||
printf("Found a RM3100 at address 0x%x as compass %u\n", dev->get_bus_address(), compass_instance); | ||
hal.console->printf("RM3100: Found at address 0x%x as compass %u\n", dev->get_bus_address(), compass_instance); | ||
|
||
set_rotation(compass_instance, rotation); | ||
|
||
|
@@ -157,10 +158,6 @@ bool AP_Compass_RM3100::init() | |
FUNCTOR_BIND_MEMBER(&AP_Compass_RM3100::timer, void)); | ||
|
||
return true; | ||
|
||
fail: | ||
dev->get_semaphore()->give(); | ||
return false; | ||
} | ||
|
||
void AP_Compass_RM3100::timer() | ||
|
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.
why are we probing interbal bus? for internal it should be an explicit line in hwdef.dat
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.
Excuse my lack of understanding but how does this differ from all the other internal i2c probes in this file?