- Re-located repairprocessrow information in dedicated object
- added error conditions to repair row and added condition handling to repair process

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@260 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-23 09:02:13 +00:00
parent aa9ba5ea8e
commit e3ca058c96
30 changed files with 1348 additions and 323 deletions

View File

@@ -39,6 +39,8 @@
#include "stm32f10x.h"
#include "repairPreset.h"
#include "repairProcessRow.h"
#include "SignalProfileGenerator.h"
#include "PID.h"
@@ -55,17 +57,6 @@
// Type definitions.
// -----------------------------------------------------------------------------
typedef enum
{
PREPARE = 0,
SOFTSTART,
VOLTAGE_HOLD,
PAUSE,
PAUSE_RESTORE,
FINISH_VERIFY,
FINISHED
} RepairState;
struct RepairProcessParameters
{
@@ -77,16 +68,6 @@ struct RepairProcessParameters
const struct MAX5715_DAC* dacRow3;
};
struct RepairProcessRow
{
const struct AdcChannel* adcChannel;
uint16_t lastADCValue;
const struct MAX5715_DAC* dacChannel;
uint16_t lastDACValue;
int pidError;
struct Pid pid;
bool rowHasError;
};
struct RepairProcess
{
@@ -94,16 +75,11 @@ struct RepairProcess
int TaskPriority;
uint16_t stackSize;
bool runTask;
bool taskIsDeleted;
bool taskIsRunning;
SemaphoreHandle_t secondsSyncronisation;
uint32_t startTime;
uint32_t secondsCounter;
uint32_t softStartTimer;
uint32_t voltageHoldTimer;
RepairState currentState;
struct SignalProfileGenerator signalProfileGenerator;
bool initialized;
bool isProcessRunning;
size_t currentPresetIndex;
const struct RepairPreset* repairPreset;
struct RepairProcessRow row[REPAIRPROCESS_NUMBER_OF_ROWS];
struct Observable observable;
@@ -148,7 +124,7 @@ extern void repairProcess_destruct(struct RepairProcess* self);
/** ----------------------------------------------------------------------------
* repairProcess_feedSecondsCounter
* repairProcess_secondsFeed
* Feeds the seconds counter of the repair process.
* The process is designed to be run every second, so this feed function should
* be called every second.
@@ -160,11 +136,11 @@ extern void repairProcess_destruct(struct RepairProcess* self);
* @todo
* -----------------------------------------------------------------------------
*/
extern void repairProcess_feedSecondsCounter(struct RepairProcess* self);
extern void repairProcess_secondsFeed(struct RepairProcess* self);
/** ----------------------------------------------------------------------------
* repairProcess_feedSecondsCounterFromISR
* repairProcess_secondsFeedFromISR
* Feeds the seconds counter of the repair process.
* This function should be called in an ISR context
* The process is designed to be run every second, so this feed function should
@@ -177,9 +153,12 @@ extern void repairProcess_feedSecondsCounter(struct RepairProcess* self);
* @todo
* -----------------------------------------------------------------------------
*/
extern void repairProcess_feedSecondsCounterFromISR(struct RepairProcess* self);
extern void repairProcess_secondsFeedFromISR(struct RepairProcess* self);
extern bool repairProcess_isProcessRunning(struct RepairProcess* self);
/** ----------------------------------------------------------------------------
* repairProcess_getRemainingRepairTime
* Returns the currently remaining repair time in seconds
@@ -206,7 +185,7 @@ extern uint32_t repairProcess_getRemainingRepairTime(const struct RepairProcess*
* @todo
* -----------------------------------------------------------------------------
*/
extern struct RepairProcessRow* repairProcess_getRowInformation(const struct RepairProcess* self, int rowIndex);
extern const struct RepairProcessRow* repairProcess_getRowInformation(const struct RepairProcess* self, int rowIndex);
/** ----------------------------------------------------------------------------
@@ -222,4 +201,32 @@ extern struct RepairProcessRow* repairProcess_getRowInformation(const struct Rep
*/
extern const struct Observable* repairProcess_getObservable(struct RepairProcess* self);
/** ----------------------------------------------------------------------------
* repairProcess_pauseProcess
* Description of function
*
* @param self
* @param
* @return void
*
* @todo
* -----------------------------------------------------------------------------
*/
extern void repairProcess_pauseProcess(struct RepairProcess* self);
/** ----------------------------------------------------------------------------
* repairProcess_continueProcess
* Description of function
*
* @param self
* @param
* @return void
*
* @todo
* -----------------------------------------------------------------------------
*/
extern void repairProcess_continueProcess(struct RepairProcess* self);
#endif /* REPAIRPROCESS_H_ */