Fixed number of stages bug.

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@282 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-11-17 13:59:48 +00:00
parent 5e29b31c8c
commit 553ebd04c1
3 changed files with 51 additions and 34 deletions

View File

@@ -1,7 +1,6 @@
- Display backlight unstable - Display backlight unstable
- Display cursor unstable - Display cursor unstable
- HW validation menu outdated/unfunctional - HW validation menu outdated/unfunctional
- NumberOfStages Macro for presets not implemented well. It will be ignored when generating DEFAULT presets
- repairMenu has bad reference to getmainrepairmenu - repairMenu has bad reference to getmainrepairmenu
@@ -9,3 +8,4 @@
FIXED FIXED
- PIN change verification not functional - PIN change verification not functional
- Multi-Language support added to menu. All strings/messages outsourced to dedicated file. MakeFile adapted - Multi-Language support added to menu. All strings/messages outsourced to dedicated file. MakeFile adapted
- NumberOfStages Macro for presets not implemented well. It will be ignored when generating DEFAULT presets

View File

@@ -55,6 +55,8 @@ ErrorStatus RepairPreset_generateDefaultPreset(struct RepairPreset* self, unsign
{ {
ErrorStatus returnValue = SUCCESS; ErrorStatus returnValue = SUCCESS;
int loopCounter;
if (presetNumber <= REPAIR_PRESET_MAX_ONE_STAGE_PRESETS) if (presetNumber <= REPAIR_PRESET_MAX_ONE_STAGE_PRESETS)
{ {
self->numberOfStages = 1; self->numberOfStages = 1;
@@ -68,25 +70,34 @@ ErrorStatus RepairPreset_generateDefaultPreset(struct RepairPreset* self, unsign
} }
else else
{ {
self->numberOfStages = 2; self->numberOfStages = REPAIR_PRESET_MAX_STAGES;
} }
} }
self->presetNumber = presetNumber; self->presetNumber = presetNumber;
self->preset[0].softstartDuration = 1800; self->preset[0].softstartDuration = 1800;
self->preset[0].duration = 28800; self->preset[0].duration = 28800;
if (PCBA_getInstance()->pcba == PCBA_CathodeMCP) if (PCBA_getInstance()->pcba == PCBA_CathodeMCP)
{ {
self->preset[0].voltage = -1000; for (loopCounter = 0; loopCounter < self->numberOfStages; loopCounter++)
self->preset[1].voltage = -1000; {
self->preset[loopCounter].softstartDuration = 1800;
self->preset[loopCounter].duration = 28800;
self->preset[loopCounter].voltage = -1000;
}
} }
else else
{ {
for (loopCounter = 0; loopCounter < self->numberOfStages; loopCounter++)
{
self->preset[loopCounter].softstartDuration = 1800;
self->preset[loopCounter].duration = 28800;
self->preset[0].voltage = 1000; self->preset[0].voltage = 1000;
self->preset[1].voltage = 1000;
} }
// Generate dummy presets to fill the memory
self->preset[1].softstartDuration = 1800; }
self->preset[1].duration = 28800;
return returnValue; return returnValue;
} }

View File

@@ -69,6 +69,8 @@ ErrorStatus SignalProfileGenerator_construct(struct SignalProfileGenerator* self
ErrorStatus returnValue = SUCCESS; ErrorStatus returnValue = SUCCESS;
if (!self->initialized) if (!self->initialized)
{
if (preset != NULL)
{ {
self->secondsCounter = 0; self->secondsCounter = 0;
self->currentPresetIndex = 0; self->currentPresetIndex = 0;
@@ -91,6 +93,11 @@ ErrorStatus SignalProfileGenerator_construct(struct SignalProfileGenerator* self
self->voltageHoldTimer = 0; self->voltageHoldTimer = 0;
self->voltagePriorToPause = 0; self->voltagePriorToPause = 0;
}
else
{
returnValue = ERROR;
}
} }
else else
@@ -109,7 +116,6 @@ void SignalProfileGenerator_destruct(struct SignalProfileGenerator* self)
void SignalProfileGenerator_calculate(struct SignalProfileGenerator* self) void SignalProfileGenerator_calculate(struct SignalProfileGenerator* self)
{ {
if (self->initialized) if (self->initialized)
{ {