Progress on the menu

- Debounced the interlocks
- Created a specified screen for pre-compliance tests

ADCs must be averaged
menu handling of screens is not OK
destructing tasks is not OK

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@257 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-18 15:26:05 +00:00
parent 97a42de2ea
commit 51ffde94d7
20 changed files with 649 additions and 215 deletions

View File

@@ -42,6 +42,9 @@
#include "PID.h"
#include "Observable.h"
#include "rtc.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
@@ -74,6 +77,17 @@ 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
{
TaskHandle_t taskHandle;
@@ -87,11 +101,11 @@ struct RepairProcess
uint32_t voltageHoldTimer;
RepairState currentState;
bool initialized;
bool isProcessRunning;
size_t currentPresetIndex;
struct RepairPreset* repairPreset;
const struct AdcChannel* adc[REPAIRPROCESS_NUMBER_OF_ROWS];
const struct MAX5715_DAC* dac[REPAIRPROCESS_NUMBER_OF_ROWS];
struct Pid pid[REPAIRPROCESS_NUMBER_OF_ROWS];
const struct RepairPreset* repairPreset;
struct RepairProcessRow row[REPAIRPROCESS_NUMBER_OF_ROWS];
struct Observable observable;
};
// -----------------------------------------------------------------------------
@@ -166,20 +180,45 @@ extern void repairProcess_feedSecondsCounterFromISR(struct RepairProcess* self);
/** ----------------------------------------------------------------------------
* repairProcess_getRepairTime
* Returns the current active repair time in seconds.
* repairProcess_getRemainingRepairTime
* Returns the currently remaining repair time in a struct Time
*
* @param self
* @param repairTime
* @param hours
* @param minutes
* @param seconds
* @param self The repair process object
*
* @return ErrorStatus
* @return struct Time The remaining repair time
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus repairProcess_getRepairTime(const struct RepairProcess* self, uint32_t* repairTime, int* hours, int* minutes, int* seconds);
extern struct Time repairProcess_getRemainingRepairTime(const struct RepairProcess* self);
/** ----------------------------------------------------------------------------
* repairProcess_getRowInformation
* Returns the current active repair time in seconds.
*
* @param self The repair process object
* @param rowIndex Index of the requested row. Starts with 0
*
* @return struct RepairProcessRow* The requested row object
*
* @todo
* -----------------------------------------------------------------------------
*/
extern struct RepairProcessRow* repairProcess_getRowInformation(const struct RepairProcess* self, int rowIndex);
/** ----------------------------------------------------------------------------
* repairProcess_getObservable
* Returns the observable of the repair process
*
* @param self THe repair process object
*
* @return struct Observable* The observable object
*
* @todo
* -----------------------------------------------------------------------------
*/
extern struct Observable* repairProcess_getObservable(struct RepairProcess* self);
#endif /* REPAIRPROCESS_H_ */