git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@282 05563f52-14a8-4384-a975-3d1654cca0fa
124 lines
3.5 KiB
C
124 lines
3.5 KiB
C
// -----------------------------------------------------------------------------
|
|
/// @file RepairPreset.c
|
|
/// @brief File description
|
|
// -----------------------------------------------------------------------------
|
|
// Micro-Key bv
|
|
// Industrieweg 28, 9804 TG Noordhorn
|
|
// Postbus 92, 9800 AB Zuidhorn
|
|
// The Netherlands
|
|
// Tel: +31 594 503020
|
|
// Fax: +31 594 505825
|
|
// Email: support@microkey.nl
|
|
// Web: www.microkey.nl
|
|
// -----------------------------------------------------------------------------
|
|
/// $Revision$
|
|
/// $Author$
|
|
/// $Date$
|
|
// (c) 2015 Micro-Key bv
|
|
// -----------------------------------------------------------------------------
|
|
|
|
/// @defgroup {group_name} {group_description}
|
|
/// Description
|
|
|
|
/// @file RepairPreset.c
|
|
/// @ingroup {group_name}
|
|
|
|
#ifndef REPAIRPRESET_C_
|
|
#define REPAIRPRESET_C_
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Include files
|
|
// -----------------------------------------------------------------------------
|
|
|
|
#include "RepairPreset.h"
|
|
|
|
#include "PCBA.h"
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Constant and macro definitions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Type definitions.
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Function declarations
|
|
// -----------------------------------------------------------------------------
|
|
|
|
ErrorStatus RepairPreset_generateDefaultPreset(struct RepairPreset* self, unsigned int presetNumber)
|
|
{
|
|
ErrorStatus returnValue = SUCCESS;
|
|
|
|
int loopCounter;
|
|
|
|
if (presetNumber <= REPAIR_PRESET_MAX_ONE_STAGE_PRESETS)
|
|
{
|
|
self->numberOfStages = 1;
|
|
}
|
|
else
|
|
{
|
|
// TELSA PCBA does not need multiple stages
|
|
if (PCBA_getInstance()->pcba == PCBA_Tesla)
|
|
{
|
|
self->numberOfStages = 1;
|
|
}
|
|
else
|
|
{
|
|
self->numberOfStages = REPAIR_PRESET_MAX_STAGES;
|
|
}
|
|
}
|
|
|
|
self->presetNumber = presetNumber;
|
|
self->preset[0].softstartDuration = 1800;
|
|
self->preset[0].duration = 28800;
|
|
|
|
if (PCBA_getInstance()->pcba == PCBA_CathodeMCP)
|
|
{
|
|
for (loopCounter = 0; loopCounter < self->numberOfStages; loopCounter++)
|
|
{
|
|
self->preset[loopCounter].softstartDuration = 1800;
|
|
self->preset[loopCounter].duration = 28800;
|
|
self->preset[loopCounter].voltage = -1000;
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
for (loopCounter = 0; loopCounter < self->numberOfStages; loopCounter++)
|
|
{
|
|
self->preset[loopCounter].softstartDuration = 1800;
|
|
self->preset[loopCounter].duration = 28800;
|
|
self->preset[0].voltage = 1000;
|
|
}
|
|
|
|
}
|
|
|
|
return returnValue;
|
|
}
|
|
|
|
|
|
void RepairPreset_setSoftstartValue(struct RepairPresetParameters* self, unsigned int value)
|
|
{
|
|
self->softstartDuration = value;
|
|
}
|
|
|
|
|
|
void RepairPreset_setDurationValue(struct RepairPresetParameters* self, unsigned int value)
|
|
{
|
|
self->duration = value;
|
|
}
|
|
|
|
|
|
void RepairPreset_setVoltageValue(struct RepairPresetParameters* self, int value)
|
|
{
|
|
self->voltage = value;
|
|
}
|
|
|
|
#endif /* REPAIRPRESET_C_ */
|