diff --git a/ArduCopter/test.pde b/ArduCopter/test.pde index b64a069ccb..285644c1e5 100644 --- a/ArduCopter/test.pde +++ b/ArduCopter/test.pde @@ -60,7 +60,7 @@ const struct Menu::command test_menu_commands[] PROGMEM = { // {"failsafe", test_failsafe}, // {"stabilize", test_stabilize}, {"gps", test_gps}, -#if HIL_MODE != HIL_MODE_ATTITUDE +#if HIL_MODE != HIL_MODE_ATTITUDE && CONFIG_ADC == ENABLED // {"adc", test_adc}, #endif {"ins", test_ins}, @@ -77,7 +77,9 @@ const struct Menu::command test_menu_commands[] PROGMEM = { #if HIL_MODE != HIL_MODE_ATTITUDE {"altitude", test_baro}, #endif +#if CONFIG_SONAR == ENABLED {"sonar", test_sonar}, +#endif //{"compass", test_mag}, #ifdef OPTFLOW_ENABLED {"optflow", test_optflow}, @@ -393,7 +395,8 @@ static int8_t } */ -/*#if HIL_MODE != HIL_MODE_ATTITUDE + +/*#if HIL_MODE != HIL_MODE_ATTITUDE && CONFIG_ADC == ENABLED static int8_t //test_adc(uint8_t argc, const Menu::arg *argv) { @@ -401,6 +404,10 @@ static int8_t Serial.printf_P(PSTR("ADC\n")); delay(1000); + adc.Init(&timer_scheduler); + + delay(50); + while(1){ for(int i = 0; i < 9; i++){ Serial.printf_P(PSTR("%u,"),adc.Ch(i)); @@ -937,6 +944,7 @@ static int8_t /* test the sonar */ +#if CONFIG_SONAR == ENABLED static int8_t test_sonar(uint8_t argc, const Menu::arg *argv) { @@ -959,6 +967,7 @@ test_sonar(uint8_t argc, const Menu::arg *argv) return (0); } +#endif #ifdef OPTFLOW_ENABLED static int8_t