mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-24 09:38:29 -04:00
purple: fixed CLI code for non-ADC hardware and no sonar
purple hardware does not use the ADC driver
This commit is contained in:
parent
63393b206a
commit
c2972ff1f9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user