Commit for SWO for HW validation menu updates

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@245 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-10 12:46:41 +00:00
parent a73154a5e6
commit a688a6549a
19 changed files with 720 additions and 89 deletions

View File

@@ -61,7 +61,9 @@
static void repairProcess_task(void* parameters);
static void calculateSoftStartStep (uint32_t currentTime, uint32_t softStartDuration, int targetVoltage, uint16_t* dacValue);
static void SignalProfileGenerator();
// -----------------------------------------------------------------------------
// Function definitions
@@ -209,24 +211,24 @@ static void repairProcess_task(void* parameters)
{
// Perform softstart / ramp-up
if (PCBA_getInstance()->pcba == Tesla)
{
// Tesla repair only runs ADC row2 and DAC row2
calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow2);
LOGGER_DEBUG(mainLog, "Softstart running -> new target is %x", voltageRow2);
MAX5715Channel_setValue(self->dacRow2, voltageRow2);
}
else if ((PCBA_getInstance()->pcba == Anode) || (PCBA_getInstance()->pcba == CathodeMCP))
{
calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow1);
calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow2);
calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow3);
LOGGER_DEBUG(mainLog, "Softstart running -> new target is %x %x %x", voltageRow1, voltageRow2, voltageRow3);
MAX5715Channel_setValue(self->dacRow1, voltageRow1);
MAX5715Channel_setValue(self->dacRow2, voltageRow2);
MAX5715Channel_setValue(self->dacRow3, voltageRow3);
}
// if (PCBA_getInstance()->pcba == Tesla)
// {
// // Tesla repair only runs ADC row2 and DAC row2
// calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow2);
// LOGGER_DEBUG(mainLog, "Softstart running -> new target is %x", voltageRow2);
// MAX5715Channel_setValue(self->dacRow2, voltageRow2);
// }
// else if ((PCBA_getInstance()->pcba == Anode) || (PCBA_getInstance()->pcba == CathodeMCP))
// {
// calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow1);
// calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow2);
// calculateSoftStartStep(self->secondsCounter, softStartTimer, voltageTarget, &voltageRow3);
// LOGGER_DEBUG(mainLog, "Softstart running -> new target is %x %x %x", voltageRow1, voltageRow2, voltageRow3);
//
// MAX5715Channel_setValue(self->dacRow1, voltageRow1);
// MAX5715Channel_setValue(self->dacRow2, voltageRow2);
// MAX5715Channel_setValue(self->dacRow3, voltageRow3);
// }
// Check for end of softstart
if (softStartTimer < self->secondsCounter)
@@ -282,6 +284,12 @@ static void repairProcess_task(void* parameters)
// A next stage is available
presetIndex++;
self->currentState = PREPARE;
LOGGER_DEBUG(mainLog, "Another stage is available");
}
else
{
self->currentState = FINISHED;
LOGGER_DEBUG(mainLog, "last stage reached");
}
break;
}
@@ -313,13 +321,4 @@ static void repairProcess_task(void* parameters)
}
static void calculateSoftStartStep (uint32_t currentTime, uint32_t softStartDuration, int targetVoltage, uint16_t* dacValue)
{
int value;
value = ((currentTime * 1000) / softStartDuration) * targetVoltage;
value = value / 1000;
*dacValue = (uint16_t)value;
}