From 6c0c5f524b1b00dd633a91e01db1d06cec62a8a8 Mon Sep 17 00:00:00 2001 From: uncrustify Date: Thu, 16 Aug 2012 23:20:38 -0700 Subject: [PATCH] uncrustify libraries/APM_PI/APM_PI.cpp --- libraries/APM_PI/APM_PI.cpp | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/libraries/APM_PI/APM_PI.cpp b/libraries/APM_PI/APM_PI.cpp index 14354c7df2..044d477edc 100644 --- a/libraries/APM_PI/APM_PI.cpp +++ b/libraries/APM_PI/APM_PI.cpp @@ -8,54 +8,54 @@ #include "APM_PI.h" const AP_Param::GroupInfo APM_PI::var_info[] PROGMEM = { - AP_GROUPINFO("P", 0, APM_PI, _kp, 0), - AP_GROUPINFO("I", 1, APM_PI, _ki, 0), - AP_GROUPINFO("IMAX", 2, APM_PI, _imax, 0), - AP_GROUPEND + AP_GROUPINFO("P", 0, APM_PI, _kp, 0), + AP_GROUPINFO("I", 1, APM_PI, _ki, 0), + AP_GROUPINFO("IMAX", 2, APM_PI, _imax, 0), + AP_GROUPEND }; int32_t APM_PI::get_p(int32_t error) { - return (float)error * _kp; + return (float)error * _kp; } int32_t APM_PI::get_i(int32_t error, float dt) { - if(dt != 0){ - _integrator += ((float)error * _ki) * dt; + if(dt != 0) { + _integrator += ((float)error * _ki) * dt; - if (_integrator < -_imax) { - _integrator = -_imax; - } else if (_integrator > _imax) { - _integrator = _imax; - } - } - return _integrator; + if (_integrator < -_imax) { + _integrator = -_imax; + } else if (_integrator > _imax) { + _integrator = _imax; + } + } + return _integrator; } int32_t APM_PI::get_pi(int32_t error, float dt) { - return get_p(error) + get_i(error, dt); + return get_p(error) + get_i(error, dt); } void APM_PI::reset_I() { - _integrator = 0; + _integrator = 0; } void APM_PI::load_gains() { - _kp.load(); - _ki.load(); - _imax.load(); + _kp.load(); + _ki.load(); + _imax.load(); } void APM_PI::save_gains() { - _kp.save(); - _ki.save(); - _imax.save(); + _kp.save(); + _ki.save(); + _imax.save(); }