const + fwd declare pid things (#1024)
This commit is contained in:
parent
1ad5b55dbb
commit
3514eb313e
|
@ -12,6 +12,7 @@
|
|||
#include "os_access.h"
|
||||
#include "pid.h"
|
||||
#include "math.h"
|
||||
#include "engine_configuration_generated_structures.h"
|
||||
|
||||
Pid::Pid() {
|
||||
initPidClass(NULL);
|
||||
|
@ -28,7 +29,7 @@ void Pid::initPidClass(pid_s *parameters) {
|
|||
reset();
|
||||
}
|
||||
|
||||
bool Pid::isSame(pid_s *parameters) const {
|
||||
bool Pid::isSame(const pid_s *parameters) const {
|
||||
efiAssert(OBD_PCM_Processor_Fault, this->parameters != NULL, "PID::isSame invalid", false);
|
||||
efiAssert(OBD_PCM_Processor_Fault, parameters != NULL, "PID::isSame NULL", false);
|
||||
return this->parameters->pFactor == parameters->pFactor
|
||||
|
@ -153,7 +154,7 @@ void Pid::sleep() {
|
|||
#endif /* EFI_UNIT_TEST */
|
||||
}
|
||||
|
||||
void Pid::showPidStatus(Logging *logging, const char*msg) {
|
||||
void Pid::showPidStatus(Logging *logging, const char*msg) const {
|
||||
scheduleMsg(logging, "%s settings: offset=%f P=%.5f I=%.5f D=%.5f period=%dms",
|
||||
msg,
|
||||
getOffset(),
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#ifndef PID_H_
|
||||
#define PID_H_
|
||||
|
||||
#include "global.h"
|
||||
#include "engine_configuration_generated_structures.h"
|
||||
#include "engine_state_generated.h"
|
||||
#include "pid_state_generated.h"
|
||||
|
||||
|
@ -30,13 +28,16 @@
|
|||
|
||||
#define MS2SEC(x) (x * 0.001)
|
||||
|
||||
struct pid_s;
|
||||
class Logging;
|
||||
|
||||
class Pid : public pid_state_s {
|
||||
|
||||
public:
|
||||
Pid();
|
||||
explicit Pid(pid_s *parameters);
|
||||
void initPidClass(pid_s *parameters);
|
||||
bool isSame(pid_s *parameters) const;
|
||||
bool isSame(const pid_s *parameters) const;
|
||||
|
||||
/**
|
||||
* This version of the method takes dTime from pid_s
|
||||
|
@ -62,7 +63,7 @@ public:
|
|||
void postState(TunerStudioOutputChannels *tsOutputChannels);
|
||||
void postState(TunerStudioOutputChannels *tsOutputChannels, int pMult);
|
||||
#endif /* EFI_TUNER_STUDIO */
|
||||
void showPidStatus(Logging *logging, const char*msg);
|
||||
void showPidStatus(Logging *logging, const char*msg) const;
|
||||
void sleep();
|
||||
int resetCounter;
|
||||
// todo: move this to pid_s one day
|
||||
|
|
Loading…
Reference in New Issue