mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 19:44:07 +08:00
fixed compatability with mcp23009. (naming of instantiated GPIO-Devices)
This commit is contained in:
parent
845a2d3632
commit
ce81da0c8a
@ -22,7 +22,7 @@ netman update_default -i eth0
|
||||
|
||||
safety_button start
|
||||
|
||||
# GPIO Expander driver on external I2C3
|
||||
GPIO Expander driver on external I2C3
|
||||
if ver hwbasecmp 009 010 011
|
||||
then
|
||||
# No USB
|
||||
|
||||
@ -282,9 +282,17 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
|
||||
# endif /* CONFIG_MMCSD */
|
||||
|
||||
ret = mcp23009_register_gpios(3, 0x25);
|
||||
ret |= mcp23017_register_gpios(2, 0x27, 0, 0x0000);
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int offset = 8; // This is the offset for the naming of the instatiated GPIO-DEVICES.
|
||||
uint16_t pin_types = 0x0000;// Set pin type. Set bit to 1 to mark pin as INPUT, set to 0 to mark as OUTPUT
|
||||
|
||||
ret = mcp23017_register_gpios(2, 0x27, offset, pin_types);
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
@ -295,3 +303,5 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user