Updated PX4 use / API of low level GPIO and other hardware-centric system facilities

This commit is contained in:
Lorenz Meier
2016-05-28 14:56:17 +02:00
parent c2e2645c82
commit 7398164fcc
89 changed files with 1294 additions and 1087 deletions
+3 -3
View File
@@ -123,14 +123,14 @@ int UavcanBarometerBridge::ioctl(struct file *filp, int cmd, unsigned long arg)
return -EINVAL;
}
irqstate_t flags = irqsave();
irqstate_t flags = px4_enter_critical_section();
if (!_reports.resize(arg)) {
irqrestore(flags);
px4_leave_critical_section(flags);
return -ENOMEM;
}
irqrestore(flags);
px4_leave_critical_section(flags);
return OK;
}
+4 -4
View File
@@ -537,12 +537,12 @@ int UavcanNode::start(uavcan::NodeID node_id, uint32_t bitrate)
* fail during initialization.
*/
#if defined(GPIO_CAN1_RX)
stm32_configgpio(GPIO_CAN1_RX);
stm32_configgpio(GPIO_CAN1_TX);
px4_arch_configgpio(GPIO_CAN1_RX);
px4_arch_configgpio(GPIO_CAN1_TX);
#endif
#if defined(GPIO_CAN2_RX)
stm32_configgpio(GPIO_CAN2_RX | GPIO_PULLUP);
stm32_configgpio(GPIO_CAN2_TX);
px4_arch_configgpio(GPIO_CAN2_RX | GPIO_PULLUP);
px4_arch_configgpio(GPIO_CAN2_TX);
#endif
#if !defined(GPIO_CAN1_RX) && !defined(GPIO_CAN2_RX)
# error "Need to define GPIO_CAN1_RX and/or GPIO_CAN2_RX"