More GPIO and general pin assignment fixes.

This commit is contained in:
px4dev
2013-07-10 23:50:37 -07:00
parent f27491d2e5
commit f5b91e109d
3 changed files with 28 additions and 15 deletions
+9 -3
View File
@@ -227,7 +227,6 @@ ADC::init()
if ((hrt_absolute_time() - now) > 500) {
log("sample timeout");
return -1;
return 0xffff;
}
}
@@ -282,7 +281,7 @@ ADC::close_last(struct file *filp)
void
ADC::_tick_trampoline(void *arg)
{
((ADC *)arg)->_tick();
(reinterpret_cast<ADC *>(arg))->_tick();
}
void
@@ -366,8 +365,15 @@ int
adc_main(int argc, char *argv[])
{
if (g_adc == nullptr) {
/* XXX this hardcodes the default channel set for PX4FMU - should be configurable */
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
/* XXX this hardcodes the default channel set for PX4FMUv1 - should be configurable */
g_adc = new ADC((1 << 10) | (1 << 11) | (1 << 12) | (1 << 13));
#endif
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V2
/* XXX this hardcodes the default channel set for PX4FMUv2 - should be configurable */
g_adc = new ADC((1 << 2) | (1 << 3) | (1 << 4) |
(1 << 10) | (1 << 11) | (1 << 12) | (1 << 13) | (1 << 14) | (1 << 15));
#endif
if (g_adc == nullptr)
errx(1, "couldn't allocate the ADC driver");