Added ADC channel definitions to the board_config.h file. This way new boards with different ADC channel sets can still use the Px4 adc.c driver.

This commit is contained in:
ksschwabe
2015-07-10 17:03:22 +02:00
parent 5013c65e0d
commit b528e1f593
4 changed files with 23 additions and 13 deletions
+2 -13
View File
@@ -410,19 +410,8 @@ int
adc_main(int argc, char *argv[])
{
if (g_adc == nullptr) {
#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
#ifdef CONFIG_ARCH_BOARD_AEROCORE
/* XXX this hardcodes the default channel set for AeroCore - should be configurable */
g_adc = new ADC((1 << 10) | (1 << 11) | (1 << 12) | (1 << 13));
#endif
/* XXX this hardcodes the default channel set for the board in board_config.h - should be configurable */
g_adc = new ADC(ADC_CHANNELS);
if (g_adc == nullptr)
errx(1, "couldn't allocate the ADC driver");