Fixed HW validation menu
Fixed some minor issues/bugs git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@284 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -109,4 +109,18 @@ extern ErrorStatus CoverSolenoid_unlock(void);
|
|||||||
*/
|
*/
|
||||||
extern ErrorStatus CoverSolenoid_lock(void);
|
extern ErrorStatus CoverSolenoid_lock(void);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* CoverSolenoid_getGpio
|
||||||
|
* Description of function
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param
|
||||||
|
* @return struct Gpio*
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
extern struct Gpio* CoverSolenoid_getGpio(void);
|
||||||
|
|
||||||
#endif /* SOLENOID_H_ */
|
#endif /* SOLENOID_H_ */
|
||||||
|
|||||||
@@ -58,22 +58,23 @@ typedef ErrorStatus (*DisplayResetFunction)(const struct DisplayDevice* self);
|
|||||||
typedef ErrorStatus (*DisplaySetStateFunction)(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
typedef ErrorStatus (*DisplaySetStateFunction)(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
typedef ErrorStatus (*DisplayBackspaceFunction)(const struct DisplayDevice* self);
|
typedef ErrorStatus (*DisplayBackspaceFunction)(const struct DisplayDevice* self);
|
||||||
typedef ErrorStatus (*DisplayCursorPositionFunction)(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
typedef ErrorStatus (*DisplayCursorPositionFunction)(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
||||||
typedef ErrorStatus (*DisplayWriteFunction)(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
|
typedef ErrorStatus (*DisplayWriteFunction)(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column);
|
||||||
|
typedef ErrorStatus (*DisplayWriteCharacterFunction)(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column);
|
||||||
typedef ErrorStatus (*DisplayClearFunction)(const struct DisplayDevice* self);
|
typedef ErrorStatus (*DisplayClearFunction)(const struct DisplayDevice* self);
|
||||||
typedef ErrorStatus (*DisplayClearLineFunction)(const struct DisplayDevice* self, size_t row);
|
typedef ErrorStatus (*DisplayClearLineFunction)(const struct DisplayDevice* self, unsigned int row);
|
||||||
typedef ErrorStatus (*DisplaySetBrightnessFunction)(const struct DisplayDevice* self, size_t brightness);
|
typedef ErrorStatus (*DisplaySetBrightnessFunction)(const struct DisplayDevice* self, unsigned int brightness);
|
||||||
typedef ErrorStatus (*DisplaySetContrastFunction)(const struct DisplayDevice* self, size_t contrast);
|
typedef ErrorStatus (*DisplaySetContrastFunction)(const struct DisplayDevice* self, unsigned int contrast);
|
||||||
typedef ErrorStatus (*DisplayInvertFunction)(const struct DisplayDevice* self);
|
typedef ErrorStatus (*DisplayInvertFunction)(const struct DisplayDevice* self);
|
||||||
typedef ErrorStatus (*DisplaySetBlinkingCursor)(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
typedef ErrorStatus (*DisplaySetBlinkingCursor)(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
|
|
||||||
struct DisplayDeviceParameters
|
struct DisplayDeviceParameters
|
||||||
{
|
{
|
||||||
size_t numberOfRows;
|
unsigned int numberOfRows;
|
||||||
size_t numberOfColumns;
|
unsigned int numberOfColumns;
|
||||||
size_t contrastMin;
|
unsigned int contrastMin;
|
||||||
size_t contrastMax;
|
unsigned int contrastMax;
|
||||||
size_t brightnessMin;
|
unsigned int brightnessMin;
|
||||||
size_t brightnessMax;
|
unsigned int brightnessMax;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DisplayDevice
|
struct DisplayDevice
|
||||||
@@ -82,6 +83,7 @@ struct DisplayDevice
|
|||||||
DisplaySetStateFunction _setState;
|
DisplaySetStateFunction _setState;
|
||||||
DisplayBackspaceFunction _backspace;
|
DisplayBackspaceFunction _backspace;
|
||||||
DisplayCursorPositionFunction _setCursorToPosition;
|
DisplayCursorPositionFunction _setCursorToPosition;
|
||||||
|
DisplayWriteCharacterFunction _writeCharacter;
|
||||||
DisplayWriteFunction _write;
|
DisplayWriteFunction _write;
|
||||||
DisplayClearFunction _clear;
|
DisplayClearFunction _clear;
|
||||||
DisplayClearLineFunction _clearLine;
|
DisplayClearLineFunction _clearLine;
|
||||||
@@ -102,6 +104,7 @@ extern ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct D
|
|||||||
DisplaySetStateFunction setState,
|
DisplaySetStateFunction setState,
|
||||||
DisplayBackspaceFunction backspace,
|
DisplayBackspaceFunction backspace,
|
||||||
DisplayCursorPositionFunction setCursorToPosition,
|
DisplayCursorPositionFunction setCursorToPosition,
|
||||||
|
DisplayWriteCharacterFunction writeCharacter,
|
||||||
DisplayWriteFunction write,
|
DisplayWriteFunction write,
|
||||||
DisplayClearFunction clear,
|
DisplayClearFunction clear,
|
||||||
DisplayClearLineFunction clearLine,
|
DisplayClearLineFunction clearLine,
|
||||||
@@ -114,11 +117,12 @@ extern ErrorStatus DisplayDevice_reset(const struct DisplayDevice* self);
|
|||||||
extern ErrorStatus DisplayDevice_setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
extern ErrorStatus DisplayDevice_setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
extern ErrorStatus DisplayDevice_backspace(const struct DisplayDevice* self);
|
extern ErrorStatus DisplayDevice_backspace(const struct DisplayDevice* self);
|
||||||
extern ErrorStatus DisplayDevice_setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
extern ErrorStatus DisplayDevice_setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
||||||
extern ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
|
extern ErrorStatus DisplayDevice_writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column);
|
||||||
|
extern ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column);
|
||||||
extern ErrorStatus DisplayDevice_clear(const struct DisplayDevice* self);
|
extern ErrorStatus DisplayDevice_clear(const struct DisplayDevice* self);
|
||||||
extern ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, size_t row);
|
extern ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, unsigned int row);
|
||||||
extern ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, size_t brightness);
|
extern ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, unsigned int brightness);
|
||||||
extern ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, size_t contrast);
|
extern ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, unsigned int contrast);
|
||||||
extern ErrorStatus DisplayDevice_invert(const struct DisplayDevice* self);
|
extern ErrorStatus DisplayDevice_invert(const struct DisplayDevice* self);
|
||||||
extern ErrorStatus DisplayDevice_setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
extern ErrorStatus DisplayDevice_setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,20 @@ extern ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd, int i
|
|||||||
extern void PID_destruct(struct Pid* self);
|
extern void PID_destruct(struct Pid* self);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* PID_reset
|
||||||
|
* Resets the pid regulator and cleans all history
|
||||||
|
*
|
||||||
|
* @param self PID object to reset
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
extern void PID_reset(struct Pid* self);
|
||||||
|
|
||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* PID_calculate
|
* PID_calculate
|
||||||
* Calculate
|
* Calculate
|
||||||
|
|||||||
@@ -104,4 +104,18 @@ extern ErrorStatus Power6V5Supply_off(void);
|
|||||||
*/
|
*/
|
||||||
extern ErrorStatus Power6V5Supply_on(void);
|
extern ErrorStatus Power6V5Supply_on(void);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* Power6V5Supply_getGPIO
|
||||||
|
* Description of function
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param
|
||||||
|
* @return struct Gpio*
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
extern struct Gpio* Power6V5Supply_getGPIO(void);
|
||||||
|
|
||||||
#endif /* INC_POWER6V5SUPPLY_H_ */
|
#endif /* INC_POWER6V5SUPPLY_H_ */
|
||||||
|
|||||||
@@ -109,4 +109,16 @@ extern ErrorStatus TeslaGunSafety_release(void);
|
|||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
extern ErrorStatus TeslaGunSafety_block(void);
|
extern ErrorStatus TeslaGunSafety_block(void);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* TeslaGunSafety_getGpio
|
||||||
|
* Description of function
|
||||||
|
*
|
||||||
|
* @return struct Gpio*
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
extern struct Gpio* TeslaGunSafety_getGpio(void);
|
||||||
#endif /* INC_TESLASAFETY_H_ */
|
#endif /* INC_TESLASAFETY_H_ */
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ extern ErrorStatus NHD0420_getSpiParameters(struct SpiParameters* parameters);
|
|||||||
* @todo
|
* @todo
|
||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
extern ErrorStatus NHD0420_setCursorToPosition(const struct NHD0420* self, size_t row, size_t column);
|
extern ErrorStatus NHD0420_setCursorToPosition(const struct NHD0420* self, unsigned int row, unsigned int column);
|
||||||
|
|
||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
@@ -286,6 +286,6 @@ extern ErrorStatus NHD0420_setI2CAddress(const struct NHD0420* self, char addres
|
|||||||
*/
|
*/
|
||||||
extern ErrorStatus NHD0420_sendCommand(const struct NHD0420* self, char command);
|
extern ErrorStatus NHD0420_sendCommand(const struct NHD0420* self, char command);
|
||||||
|
|
||||||
extern ErrorStatus NHD0420_sendData(const struct NHD0420* self, const char* buffer, size_t length);
|
extern ErrorStatus NHD0420_sendData(const struct NHD0420* self, const char* buffer, unsigned int length);
|
||||||
|
|
||||||
#endif /* DISPLAY_INC_NHD0420_H_ */
|
#endif /* DISPLAY_INC_NHD0420_H_ */
|
||||||
|
|||||||
@@ -112,3 +112,9 @@ ErrorStatus CoverSolenoid_lock(void)
|
|||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Gpio* CoverSolenoid_getGpio(void)
|
||||||
|
{
|
||||||
|
return self.gpio;
|
||||||
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct DisplayD
|
|||||||
DisplaySetStateFunction setState,
|
DisplaySetStateFunction setState,
|
||||||
DisplayBackspaceFunction backspace,
|
DisplayBackspaceFunction backspace,
|
||||||
DisplayCursorPositionFunction setCursorToPosition,
|
DisplayCursorPositionFunction setCursorToPosition,
|
||||||
|
DisplayWriteCharacterFunction writeCharacter,
|
||||||
DisplayWriteFunction write,
|
DisplayWriteFunction write,
|
||||||
DisplayClearFunction clear,
|
DisplayClearFunction clear,
|
||||||
DisplayClearLineFunction clearLine,
|
DisplayClearLineFunction clearLine,
|
||||||
@@ -78,6 +79,7 @@ ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct DisplayD
|
|||||||
self->_setState = setState;
|
self->_setState = setState;
|
||||||
self->_backspace = backspace;
|
self->_backspace = backspace;
|
||||||
self->_setCursorToPosition = setCursorToPosition;
|
self->_setCursorToPosition = setCursorToPosition;
|
||||||
|
self->_writeCharacter = writeCharacter;
|
||||||
self->_write = write;
|
self->_write = write;
|
||||||
self->_clear = clear;
|
self->_clear = clear;
|
||||||
self->_clearLine = clearLine,
|
self->_clearLine = clearLine,
|
||||||
@@ -170,7 +172,25 @@ ErrorStatus DisplayDevice_setCursorToPosition(const struct DisplayDevice* self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column)
|
ErrorStatus DisplayDevice_writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column)
|
||||||
|
{
|
||||||
|
ErrorStatus returnValue = SUCCESS;
|
||||||
|
if (self->initialized)
|
||||||
|
{
|
||||||
|
if (self->_writeCharacter != NULL)
|
||||||
|
{
|
||||||
|
returnValue = self->_writeCharacter(self, buffer, row, column);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
returnValue = ERROR;
|
||||||
|
}
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column)
|
||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
@@ -206,7 +226,7 @@ ErrorStatus DisplayDevice_clear(const struct DisplayDevice* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, size_t row)
|
ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, unsigned int row)
|
||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
@@ -224,7 +244,7 @@ ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, size_t row
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, size_t brightness)
|
ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, unsigned int brightness)
|
||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
@@ -242,7 +262,7 @@ ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, size_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, size_t contrast)
|
ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, unsigned int contrast)
|
||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
|
|||||||
@@ -95,6 +95,16 @@ void PID_destruct(struct Pid* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PID_reset(struct Pid* self)
|
||||||
|
{
|
||||||
|
if (self->initialized)
|
||||||
|
{
|
||||||
|
self->iTerm = 0;
|
||||||
|
self->input_d1 = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int PID_calculate(struct Pid* self, int error)
|
int PID_calculate(struct Pid* self, int error)
|
||||||
{
|
{
|
||||||
int returnValue = 0;
|
int returnValue = 0;
|
||||||
|
|||||||
@@ -112,3 +112,9 @@ ErrorStatus Power6V5Supply_on(void)
|
|||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Gpio* Power6V5Supply_getGPIO(void)
|
||||||
|
{
|
||||||
|
return self.gpio;
|
||||||
|
}
|
||||||
|
|||||||
@@ -112,3 +112,9 @@ ErrorStatus TeslaGunSafety_block(void)
|
|||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Gpio* TeslaGunSafety_getGpio(void)
|
||||||
|
{
|
||||||
|
return self.gpio;
|
||||||
|
}
|
||||||
|
|||||||
@@ -69,10 +69,11 @@ static int nhd0420_cursorRowOffset[NHD0420_NUMBER_OF_ROWS] =
|
|||||||
static ErrorStatus setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
static ErrorStatus setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
static ErrorStatus backspace(const struct DisplayDevice* self);
|
static ErrorStatus backspace(const struct DisplayDevice* self);
|
||||||
static ErrorStatus setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
static ErrorStatus setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
||||||
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column);
|
static ErrorStatus writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column);
|
||||||
|
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column);
|
||||||
static ErrorStatus clear(const struct DisplayDevice* self);
|
static ErrorStatus clear(const struct DisplayDevice* self);
|
||||||
static ErrorStatus setBrightness(const struct DisplayDevice* self, size_t brightness);
|
static ErrorStatus setBrightness(const struct DisplayDevice* self, unsigned int brightness);
|
||||||
static ErrorStatus setContrast(const struct DisplayDevice* self, size_t contrast);
|
static ErrorStatus setContrast(const struct DisplayDevice* self, unsigned int contrast);
|
||||||
static ErrorStatus setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
static ErrorStatus setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -98,7 +99,7 @@ ErrorStatus NHD0420_construct(struct NHD0420* self, const struct IODevice* devic
|
|||||||
ddParameters.contrastMin = NHD0420_CONTRAST_MIN;
|
ddParameters.contrastMin = NHD0420_CONTRAST_MIN;
|
||||||
ddParameters.contrastMax = NHD0420_CONTRAST_MAX;
|
ddParameters.contrastMax = NHD0420_CONTRAST_MAX;
|
||||||
|
|
||||||
returnValue = DisplayDevice_construct(&self->displayDevice, &ddParameters, NULL, setState, backspace, setCursorToPosition, write, clear, NULL, setBrightness, setContrast, NULL, setBlinkingCursorState);
|
returnValue = DisplayDevice_construct(&self->displayDevice, &ddParameters, NULL, setState, backspace, setCursorToPosition, writeCharacter, write, clear, NULL, setBrightness, setContrast, NULL, setBlinkingCursorState);
|
||||||
|
|
||||||
if (returnValue == SUCCESS)
|
if (returnValue == SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -170,7 +171,7 @@ ErrorStatus NHD0420_getSpiParameters(struct SpiParameters* parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ErrorStatus NHD0420_setCursorToPosition(const struct NHD0420* self, size_t row, size_t column)
|
ErrorStatus NHD0420_setCursorToPosition(const struct NHD0420* self, unsigned int row, unsigned int column)
|
||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
@@ -357,7 +358,7 @@ ErrorStatus NHD0420_sendCommand(const struct NHD0420* self, char command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ErrorStatus NHD0420_sendData(const struct NHD0420* self, const char* buffer, size_t length)
|
ErrorStatus NHD0420_sendData(const struct NHD0420* self, const char* buffer, unsigned int length)
|
||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
@@ -405,10 +406,34 @@ ErrorStatus setCursorToPosition(const struct DisplayDevice* self, unsigned int r
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, size_t length, size_t row, size_t column)
|
ErrorStatus writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column)
|
||||||
|
{
|
||||||
|
ErrorStatus returnValue = SUCCESS;
|
||||||
|
if (self->initialized)
|
||||||
|
{
|
||||||
|
if ((column) > NHD0420_NUMBER_OF_COLUMNS)
|
||||||
|
{
|
||||||
|
returnValue = ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set cursor on display
|
||||||
|
returnValue = NHD0420_setCursorToPosition((const struct NHD0420*)self, row, column);
|
||||||
|
|
||||||
|
if (returnValue == SUCCESS)
|
||||||
|
{
|
||||||
|
returnValue = NHD0420_sendData((const struct NHD0420*)self, buffer, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
returnValue = ERROR;
|
||||||
|
}
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column)
|
||||||
{
|
{
|
||||||
///TODO REMOVE
|
|
||||||
// volatile int i;
|
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
{
|
{
|
||||||
@@ -420,8 +445,6 @@ static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, s
|
|||||||
// Set cursor on display
|
// Set cursor on display
|
||||||
returnValue = NHD0420_setCursorToPosition((const struct NHD0420*)self, row, column);
|
returnValue = NHD0420_setCursorToPosition((const struct NHD0420*)self, row, column);
|
||||||
|
|
||||||
// for (i = 0; i < 3000; i++);
|
|
||||||
|
|
||||||
if (returnValue == SUCCESS)
|
if (returnValue == SUCCESS)
|
||||||
{
|
{
|
||||||
// Send one byte at a time (display requirement)
|
// Send one byte at a time (display requirement)
|
||||||
@@ -431,7 +454,6 @@ static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, s
|
|||||||
returnValue = NHD0420_sendData((const struct NHD0420*)self, &buffer[loopcounter], 1);
|
returnValue = NHD0420_sendData((const struct NHD0420*)self, &buffer[loopcounter], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for (i = 0; i < 1000; i++);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -455,7 +477,7 @@ static ErrorStatus clear(const struct DisplayDevice* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static ErrorStatus setBrightness(const struct DisplayDevice* self, size_t brightness)
|
static ErrorStatus setBrightness(const struct DisplayDevice* self, unsigned int brightness)
|
||||||
{
|
{
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
{
|
{
|
||||||
@@ -468,7 +490,7 @@ static ErrorStatus setBrightness(const struct DisplayDevice* self, size_t bright
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static ErrorStatus setContrast(const struct DisplayDevice* self, size_t contrast)
|
static ErrorStatus setContrast(const struct DisplayDevice* self, unsigned int contrast)
|
||||||
{
|
{
|
||||||
if (self->initialized)
|
if (self->initialized)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ static ErrorStatus write(const struct IODevice* self, const char* buffer, size_t
|
|||||||
return SpiDevice_write((const struct SpiDevice*)self, buffer, length);
|
return SpiDevice_write((const struct SpiDevice*)self, buffer, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ErrorStatus SpiDevice_write (const struct SpiDevice* self, const char* buffer, int length)
|
ErrorStatus SpiDevice_write (const struct SpiDevice* self, const char* buffer, int length)
|
||||||
{
|
{
|
||||||
struct spiQueueItem txItem;
|
struct spiQueueItem txItem;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
- Display backlight unstable
|
- Display backlight unstable
|
||||||
- Display cursor unstable
|
- Display cursor unstable
|
||||||
- HW validation menu outdated/unfunctional
|
|
||||||
- repairMenu has bad reference to getmainrepairmenu
|
- repairMenu has bad reference to getmainrepairmenu
|
||||||
|
|
||||||
|
|
||||||
@@ -8,4 +7,5 @@
|
|||||||
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
|
- NumberOfStages Macro for presets not implemented well. It will be ignored when generating DEFAULT presets
|
||||||
|
- HW validation menu outdated/unfunctional
|
||||||
@@ -43,8 +43,8 @@
|
|||||||
#define configCPU_CLOCK_HZ ( ( unsigned long ) 8000000 )
|
#define configCPU_CLOCK_HZ ( ( unsigned long ) 8000000 )
|
||||||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
||||||
#define configMAX_PRIORITIES ( 5 )
|
#define configMAX_PRIORITIES ( 5 )
|
||||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
|
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
|
||||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 0x7000 ) )
|
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 0x8000 ) )
|
||||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||||
#define configUSE_TRACE_FACILITY 1
|
#define configUSE_TRACE_FACILITY 1
|
||||||
#define configUSE_16_BIT_TICKS 0
|
#define configUSE_16_BIT_TICKS 0
|
||||||
|
|||||||
@@ -63,8 +63,7 @@ struct HwValidationMenuItems
|
|||||||
struct Gpio* power6v5Enable;
|
struct Gpio* power6v5Enable;
|
||||||
struct Gpio* interlockNO;
|
struct Gpio* interlockNO;
|
||||||
struct Gpio* interlockNC;
|
struct Gpio* interlockNC;
|
||||||
struct Gpio* teslaNO;
|
struct Gpio* TeslaSecurity;
|
||||||
struct Gpio* teslaNC;
|
|
||||||
struct Gpio* solenoid;
|
struct Gpio* solenoid;
|
||||||
struct Gpio* mcp0Relay;
|
struct Gpio* mcp0Relay;
|
||||||
struct Gpio* mcp1Relay;
|
struct Gpio* mcp1Relay;
|
||||||
@@ -74,7 +73,7 @@ struct HwValidationMenuItems
|
|||||||
struct Gpio* cat2Relay;
|
struct Gpio* cat2Relay;
|
||||||
struct Pcba* pcba;
|
struct Pcba* pcba;
|
||||||
struct Keypad *keypad;
|
struct Keypad *keypad;
|
||||||
// struct Eeprom* eeprom; // Not implemented yet
|
// struct Buzzer* buzzer;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HwValidationMenu
|
struct HwValidationMenu
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ static void DisplayTask(void* parameters)
|
|||||||
if (DisplayContent_isCharacterUpdated(&self->displayContent, rowCounter, colCounter))
|
if (DisplayContent_isCharacterUpdated(&self->displayContent, rowCounter, colCounter))
|
||||||
{
|
{
|
||||||
buffer = DisplayContent_getCharacter(&self->displayContent, rowCounter, colCounter);
|
buffer = DisplayContent_getCharacter(&self->displayContent, rowCounter, colCounter);
|
||||||
DisplayDevice_write(self->displayDevice, &buffer, 1, rowCounter + 1, colCounter + 1);
|
DisplayDevice_writeCharacter(self->displayDevice, &buffer, rowCounter + 1, colCounter + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ typedef enum
|
|||||||
CONSOLE_TEST_ADC,
|
CONSOLE_TEST_ADC,
|
||||||
CONSOLE_TEST_DAC,
|
CONSOLE_TEST_DAC,
|
||||||
CONSOLE_TEST_INTERLOCK,
|
CONSOLE_TEST_INTERLOCK,
|
||||||
|
CONSOLE_TEST_TESLA_SECURITY,
|
||||||
CONSOLE_TEST_SOLENOID,
|
CONSOLE_TEST_SOLENOID,
|
||||||
CONSOLE_TEST_RELAY,
|
CONSOLE_TEST_RELAY,
|
||||||
CONSOLE_TEST_GENERIC,
|
CONSOLE_TEST_GENERIC,
|
||||||
@@ -74,6 +75,7 @@ typedef enum
|
|||||||
DISPLAY_MENU_ADC,
|
DISPLAY_MENU_ADC,
|
||||||
DISPLAY_MENU_DAC,
|
DISPLAY_MENU_DAC,
|
||||||
DISPLAY_MENU_INTERLOCK,
|
DISPLAY_MENU_INTERLOCK,
|
||||||
|
DISPLAY_MENU_TESLA_SECURITY,
|
||||||
DISPLAY_MENU_SOLENOID,
|
DISPLAY_MENU_SOLENOID,
|
||||||
DISPLAY_MENU_RELAY,
|
DISPLAY_MENU_RELAY,
|
||||||
DISPLAY_MENU_GENERIC
|
DISPLAY_MENU_GENERIC
|
||||||
@@ -97,7 +99,7 @@ typedef enum
|
|||||||
|
|
||||||
static const char conInfHeader[] =
|
static const char conInfHeader[] =
|
||||||
"*******************************************************************************\r\n"
|
"*******************************************************************************\r\n"
|
||||||
"** Photonis - something **\r\n"
|
"** Photonis - HSB MRTS **\r\n"
|
||||||
"** **\r\n"
|
"** **\r\n"
|
||||||
"*******************************************************************************\r\n"
|
"*******************************************************************************\r\n"
|
||||||
" \r\n";
|
" \r\n";
|
||||||
@@ -111,10 +113,11 @@ static const char conInfMainMenu[] =
|
|||||||
" [%c] Test Display \r\n"
|
" [%c] Test Display \r\n"
|
||||||
" [%c] Test ADCs \r\n"
|
" [%c] Test ADCs \r\n"
|
||||||
" [%c] Test DACs \r\n"
|
" [%c] Test DACs \r\n"
|
||||||
" [%c] Test Interlocks \r\n"
|
" [%c] Test Interlock \r\n"
|
||||||
|
" [%c] Test Tesla security \r\n"
|
||||||
" [%c] Test Solenoids \r\n"
|
" [%c] Test Solenoids \r\n"
|
||||||
" [%c] Test relays \r\n"
|
" [%c] Test relays \r\n"
|
||||||
" [%c] Test Keypad/EEPROM/PCB variant \r\n"
|
" [%c] Test Keypad/PCB variant \r\n"
|
||||||
" \r\n";
|
" \r\n";
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@@ -124,6 +127,7 @@ enum
|
|||||||
MENU_MAIN_ADC,
|
MENU_MAIN_ADC,
|
||||||
MENU_MAIN_DAC,
|
MENU_MAIN_DAC,
|
||||||
MENU_MAIN_INTERLOCK,
|
MENU_MAIN_INTERLOCK,
|
||||||
|
MENU_MAIN_TESLA_SECURITY,
|
||||||
MENU_MAIN_SOLENOID,
|
MENU_MAIN_SOLENOID,
|
||||||
MENU_MAIN_RELAY,
|
MENU_MAIN_RELAY,
|
||||||
MENU_MAIN_GENERIC,
|
MENU_MAIN_GENERIC,
|
||||||
@@ -159,9 +163,9 @@ static const char conTestDisplay[] =
|
|||||||
" \r\n"
|
" \r\n"
|
||||||
" Test the display and backlight \r\n"
|
" Test the display and backlight \r\n"
|
||||||
" \r\n"
|
" \r\n"
|
||||||
" [%c] Set backlight to 10%% \r\n"
|
" [%c] Set backlight to 10%% \r\n"
|
||||||
" [%c] Set backlight to 50%% \r\n"
|
" [%c] Set backlight to 50%% \r\n"
|
||||||
" [%c] Set backlight to 100%% \r\n"
|
" [%c] Set backlight to 100%% \r\n"
|
||||||
" [%c] Show text on display \r\n"
|
" [%c] Show text on display \r\n"
|
||||||
" [%c] Clear display content \r\n"
|
" [%c] Clear display content \r\n"
|
||||||
" [%c] Back \r\n"
|
" [%c] Back \r\n"
|
||||||
@@ -248,18 +252,34 @@ static const char conTestInterlock[] =
|
|||||||
" Test the interlock [1-2] \r\n"
|
" Test the interlock [1-2] \r\n"
|
||||||
" \r\n"
|
" \r\n"
|
||||||
" [%c] Read Interlock 1 \r\n"
|
" [%c] Read Interlock 1 \r\n"
|
||||||
" [%c] Read Interlock 2 (Tesla only) \r\n"
|
|
||||||
" [%c] Back \r\n"
|
" [%c] Back \r\n"
|
||||||
" \r\n";
|
" \r\n";
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
MENU_TEST_INTERLOCK_1,
|
MENU_TEST_INTERLOCK_1,
|
||||||
MENU_TEST_INTERLOCK_2,
|
|
||||||
MENU_TEST_INTERLOCK_BACK,
|
MENU_TEST_INTERLOCK_BACK,
|
||||||
MENU_TEST_INTERLOCK_LAST
|
MENU_TEST_INTERLOCK_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char conTestTeslaSecurity[] =
|
||||||
|
ANSI_TERMINAL_RESET
|
||||||
|
ANSI_TERMINAL_HOME
|
||||||
|
" TEST Tesla security \r\n"
|
||||||
|
" \r\n"
|
||||||
|
" Test the Tesla security relais \r\n"
|
||||||
|
" \r\n"
|
||||||
|
" [%c] Toggle relais \r\n"
|
||||||
|
" [%c] Back \r\n"
|
||||||
|
" \r\n";
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MENU_TEST_TESLA_TOGGLE,
|
||||||
|
MENU_TEST_TESLA_BACK,
|
||||||
|
MENU_TEST_TESLA_LAST
|
||||||
|
};
|
||||||
|
|
||||||
static const char conTestSolenoid[] =
|
static const char conTestSolenoid[] =
|
||||||
ANSI_TERMINAL_RESET
|
ANSI_TERMINAL_RESET
|
||||||
ANSI_TERMINAL_HOME
|
ANSI_TERMINAL_HOME
|
||||||
@@ -310,12 +330,11 @@ enum
|
|||||||
static const char conTestGeneric[] =
|
static const char conTestGeneric[] =
|
||||||
ANSI_TERMINAL_RESET
|
ANSI_TERMINAL_RESET
|
||||||
ANSI_TERMINAL_HOME
|
ANSI_TERMINAL_HOME
|
||||||
" TEST KEYPAD/EEPROM/PCB VARIANT \r\n"
|
" TEST KEYPAD/PCB VARIANT \r\n"
|
||||||
" \r\n"
|
" \r\n"
|
||||||
" Test the relays [1-6] \r\n"
|
" Test keypad / PCBa \r\n"
|
||||||
" \r\n"
|
" \r\n"
|
||||||
" [%c] Read keypad \r\n"
|
" [%c] Read keypad \r\n"
|
||||||
" [%c] Test EEPROM \r\n"
|
|
||||||
" [%c] Get PCB variant \r\n"
|
" [%c] Get PCB variant \r\n"
|
||||||
" [%c] Back \r\n"
|
" [%c] Back \r\n"
|
||||||
" \r\n";
|
" \r\n";
|
||||||
@@ -323,7 +342,6 @@ static const char conTestGeneric[] =
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
MENU_TEST_GENERIC_KEYPAD,
|
MENU_TEST_GENERIC_KEYPAD,
|
||||||
MENU_TEST_GENERIC_EEPROM,
|
|
||||||
MENU_TEST_GENERIC_PCB_VARIANT,
|
MENU_TEST_GENERIC_PCB_VARIANT,
|
||||||
MENU_TEST_GENERIC_BACK,
|
MENU_TEST_GENERIC_BACK,
|
||||||
MENU_TEST_GENERIC_LAST
|
MENU_TEST_GENERIC_LAST
|
||||||
@@ -518,7 +536,13 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
|
|||||||
self->menuItemSelected = 0;
|
self->menuItemSelected = 0;
|
||||||
menuState = CONSOLE_TEST_INTERLOCK;
|
menuState = CONSOLE_TEST_INTERLOCK;
|
||||||
hwValidationMenuDisplay(self, DISPLAY_MENU_INTERLOCK );
|
hwValidationMenuDisplay(self, DISPLAY_MENU_INTERLOCK );
|
||||||
}
|
}
|
||||||
|
else if( self->menuItemSelected == MENU_MAIN_TESLA_SECURITY )
|
||||||
|
{
|
||||||
|
self->menuItemSelected = 0;
|
||||||
|
menuState = CONSOLE_TEST_TESLA_SECURITY;
|
||||||
|
hwValidationMenuDisplay(self, DISPLAY_MENU_TESLA_SECURITY );
|
||||||
|
}
|
||||||
else if( self->menuItemSelected == MENU_MAIN_SOLENOID )
|
else if( self->menuItemSelected == MENU_MAIN_SOLENOID )
|
||||||
{
|
{
|
||||||
self->menuItemSelected = 0;
|
self->menuItemSelected = 0;
|
||||||
@@ -892,28 +916,6 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
|
|||||||
}
|
}
|
||||||
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
|
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
|
||||||
}
|
}
|
||||||
else if (self->menuItemSelected == MENU_TEST_INTERLOCK_2 )
|
|
||||||
{
|
|
||||||
|
|
||||||
if(self->testItems->pcba->pcba == PCBA_Tesla)
|
|
||||||
{
|
|
||||||
|
|
||||||
if( GPIO_getValue(self->testItems->teslaNO, &value1) == SUCCESS &&
|
|
||||||
GPIO_getValue(self->testItems->teslaNC, &value2) == SUCCESS
|
|
||||||
){
|
|
||||||
outputBufferLength = sprintf(self->outputBuffer, "Interlock (tesla): NO: %d - NC: %d\r\n", value1, value2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outputBufferLength = sprintf(self->outputBuffer, "Interlock: Failure\r\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outputBufferLength = sprintf(self->outputBuffer, "Interlock: Only available on Tesla PCBA\r\n");
|
|
||||||
}
|
|
||||||
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
|
|
||||||
}
|
|
||||||
else if (self->menuItemSelected == MENU_TEST_INTERLOCK_BACK )
|
else if (self->menuItemSelected == MENU_TEST_INTERLOCK_BACK )
|
||||||
{
|
{
|
||||||
// Back to main menu
|
// Back to main menu
|
||||||
@@ -924,6 +926,59 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CONSOLE_TEST_TESLA_SECURITY:
|
||||||
|
if( button == BUTTON_UP )
|
||||||
|
{
|
||||||
|
if( self->menuItemSelected == 0 )
|
||||||
|
self->menuItemSelected = (MENU_TEST_TESLA_LAST- 1);
|
||||||
|
else
|
||||||
|
self->menuItemSelected--;
|
||||||
|
|
||||||
|
hwValidationMenuDisplay(self, DISPLAY_MENU_TESLA_SECURITY );
|
||||||
|
}
|
||||||
|
else if( button == BUTTON_DOWN )
|
||||||
|
{
|
||||||
|
if( self->menuItemSelected == (MENU_TEST_TESLA_LAST - 1) )
|
||||||
|
self->menuItemSelected = 0;
|
||||||
|
else
|
||||||
|
self->menuItemSelected++;
|
||||||
|
|
||||||
|
hwValidationMenuDisplay(self, DISPLAY_MENU_TESLA_SECURITY );
|
||||||
|
}
|
||||||
|
else if( button == BUTTON_ENTER )
|
||||||
|
{
|
||||||
|
bool value = false;
|
||||||
|
if( self->menuItemSelected == MENU_TEST_TESLA_TOGGLE)
|
||||||
|
{
|
||||||
|
if( GPIO_getValue(self->testItems->TeslaSecurity, &value) == SUCCESS)
|
||||||
|
{
|
||||||
|
// Invert current value
|
||||||
|
value = !value;
|
||||||
|
if( GPIO_setValue(self->testItems->TeslaSecurity, value) == SUCCESS)
|
||||||
|
{
|
||||||
|
outputBufferLength = sprintf(self->outputBuffer, "TESLA relais: Toggled\r\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outputBufferLength = sprintf(self->outputBuffer, "TESLA relais: Failed to set value\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outputBufferLength = sprintf(self->outputBuffer, "TESLA relais: Failed to get value\r\n");
|
||||||
|
}
|
||||||
|
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
|
||||||
|
}
|
||||||
|
else if (self->menuItemSelected == MENU_TEST_TESLA_BACK )
|
||||||
|
{
|
||||||
|
// Back to main menu
|
||||||
|
self->menuItemSelected = 0;
|
||||||
|
menuState = CONSOLE_MAIN_MENU;
|
||||||
|
hwValidationMenuDisplay(self, DISPLAY_MENU_MAIN );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case CONSOLE_TEST_SOLENOID:
|
case CONSOLE_TEST_SOLENOID:
|
||||||
if( button == BUTTON_UP )
|
if( button == BUTTON_UP )
|
||||||
{
|
{
|
||||||
@@ -1157,11 +1212,6 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
|
|||||||
outputBufferLength = sprintf(self->outputBuffer, "Keypad test exited\r\n");
|
outputBufferLength = sprintf(self->outputBuffer, "Keypad test exited\r\n");
|
||||||
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
|
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
|
||||||
}
|
}
|
||||||
else if( self->menuItemSelected == MENU_TEST_GENERIC_EEPROM)
|
|
||||||
{
|
|
||||||
outputBufferLength = sprintf(self->outputBuffer, "[TODO] EEPROM TEST\r\n");
|
|
||||||
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
|
|
||||||
}
|
|
||||||
else if( self->menuItemSelected == MENU_TEST_GENERIC_PCB_VARIANT)
|
else if( self->menuItemSelected == MENU_TEST_GENERIC_PCB_VARIANT)
|
||||||
{
|
{
|
||||||
if(self->testItems->pcba)
|
if(self->testItems->pcba)
|
||||||
@@ -1214,6 +1264,7 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
|
|||||||
menuItems[MENU_MAIN_ADC],
|
menuItems[MENU_MAIN_ADC],
|
||||||
menuItems[MENU_MAIN_DAC],
|
menuItems[MENU_MAIN_DAC],
|
||||||
menuItems[MENU_MAIN_INTERLOCK],
|
menuItems[MENU_MAIN_INTERLOCK],
|
||||||
|
menuItems[MENU_MAIN_TESLA_SECURITY],
|
||||||
menuItems[MENU_MAIN_SOLENOID],
|
menuItems[MENU_MAIN_SOLENOID],
|
||||||
menuItems[MENU_MAIN_RELAY],
|
menuItems[MENU_MAIN_RELAY],
|
||||||
menuItems[MENU_MAIN_GENERIC]
|
menuItems[MENU_MAIN_GENERIC]
|
||||||
@@ -1326,7 +1377,6 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
|
|||||||
char interlockMenuBuffer[ sizeof( conTestInterlock ) ];
|
char interlockMenuBuffer[ sizeof( conTestInterlock ) ];
|
||||||
menu_length = sprintf( interlockMenuBuffer, conTestInterlock,
|
menu_length = sprintf( interlockMenuBuffer, conTestInterlock,
|
||||||
menuItems[MENU_TEST_INTERLOCK_1],
|
menuItems[MENU_TEST_INTERLOCK_1],
|
||||||
menuItems[MENU_TEST_INTERLOCK_2],
|
|
||||||
menuItems[MENU_TEST_INTERLOCK_BACK]
|
menuItems[MENU_TEST_INTERLOCK_BACK]
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1334,6 +1384,24 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
|
|||||||
IODevice_write(self->ioDevice, interlockMenuBuffer, menu_length);
|
IODevice_write(self->ioDevice, interlockMenuBuffer, menu_length);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DISPLAY_MENU_TESLA_SECURITY:
|
||||||
|
// Put an asterisk (*) at the selected item in the menu
|
||||||
|
for( menuIndex = 0; menuIndex < MENU_TEST_TESLA_LAST; menuIndex++ )
|
||||||
|
{
|
||||||
|
MENU_DRAW_SELECTED(menuIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fill buffer with menu items
|
||||||
|
char teslaSecurityMenuBuffer[ sizeof( conTestTeslaSecurity ) ];
|
||||||
|
menu_length = sprintf( teslaSecurityMenuBuffer, conTestTeslaSecurity,
|
||||||
|
menuItems[MENU_TEST_TESLA_TOGGLE],
|
||||||
|
menuItems[MENU_TEST_TESLA_BACK]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Write message to debout interface
|
||||||
|
IODevice_write(self->ioDevice, teslaSecurityMenuBuffer, menu_length);
|
||||||
|
break;
|
||||||
|
|
||||||
case DISPLAY_MENU_SOLENOID:
|
case DISPLAY_MENU_SOLENOID:
|
||||||
|
|
||||||
// Put an asterisk (*) at the selected item in the menu
|
// Put an asterisk (*) at the selected item in the menu
|
||||||
@@ -1398,7 +1466,6 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
|
|||||||
char genericMenuBuffer[ sizeof( conTestGeneric) ];
|
char genericMenuBuffer[ sizeof( conTestGeneric) ];
|
||||||
menu_length = sprintf( genericMenuBuffer, conTestGeneric,
|
menu_length = sprintf( genericMenuBuffer, conTestGeneric,
|
||||||
menuItems[MENU_TEST_GENERIC_KEYPAD],
|
menuItems[MENU_TEST_GENERIC_KEYPAD],
|
||||||
menuItems[MENU_TEST_GENERIC_EEPROM],
|
|
||||||
menuItems[MENU_TEST_GENERIC_PCB_VARIANT],
|
menuItems[MENU_TEST_GENERIC_PCB_VARIANT],
|
||||||
menuItems[MENU_TEST_GENERIC_BACK]
|
menuItems[MENU_TEST_GENERIC_BACK]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,6 +33,10 @@
|
|||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
|
#include "stm32f10x.h"
|
||||||
|
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
#include "ADConverters.h"
|
#include "ADConverters.h"
|
||||||
#include "DAConverters.h"
|
#include "DAConverters.h"
|
||||||
#include "DeviceParameters.h"
|
#include "DeviceParameters.h"
|
||||||
@@ -40,35 +44,20 @@
|
|||||||
#include "Error.h"
|
#include "Error.h"
|
||||||
#include "hsb-mrts.h"
|
#include "hsb-mrts.h"
|
||||||
#include "hwValidationMenu.h"
|
#include "hwValidationMenu.h"
|
||||||
#include "repairMenu.h"
|
|
||||||
#include "repairMenus.h"
|
#include "repairMenus.h"
|
||||||
#include "repairProcess.h"
|
|
||||||
#include "repairProcesses.h"
|
|
||||||
#include "Warning.h"
|
#include "Warning.h"
|
||||||
|
|
||||||
#include "misc.h"
|
|
||||||
#include "stm32f10x_rcc.h"
|
|
||||||
|
|
||||||
#include "CachedStorage.h"
|
|
||||||
#include "DisplayDevice.h"
|
|
||||||
#include "KeyboardDevice.h"
|
|
||||||
#include "MAX5715.h"
|
|
||||||
#include "nhd0420.h"
|
|
||||||
|
|
||||||
#include "platform.h"
|
|
||||||
#include "CathodeMCP.h"
|
#include "CathodeMCP.h"
|
||||||
|
#include "CoverSolenoid.h"
|
||||||
#include "Interlock.h"
|
#include "Interlock.h"
|
||||||
#include "internalADC.h"
|
|
||||||
#include "InternalFlash.h"
|
|
||||||
#include "gpio.h"
|
|
||||||
#include "IODevice.h"
|
|
||||||
#include "keypadMatrix.h"
|
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "MemoryDevice.h"
|
#include "nhd0420.h"
|
||||||
|
#include "Power6V5Supply.h"
|
||||||
|
#include "TeslaGunSafety.h"
|
||||||
|
|
||||||
#include "PCBA.h"
|
#include "PCBA.h"
|
||||||
#include "uart.h"
|
#include "uart.h"
|
||||||
#include "spi.h"
|
|
||||||
#include "spiDevice.h"
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Constant and macro definitions
|
// Constant and macro definitions
|
||||||
@@ -89,6 +78,7 @@ struct LedTaskArguments
|
|||||||
int frequency;
|
int frequency;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// File-scope variables
|
// File-scope variables
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -102,9 +92,9 @@ static xTaskHandle initTaskHandle;
|
|||||||
static xTaskHandle ledTaskHandle;
|
static xTaskHandle ledTaskHandle;
|
||||||
static xTaskHandle sysTaskHandle;
|
static xTaskHandle sysTaskHandle;
|
||||||
|
|
||||||
//static struct HwValidationMenu _hwValidation = {.initialized = false};
|
static struct HwValidationMenu _hwValidation = {.initialized = false};
|
||||||
//static struct HwValidationMenuItems hwTestItems;
|
static struct HwValidationMenuItems hwTestItems;
|
||||||
//struct HwValidationMenu* hwValidation = &_hwValidation;
|
struct HwValidationMenu* hwValidation = &_hwValidation;
|
||||||
|
|
||||||
static struct CachedStorage cs = {.initialized = false};
|
static struct CachedStorage cs = {.initialized = false};
|
||||||
static struct CachedStorage deviceParameters = {.initialized = false};
|
static struct CachedStorage deviceParameters = {.initialized = false};
|
||||||
@@ -153,7 +143,7 @@ void vApplicationTickHook ()
|
|||||||
|
|
||||||
static void printSystemInfoTask(void* parameters)
|
static void printSystemInfoTask(void* parameters)
|
||||||
{
|
{
|
||||||
// while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
LOGGER_INFO(mainLog, "---------------------------------------");
|
LOGGER_INFO(mainLog, "---------------------------------------");
|
||||||
systeminfoCommandHandler();
|
systeminfoCommandHandler();
|
||||||
@@ -168,25 +158,9 @@ static ErrorStatus systeminfoCommandHandler(void)
|
|||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
freeMemory = xPortGetFreeHeapSize();
|
freeMemory = xPortGetFreeHeapSize();
|
||||||
snprintf(text, sizeof(text), "Free heap memory: %d bytes", freeMemory);
|
snprintf(text, sizeof(text), "Free heap memory: %d bytes", (int)freeMemory);
|
||||||
LOGGER_INFO(mainLog, text);
|
LOGGER_INFO(mainLog, text);
|
||||||
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(initTaskHandle);
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(ledTaskHandle);
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(sysTaskHandle);
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(interlock->taskHandle);
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(keypad->taskHandle);
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(mainDisplay->taskHandle);
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(repairMenus_getMainRepairMenu()->menuCore->taskHandle);
|
|
||||||
vTaskDelay(10);
|
|
||||||
OS_logTaskInfo(repairProcesses_getMainRepairProcess()->taskHandle);
|
|
||||||
|
|
||||||
|
|
||||||
return errorStatus;
|
return errorStatus;
|
||||||
@@ -194,65 +168,101 @@ static ErrorStatus systeminfoCommandHandler(void)
|
|||||||
|
|
||||||
static void initTask(void* parameters)
|
static void initTask(void* parameters)
|
||||||
{
|
{
|
||||||
// Create the error handler
|
ErrorStatus returnValue = SUCCESS;
|
||||||
Error_construct();
|
|
||||||
|
|
||||||
// Create the warning handler
|
if (returnValue == SUCCESS)
|
||||||
Warning_construct();
|
{
|
||||||
|
// Create the error handler
|
||||||
|
Error_construct();
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize the platform first
|
if (returnValue == SUCCESS)
|
||||||
// All IO is initialized here
|
{
|
||||||
// Also, all periphery and platform-specifics are initialized here
|
// Create the warning handler
|
||||||
// IRQs are defined here
|
Warning_construct();
|
||||||
initPlatform();
|
}
|
||||||
|
|
||||||
// Create a small task that only blinks a LED and flashes the identification letter on the display
|
if (returnValue == SUCCESS)
|
||||||
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 100, &ledTaskArguments, 0, &ledTaskHandle);
|
{
|
||||||
|
// Initialize the platform first
|
||||||
|
// All IO is initialized here
|
||||||
|
// Also, all periphery and platform-specifics are initialized here
|
||||||
|
// IRQs are defined here
|
||||||
|
initPlatform();
|
||||||
|
}
|
||||||
|
|
||||||
// Construct the displays
|
if (returnValue == SUCCESS)
|
||||||
Displays_construct();
|
{
|
||||||
|
// Construct the displays
|
||||||
|
Displays_construct();
|
||||||
|
}
|
||||||
|
|
||||||
// Construct the AD Converters
|
if (returnValue == SUCCESS)
|
||||||
ADConverters_construct();
|
{
|
||||||
|
// Construct the AD Converters
|
||||||
|
ADConverters_construct();
|
||||||
|
}
|
||||||
|
|
||||||
// Construct the DA Converters
|
if (returnValue == SUCCESS)
|
||||||
DAConverters_construct();
|
{
|
||||||
|
// Construct the DA Converters
|
||||||
|
DAConverters_construct();
|
||||||
|
}
|
||||||
|
|
||||||
hsb_generateStartScreen(mainDisplay);
|
if (returnValue == SUCCESS)
|
||||||
// Let start screen stay for 5 seconds
|
{
|
||||||
vTaskDelay(INIT_START_SCREEN_DELAY);
|
hsb_generateStartScreen(mainDisplay);
|
||||||
|
// Let start screen stay for 5 seconds
|
||||||
|
vTaskDelay(INIT_START_SCREEN_DELAY);
|
||||||
|
}
|
||||||
|
|
||||||
// Construct/Load the device parameters
|
if (returnValue == SUCCESS)
|
||||||
DeviceParameters_construct(&deviceParameters, &iFlash->memoryDevice);
|
{
|
||||||
|
// Construct/Load the device parameters
|
||||||
|
DeviceParameters_construct(&deviceParameters, &iFlash->memoryDevice);
|
||||||
|
}
|
||||||
|
|
||||||
// Construct the repair presets
|
if (returnValue == SUCCESS)
|
||||||
RepairPresets_construct(&cs, &iFlash->memoryDevice);
|
{
|
||||||
|
// Construct the repair presets
|
||||||
|
RepairPresets_construct(&cs, &iFlash->memoryDevice);
|
||||||
|
}
|
||||||
|
|
||||||
///TODO MUST BE UPDATED
|
if (returnValue == SUCCESS)
|
||||||
// hwTestItems.display = &nhd0420->displayDevice;
|
{
|
||||||
// hwTestItems.internalADC = adc1;
|
hwTestItems.display = &nhd0420->displayDevice;
|
||||||
// hwTestItems.externalDAC = max5715;
|
hwTestItems.internalADC = adc1;
|
||||||
// hwTestItems.power6v5Enable = power6v5Enable;
|
hwTestItems.externalDAC = max5715;
|
||||||
// hwTestItems.interlockNO = interlockNO;
|
hwTestItems.power6v5Enable = Power6V5Supply_getGPIO();
|
||||||
// hwTestItems.interlockNC = interlockNC;
|
hwTestItems.interlockNO = interlock->NO.io;
|
||||||
// hwTestItems.solenoid = solenoid;
|
hwTestItems.interlockNC = interlock->NC.io;
|
||||||
// hwTestItems.mcp0Relay = mcp0Relay;
|
hwTestItems.TeslaSecurity = TeslaGunSafety_getGpio();
|
||||||
// hwTestItems.mcp1Relay = mcp1Relay;
|
hwTestItems.solenoid = CoverSolenoid_getGpio();
|
||||||
// hwTestItems.mcp2Relay = mcp2Relay;
|
hwTestItems.mcp0Relay = CathodeMCP_getInstance()->mcp0;
|
||||||
// hwTestItems.cat0Relay = cat0Relay;
|
hwTestItems.mcp1Relay = CathodeMCP_getInstance()->mcp1;
|
||||||
// hwTestItems.cat1Relay = cat1Relay;
|
hwTestItems.mcp2Relay = CathodeMCP_getInstance()->mcp2;
|
||||||
// hwTestItems.cat2Relay = cat2Relay;
|
hwTestItems.cat0Relay = CathodeMCP_getInstance()->cat0;
|
||||||
// hwTestItems.pcba = PCBA_getInstance();
|
hwTestItems.cat1Relay = CathodeMCP_getInstance()->cat1;
|
||||||
// hwTestItems.keypad = keypad;
|
hwTestItems.cat2Relay = CathodeMCP_getInstance()->cat2;
|
||||||
// EEPROM TO BE DONE
|
hwTestItems.pcba = PCBA_getInstance();
|
||||||
// HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 1, 1024);
|
hwTestItems.keypad = keypad;
|
||||||
|
// EEPROM TO BE DONE
|
||||||
|
HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 1, 1024);
|
||||||
|
}
|
||||||
|
|
||||||
// Construct the repair menu
|
if (returnValue == SUCCESS)
|
||||||
repairMenus_construct();
|
{
|
||||||
|
// Create task that repeats to print out TASK information on the logger
|
||||||
|
xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 0, &sysTaskHandle);
|
||||||
|
// Create a small task that only blinks a LED and flashes the identification letter on the display
|
||||||
|
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 100, &ledTaskArguments, 0, &ledTaskHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (returnValue == SUCCESS)
|
||||||
// Create task that repeats to print out TASK information on the logger
|
{
|
||||||
xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 0, &sysTaskHandle);
|
// Construct the repair menu
|
||||||
|
repairMenus_construct();
|
||||||
|
}
|
||||||
|
|
||||||
// Delete this init task
|
// Delete this init task
|
||||||
vTaskDelete(NULL);
|
vTaskDelete(NULL);
|
||||||
|
|||||||
@@ -318,13 +318,13 @@ static void repairMenu_printWarning(struct MenuCore* self)
|
|||||||
|
|
||||||
static void repairMenu_printRepair(struct MenuCore* self)
|
static void repairMenu_printRepair(struct MenuCore* self)
|
||||||
{
|
{
|
||||||
int loopCounter = 0;
|
|
||||||
char buffer[20];
|
|
||||||
|
|
||||||
struct RepairMenu* repairMenu = repairMenus_getMainRepairMenu();
|
struct RepairMenu* repairMenu = repairMenus_getMainRepairMenu();
|
||||||
struct RepairProcess* repairProcess = repairProcesses_getMainRepairProcess();
|
struct RepairProcess* repairProcess = repairProcesses_getMainRepairProcess();
|
||||||
if (repairProcess_isProcessRunning(repairProcess))
|
if (repairProcess_isProcessRunning(repairProcess))
|
||||||
{
|
{
|
||||||
|
int loopCounter = 0;
|
||||||
|
char buffer[20];
|
||||||
if (xSemaphoreTake(repairMenu->repairScreenUpdateSemaphore, 0) != pdTRUE)
|
if (xSemaphoreTake(repairMenu->repairScreenUpdateSemaphore, 0) != pdTRUE)
|
||||||
{
|
{
|
||||||
// Taking semaphore failed - no update on the screen
|
// Taking semaphore failed - no update on the screen
|
||||||
|
|||||||
@@ -83,7 +83,10 @@ ErrorStatus repairMenus_construct(void)
|
|||||||
{
|
{
|
||||||
// Create the Menu core
|
// Create the Menu core
|
||||||
returnValue = MenuCore_construct(menuCore, mainDisplay, &storm700->keyboardDevice, HSB_MAINMENU_TASK_PRIORITY, HSB_MAINMENU_TASK_STACKSIZE, repairMenu_createMenuEntries, repairMenu_menuStateHandle);
|
returnValue = MenuCore_construct(menuCore, mainDisplay, &storm700->keyboardDevice, HSB_MAINMENU_TASK_PRIORITY, HSB_MAINMENU_TASK_STACKSIZE, repairMenu_createMenuEntries, repairMenu_menuStateHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (returnValue == SUCCESS)
|
||||||
|
{
|
||||||
// Create first repair menu
|
// Create first repair menu
|
||||||
returnValue = repairMenu_construct(mainMenu, menuCore,&iFlash->memoryDevice, repairMenus_freeMainMenuRepairScreenUpdateSemaphore);
|
returnValue = repairMenu_construct(mainMenu, menuCore,&iFlash->memoryDevice, repairMenus_freeMainMenuRepairScreenUpdateSemaphore);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,12 +229,10 @@ static void repairProcess_task(void* parameters)
|
|||||||
|
|
||||||
while(self->runTask)
|
while(self->runTask)
|
||||||
{
|
{
|
||||||
// LOGGER_DEBUG(mainLog, "----------------------------------------");
|
|
||||||
xSemaphoreTake(self->secondsSyncronisation, portMAX_DELAY);
|
xSemaphoreTake(self->secondsSyncronisation, portMAX_DELAY);
|
||||||
|
|
||||||
// The signal profile is identical for all rows in the regulation process
|
// The signal profile is identical for all rows in the regulation process
|
||||||
SignalProfileGenerator_calculate(&self->signalProfileGenerator);
|
SignalProfileGenerator_calculate(&self->signalProfileGenerator);
|
||||||
// LOGGER_DEBUG(mainLog, "Signal: %d, TimeToRemain %d", self->signalProfileGenerator.signal, (unsigned int)SignalProfileGenerator_getRemainingTime(&self->signalProfileGenerator));
|
|
||||||
|
|
||||||
// Check for correct signal
|
// Check for correct signal
|
||||||
if (!SignalProfileGenerator_isPaused(&self->signalProfileGenerator))
|
if (!SignalProfileGenerator_isPaused(&self->signalProfileGenerator))
|
||||||
@@ -278,8 +276,7 @@ static void repairProcess_task(void* parameters)
|
|||||||
// Send the PID value to the DAC
|
// Send the PID value to the DAC
|
||||||
DAConverter_setOutputVoltage(self->row[loopCounter].dacChannel, self->row[loopCounter].lastDACValue);
|
DAConverter_setOutputVoltage(self->row[loopCounter].dacChannel, self->row[loopCounter].lastDACValue);
|
||||||
|
|
||||||
// LOGGER_DEBUG(mainLog, "Row %d --- ADC: %d Error: %d PID: %d", loopCounter, self->row[loopCounter].lastADCValue, self->row[loopCounter].pidError, self->row[loopCounter].lastDACValue);
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ROW is in error state
|
// ROW is in error state
|
||||||
@@ -289,6 +286,15 @@ static void repairProcess_task(void* parameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Process is paused
|
||||||
|
// RESET the PIDs
|
||||||
|
for (loopCounter = ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 0); loopCounter <= ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 2); loopCounter++)
|
||||||
|
{
|
||||||
|
PID_reset(&self->row[loopCounter].pid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Notify observers that an update is available
|
// Notify observers that an update is available
|
||||||
Observable_notifyObservers(&self->observable, NULL);
|
Observable_notifyObservers(&self->observable, NULL);
|
||||||
|
|||||||
@@ -60,11 +60,10 @@ ErrorStatus repairProcessRow_construct(struct RepairProcessRow* self, const stru
|
|||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
|
|
||||||
int iMin = 0;
|
|
||||||
int iMax = 0;
|
|
||||||
|
|
||||||
if (!self->initialized)
|
if (!self->initialized)
|
||||||
{
|
{
|
||||||
|
int iMin = 0;
|
||||||
|
int iMax = 0;
|
||||||
if (returnValue == SUCCESS)
|
if (returnValue == SUCCESS)
|
||||||
{
|
{
|
||||||
self->adcChannel = adcChannel;
|
self->adcChannel = adcChannel;
|
||||||
|
|||||||
Reference in New Issue
Block a user