From 7da0daa9d08558fc39d48fc03d4afa059f69e685 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Thu, 27 Oct 2011 16:30:15 -0400 Subject: [PATCH] Adding bash formatting script using astyle. --- Tools/scripts/format.sh | 11 +++++++++++ libraries/APO/AP_Controller.cpp | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 Tools/scripts/format.sh diff --git a/Tools/scripts/format.sh b/Tools/scripts/format.sh new file mode 100755 index 0000000000..67d00a4c0c --- /dev/null +++ b/Tools/scripts/format.sh @@ -0,0 +1,11 @@ +#!/bin/bash +function format { + DIR=$1 + find $DIR -regex ".*\.\(h\|cpp\|pde\)" -exec astyle {} \; + find $DIR -regex ".*\.\(h\|cpp\|pde\)" -exec rm {}.orig \; +} + +format apo +format ArduRover +format ArduBoat +format libraries/APO diff --git a/libraries/APO/AP_Controller.cpp b/libraries/APO/AP_Controller.cpp index dca385c29b..48c6f6e475 100644 --- a/libraries/APO/AP_Controller.cpp +++ b/libraries/APO/AP_Controller.cpp @@ -35,10 +35,10 @@ void AP_Controller::setAllRadioChannelsToNeutral() { } void AP_Controller::setAllRadioChannelsManually() { - //_hal->debug->printf_P(PSTR("\tsize: %d\n"),_hal->rc.getSize()); + //_hal->debug->printf_P(PSTR("\tsize: %d\n"),_hal->rc.getSize()); for (uint8_t i = 0; i < _hal->rc.getSize(); i++) { _hal->rc[i]->setUsingRadio(); - //_hal->debug->printf_P(PSTR("\trc %d: %f\n"),i,_hal->rc[i]->getPosition()); + //_hal->debug->printf_P(PSTR("\trc %d: %f\n"),i,_hal->rc[i]->getPosition()); } } @@ -102,7 +102,7 @@ void AP_Controller::setMotors() { case MAV_STATE_ACTIVE: { digitalWrite(_hal->aLedPin, HIGH); setMotorsActive(); - break; + break; } case MAV_STATE_EMERGENCY: { digitalWrite(_hal->aLedPin, LOW);