auto-sync

This commit is contained in:
rusEfi 2015-02-27 19:09:56 -06:00
parent 8ebb83b92a
commit cf287775d4
10 changed files with 34 additions and 12 deletions

View File

@ -47,16 +47,19 @@ void MenuTree::nextItem(void) {
topVisible = topVisible->next;
}
MenuItem::MenuItem(MenuItem * parent, const char *text, VoidCallback callback) : MenuItem(parent, LL_STRING, text, callback) {
MenuItem::MenuItem(MenuItem * parent, const char *text, VoidCallback callback) {
baseConstructor(parent, LL_STRING, text, callback);
}
MenuItem::MenuItem(MenuItem * parent, const char *text) : MenuItem(parent, LL_STRING, text, NULL) {
MenuItem::MenuItem(MenuItem * parent, const char *text) {
baseConstructor(parent, LL_STRING, text, NULL);
}
MenuItem::MenuItem(MenuItem * parent, lcd_line_e lcdLine) : MenuItem(parent, lcdLine, NULL, NULL) {
MenuItem::MenuItem(MenuItem * parent, lcd_line_e lcdLine) {
baseConstructor(parent, lcdLine, NULL, NULL);
}
MenuItem::MenuItem(MenuItem * parent, lcd_line_e lcdLine, const char *text, VoidCallback callback) {
void MenuItem::baseConstructor(MenuItem * parent, lcd_line_e lcdLine, const char *text, VoidCallback callback) {
this->parent = parent;
this->lcdLine = lcdLine;
this->text = text;

View File

@ -42,7 +42,7 @@ typedef void (*VoidCallback)(void);
class MenuItem {
public:
MenuItem(MenuItem * parent, lcd_line_e lcdLine, const char *text, VoidCallback callback);
void baseConstructor(MenuItem * parent, lcd_line_e lcdLine, const char *text, VoidCallback callback);
MenuItem(MenuItem * parent, const char *text, VoidCallback callback);
MenuItem(MenuItem * parent, const char *text);
MenuItem(MenuItem * parent, lcd_line_e lcdLine);

View File

@ -21,13 +21,18 @@ void single_wave_s::init(pin_state_t *pinStates) {
this->pinStates = pinStates;
}
multi_wave_s::multi_wave_s() {
void multi_wave_s::baseConstructor() {
waves = NULL;
switchTimes = NULL;
reset();
}
multi_wave_s::multi_wave_s(float *switchTimes, single_wave_s *waves) : multi_wave_s() {
multi_wave_s::multi_wave_s() {
baseConstructor();
}
multi_wave_s::multi_wave_s(float *switchTimes, single_wave_s *waves) {
baseConstructor();
init(switchTimes, waves);
}

View File

@ -39,6 +39,7 @@ class TriggerShape;
class multi_wave_s {
public:
void baseConstructor();
multi_wave_s();
multi_wave_s(float *st, single_wave_s *waves);
void init(float *st, single_wave_s *waves);

View File

@ -22,8 +22,7 @@ SimplePwm::SimplePwm() {
sr[0] = waveInstance;
init(_switchTimes, sr);
}
PwmConfig::PwmConfig() {
void PwmConfig::baseConstructor() {
memset(&scheduling, 0, sizeof(scheduling));
memset(&safe, 0, sizeof(safe));
scheduling.name = "PwmConfig";
@ -34,7 +33,12 @@ PwmConfig::PwmConfig() {
stateChangeCallback = NULL;
}
PwmConfig::PwmConfig(float *st, single_wave_s *waves) : PwmConfig() {
PwmConfig::PwmConfig() {
baseConstructor();
}
PwmConfig::PwmConfig(float *st, single_wave_s *waves) {
baseConstructor();
multiWave.init(st, waves);
}

View File

@ -43,6 +43,7 @@ class PwmConfig {
public:
PwmConfig();
PwmConfig(float *switchTimes, single_wave_s *waves);
void baseConstructor();
void init(float *switchTimes, single_wave_s *waves);
void weComplexInit(const char *msg,

View File

@ -28,6 +28,7 @@ AdcDevice::AdcDevice(ADCConversionGroup* hwConfig) {
hwConfig->sqr1 = 0;
hwConfig->sqr2 = 0;
hwConfig->sqr3 = 0;
memset(hardwareIndexByIndernalAdcIndex, 0, sizeof(hardwareIndexByIndernalAdcIndex));
memset(internalAdcIndexByHardwareIndex, 0xFFFFFFFF, sizeof(internalAdcIndexByHardwareIndex));
}

View File

@ -386,7 +386,7 @@ void initIntermediateLoggingBuffer(void) {
#endif /* ! EFI_UNIT_TEST */
Logging::Logging() {
void Logging::baseConstructor() {
name = NULL;
buffer = NULL;
linePointer = NULL;
@ -394,7 +394,12 @@ Logging::Logging() {
isInitialized = false;
}
Logging::Logging(char const *name, char *buffer, int bufferSize) : Logging() {
Logging::Logging() {
baseConstructor();
}
Logging::Logging(char const *name, char *buffer, int bufferSize) {
baseConstructor();
#if ! EFI_UNIT_TEST
initLoggingExt(this, "settings control", buffer, bufferSize);
#endif /* ! EFI_UNIT_TEST */

View File

@ -18,6 +18,7 @@
// size of buffers?
class Logging {
public:
void baseConstructor();
Logging();
Logging(const char *name, char *buffer, int bufferSize);
const char *name;

View File

@ -11,6 +11,7 @@
IntListenerArray::IntListenerArray() {
currentListenersCount = 0;
memset(&args, 0, sizeof(args));
memset(&callbacks, 0, sizeof(callbacks));
}
void IntListenerArray::registerCallback(VoidInt handler, void *arg) {