pid: rename structure components for style

Rename the struct components to camelCase.

Change-Id: I0e76c4bd5aed0ec2d78edd31ddef66f852ddc71e
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/pid/ec/pid.cpp b/pid/ec/pid.cpp
index 1ded7ac..6c70bbe 100644
--- a/pid/ec/pid.cpp
+++ b/pid/ec/pid.cpp
@@ -54,21 +54,22 @@
 
     // Pid
     error = setpoint - input;
-    p_term = pidinfoptr->p_c * error;
+    p_term = pidinfoptr->proportionalCoeff * error;
 
     // pId
-    if (0.0f != pidinfoptr->i_c)
+    if (0.0f != pidinfoptr->integralCoeff)
     {
         i_term = pidinfoptr->integral;
-        i_term += error * pidinfoptr->i_c * pidinfoptr->ts;
-        i_term = clamp(i_term, pidinfoptr->i_lim.min, pidinfoptr->i_lim.max);
+        i_term += error * pidinfoptr->integralCoeff * pidinfoptr->ts;
+        i_term = clamp(i_term, pidinfoptr->integralLimit.min,
+                       pidinfoptr->integralLimit.max);
     }
 
     // FF
-    ff_term = (setpoint + pidinfoptr->ff_off) * pidinfoptr->ff_gain;
+    ff_term = (setpoint + pidinfoptr->feedFwdOffset) * pidinfoptr->feedFwdGain;
 
     output = p_term + i_term + ff_term;
-    output = clamp(output, pidinfoptr->out_lim.min, pidinfoptr->out_lim.max);
+    output = clamp(output, pidinfoptr->outLim.min, pidinfoptr->outLim.max);
 
     // slew rate
     // TODO(aarena) - Simplify logic as Andy suggested by creating dynamic
@@ -76,28 +77,28 @@
     // to those instead of effectively clamping twice.
     if (pidinfoptr->initialized)
     {
-        if (pidinfoptr->slew_neg != 0.0f)
+        if (pidinfoptr->slewNeg != 0.0f)
         {
             // Don't decrease too fast
             double min_out =
-                pidinfoptr->last_output + pidinfoptr->slew_neg * pidinfoptr->ts;
+                pidinfoptr->lastOutput + pidinfoptr->slewNeg * pidinfoptr->ts;
             if (output < min_out)
             {
                 output = min_out;
             }
         }
-        if (pidinfoptr->slew_pos != 0.0f)
+        if (pidinfoptr->slewPos != 0.0f)
         {
             // Don't increase too fast
             double max_out =
-                pidinfoptr->last_output + pidinfoptr->slew_pos * pidinfoptr->ts;
+                pidinfoptr->lastOutput + pidinfoptr->slewPos * pidinfoptr->ts;
             if (output > max_out)
             {
                 output = max_out;
             }
         }
 
-        if (pidinfoptr->slew_neg != 0.0f || pidinfoptr->slew_pos != 0.0f)
+        if (pidinfoptr->slewNeg != 0.0f || pidinfoptr->slewPos != 0.0f)
         {
             // Back calculate integral term for the cases where we limited the
             // output
@@ -107,10 +108,11 @@
 
     // Clamp again because having limited the output may result in a
     // larger integral term
-    i_term = clamp(i_term, pidinfoptr->i_lim.min, pidinfoptr->i_lim.max);
+    i_term = clamp(i_term, pidinfoptr->integralLimit.min,
+                   pidinfoptr->integralLimit.max);
     pidinfoptr->integral = i_term;
     pidinfoptr->initialized = true;
-    pidinfoptr->last_output = output;
+    pidinfoptr->lastOutput = output;
 
     return output;
 }
diff --git a/pid/ec/pid.hpp b/pid/ec/pid.hpp
index 3ab64cd..432e043 100644
--- a/pid/ec/pid.hpp
+++ b/pid/ec/pid.hpp
@@ -18,19 +18,19 @@
 {
     bool initialized; // has pid been initialized
 
-    double ts;          // sample time in seconds
-    double integral;    // intergal of error
-    double last_output; // value of last output
+    double ts;         // sample time in seconds
+    double integral;   // intergal of error
+    double lastOutput; // value of last output
 
-    double p_c;     // coeff for P
-    double i_c;     // coeff for I
-    double ff_off;  // offset coeff for feed-forward term
-    double ff_gain; // gain for feed-forward term
+    double proportionalCoeff; // coeff for P
+    double integralCoeff;     // coeff for I
+    double feedFwdOffset;     // offset coeff for feed-forward term
+    double feedFwdGain;       // gain for feed-forward term
 
-    limits_t i_lim;   // clamp of integral
-    limits_t out_lim; // clamp of output
-    double slew_neg;
-    double slew_pos;
+    limits_t integralLimit; // clamp of integral
+    limits_t outLim;        // clamp of output
+    double slewNeg;
+    double slewPos;
     double positiveHysteresis;
     double negativeHysteresis;
 } pid_info_t;