mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-25 10:08:28 -04:00
uncrustify ArduPlane/planner.pde
This commit is contained in:
parent
a8e5900624
commit
d0ed723c1e
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
// These are function definitions so the Menu can be constructed before the functions
|
// These are function definitions so the Menu can be constructed before the functions
|
||||||
// are defined below. Order matters to the compiler.
|
// are defined below. Order matters to the compiler.
|
||||||
static int8_t planner_gcs(uint8_t argc, const Menu::arg *argv);
|
static int8_t planner_gcs(uint8_t argc, const Menu::arg *argv);
|
||||||
|
|
||||||
// Creates a constant array of structs representing menu options
|
// Creates a constant array of structs representing menu options
|
||||||
// and stores them in Flash memory, not RAM.
|
// and stores them in Flash memory, not RAM.
|
||||||
// User enters the string in the console to call the functions on the right.
|
// User enters the string in the console to call the functions on the right.
|
||||||
// See class Menu in AP_Common for implementation details
|
// See class Menu in AP_Common for implementation details
|
||||||
static const struct Menu::command planner_menu_commands[] PROGMEM = {
|
static const struct Menu::command planner_menu_commands[] PROGMEM = {
|
||||||
{"gcs", planner_gcs},
|
{"gcs", planner_gcs},
|
||||||
};
|
};
|
||||||
|
|
||||||
// A Macro to create the Menu
|
// A Macro to create the Menu
|
||||||
@ -18,36 +18,36 @@ MENU(planner_menu, "planner", planner_menu_commands);
|
|||||||
static int8_t
|
static int8_t
|
||||||
planner_mode(uint8_t argc, const Menu::arg *argv)
|
planner_mode(uint8_t argc, const Menu::arg *argv)
|
||||||
{
|
{
|
||||||
Serial.printf_P(PSTR("Planner Mode\n\nThis mode is not intended for manual use\n\n"));
|
Serial.printf_P(PSTR("Planner Mode\n\nThis mode is not intended for manual use\n\n"));
|
||||||
planner_menu.run();
|
planner_menu.run();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static int8_t
|
static int8_t
|
||||||
planner_gcs(uint8_t argc, const Menu::arg *argv)
|
planner_gcs(uint8_t argc, const Menu::arg *argv)
|
||||||
{
|
{
|
||||||
gcs0.init(&Serial);
|
gcs0.init(&Serial);
|
||||||
|
|
||||||
#if USB_MUX_PIN < 0
|
#if USB_MUX_PIN < 0
|
||||||
// we don't have gcs3 if we have the USB mux setup
|
// we don't have gcs3 if we have the USB mux setup
|
||||||
gcs3.init(&Serial3);
|
gcs3.init(&Serial3);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int16_t loopcount = 0;
|
int16_t loopcount = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (millis()-fast_loopTimer_ms > 19) {
|
if (millis()-fast_loopTimer_ms > 19) {
|
||||||
fast_loopTimer_ms = millis();
|
fast_loopTimer_ms = millis();
|
||||||
|
|
||||||
gcs_update();
|
gcs_update();
|
||||||
|
|
||||||
read_radio();
|
read_radio();
|
||||||
|
|
||||||
gcs_data_stream_send();
|
gcs_data_stream_send();
|
||||||
if ((loopcount % 16) == 0) { // 3 hz
|
if ((loopcount % 16) == 0) { // 3 hz
|
||||||
gcs_send_message(MSG_HEARTBEAT);
|
gcs_send_message(MSG_HEARTBEAT);
|
||||||
}
|
}
|
||||||
loopcount++;
|
loopcount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user