Copter: minor formatting fixes

No functional change
This commit is contained in:
Randy Mackay 2016-10-10 12:11:14 +09:00
parent 61fa73f25d
commit 3b6e56d1a0
1 changed files with 13 additions and 9 deletions

View File

@ -26,7 +26,7 @@ bool Copter::set_mode(control_mode_t mode, mode_reason_t reason)
return true;
}
switch(mode) {
switch (mode) {
case ACRO:
#if FRAME_CONFIG == HELI_FRAME
success = heli_acro_init(ignore_checks);
@ -141,7 +141,7 @@ bool Copter::set_mode(control_mode_t mode, mode_reason_t reason)
frsky_telemetry.update_control_mode(control_mode);
#endif
}else{
} else {
// Log error that we failed to enter desired flight mode
Log_Write_Error(ERROR_SUBSYSTEM_FLIGHT_MODE,mode);
}
@ -301,8 +301,9 @@ void Copter::exit_mode(control_mode_t old_control_mode, control_mode_t new_contr
}
// returns true or false whether mode requires GPS
bool Copter::mode_requires_GPS(control_mode_t mode) {
switch(mode) {
bool Copter::mode_requires_GPS(control_mode_t mode)
{
switch (mode) {
case AUTO:
case GUIDED:
case LOITER:
@ -320,8 +321,9 @@ bool Copter::mode_requires_GPS(control_mode_t mode) {
}
// mode_has_manual_throttle - returns true if the flight mode has a manual throttle (i.e. pilot directly controls throttle)
bool Copter::mode_has_manual_throttle(control_mode_t mode) {
switch(mode) {
bool Copter::mode_has_manual_throttle(control_mode_t mode)
{
switch (mode) {
case ACRO:
case STABILIZE:
return true;
@ -332,7 +334,8 @@ bool Copter::mode_has_manual_throttle(control_mode_t mode) {
// mode_allows_arming - returns true if vehicle can be armed in the specified mode
// arming_from_gcs should be set to true if the arming request comes from the ground station
bool Copter::mode_allows_arming(control_mode_t mode, bool arming_from_gcs) {
bool Copter::mode_allows_arming(control_mode_t mode, bool arming_from_gcs)
{
if (mode_has_manual_throttle(mode) || mode == LOITER || mode == ALT_HOLD || mode == POSHOLD || mode == DRIFT || mode == SPORT || mode == THROW || (arming_from_gcs && (mode == GUIDED || mode == GUIDED_NOGPS))) {
return true;
}
@ -340,8 +343,9 @@ bool Copter::mode_allows_arming(control_mode_t mode, bool arming_from_gcs) {
}
// notify_flight_mode - sets notify object based on flight mode. Only used for OreoLED notify device
void Copter::notify_flight_mode(control_mode_t mode) {
switch(mode) {
void Copter::notify_flight_mode(control_mode_t mode)
{
switch (mode) {
case AUTO:
case GUIDED:
case RTL: