From e48e87eededdb1eadf9b8f4a17a02839e21c3a80 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Fri, 19 Jul 2013 17:00:53 +0200 Subject: [PATCH] Function should start with a capital letter to match the style of the existing functions --- PID_v1/PID_v1.cpp | 16 ++++++++-------- PID_v1/PID_v1.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PID_v1/PID_v1.cpp b/PID_v1/PID_v1.cpp index e5d1ba2..bfbad00 100644 --- a/PID_v1/PID_v1.cpp +++ b/PID_v1/PID_v1.cpp @@ -34,7 +34,7 @@ PID::PID(double* Input, double* Output, double* Setpoint, PID::SetControllerDirection(ControllerDirection); PID::SetTunings(Kp, Ki, Kd); - PID::setResolution(MILLIS); // Use a resolution of milliseconds by default + PID::SetResolution(MILLIS); // Use a resolution of milliseconds by default } @@ -47,7 +47,7 @@ PID::PID(double* Input, double* Output, double* Setpoint, bool PID::Compute() { if(!inAuto) return false; - unsigned long now = PID::getTime(); + unsigned long now = PID::GetTime(); timeChange = (now - lastTime); if(SampleTime == 0 || timeChange>=SampleTime) { @@ -203,27 +203,27 @@ void PID::SetControllerDirection(int Direction) controllerDirection = Direction; } -/* getTime()******************************************************************* +/* GetTime()******************************************************************* * Will get the current time either by using millis() or micros() ******************************************************************************/ -unsigned long PID::getTime() +unsigned long PID::GetTime() { if (secondsDivider == 1000.0) return millis(); return micros(); } -/* setResolution(...)********************************************************** - * Will set the resolution of getTime(). +/* SetResolution(...)********************************************************** + * Will set the resolution of GetTime(). * MILLIS will set the resolution to milliseconds while * MICROS will set the resolution to microseconds. ******************************************************************************/ -void PID::setResolution(int resolution) +void PID::SetResolution(int resolution) { if (resolution == MILLIS) secondsDivider = 1000.0; else secondsDivider = 1000000.0; - lastTime = PID::getTime()-SampleTime; // Update last time variable + lastTime = PID::GetTime()-SampleTime; // Update last time variable } /* Status Funcions************************************************************* diff --git a/PID_v1/PID_v1.h b/PID_v1/PID_v1.h index b19e636..a9a8005 100644 --- a/PID_v1/PID_v1.h +++ b/PID_v1/PID_v1.h @@ -43,7 +43,7 @@ class PID // once it is set in the constructor. void SetSampleTime(int); // * sets the frequency, in Milliseconds, with which // the PID calculation is performed. default is 100 - void setResolution(int); // * Set the resolution of the getTime() function. + void SetResolution(int); // * Set the resolution of the GetTime() function. // MILLIS sets the resolution to milliseconds. // MICROS sets the resolution to microseconds. @@ -58,7 +58,7 @@ class PID private: void Initialize(); - unsigned long getTime(); // * This will call either millis() or micros() + unsigned long GetTime(); // * This will call either millis() or micros() // depending on the used resolution. double dispKp; // * we'll hold on to the tuning parameters in user-entered