mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-29 11:40:28 +08:00
fix(nuttx): update mcp_gpio_dev_s initialization for NuttX 12.12
The mcp_gpio_dev_s / gpio_pin_dev_s struct layout changed in NuttX 12.12, so use designated initializers (.gp_pintype/.gp_ops) instead of positional initialization. Co-authored-by: marinauterion <224611774+marinauterion@users.noreply.github.com> Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
This commit is contained in:
1 parent
103a1501a4
commit
ece43d3c0c
1 file changed
+2
-2
@@ -106,10 +106,10 @@ int mcp230XX_register_gpios(uint8_t i2c_bus, uint8_t i2c_addr, int first_minor,
|
||||
|
||||
if (!_gpio[i].registered) {
|
||||
if (dir_mask & mask) {
|
||||
_gpio[i] = mcp_gpio_dev_s{{GPIO_INPUT_PIN, {}, (uintptr_t) &mcp_gpio_ops}, mask, false, nullptr};
|
||||
_gpio[i] = mcp_gpio_dev_s{{.gp_pintype = GPIO_INPUT_PIN, .gp_ops = &mcp_gpio_ops}, mask, false, nullptr};
|
||||
|
||||
} else {
|
||||
_gpio[i] = mcp_gpio_dev_s{{GPIO_OUTPUT_PIN, {}, (uintptr_t) &mcp_gpio_ops}, mask, false, nullptr};
|
||||
_gpio[i] = mcp_gpio_dev_s{{.gp_pintype = GPIO_OUTPUT_PIN, .gp_ops = &mcp_gpio_ops}, mask, false, nullptr};
|
||||
}
|
||||
|
||||
int ret = gpio_pin_register(&_gpio[i].gpio, first_minor + i);
|
||||
|
||||
Reference in new issue
Block a user