Fixed several issues:
- ADC has now averaging - Pause screen added - Fixed display glitches for most parts git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@258 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -69,6 +69,8 @@ struct Pid
|
||||
* @param Kp proportional constant
|
||||
* @param Ki integration constant
|
||||
* @param Kd differential constant
|
||||
* @param iMin Minimum value for integrator
|
||||
* @param iMax Maximum value for integrator
|
||||
*
|
||||
* @return ErrorStatus SUCCESS if initialisation was successful
|
||||
* ERRROR otherwise
|
||||
@@ -79,6 +81,20 @@ struct Pid
|
||||
extern ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd, int iMin, int iMax);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PID_destruct
|
||||
* Destructor for a PID regulator
|
||||
*
|
||||
* @param self PID object to destruct
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PID_destruct(struct Pid* self);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PID_calculate
|
||||
* Calculate
|
||||
|
||||
@@ -145,16 +145,28 @@ static void InterlockTask (void* parameters)
|
||||
|
||||
while(1)
|
||||
{
|
||||
// Interlock was OK when the IRQ became active
|
||||
// This tasks debounces the Interlock against accidental detections
|
||||
// THe semaphore is given from ISR
|
||||
xSemaphoreTake(self->semaphore, portMAX_DELAY);
|
||||
// Wait for the debounce time
|
||||
vTaskDelay(self->waitToDebounce_ms);
|
||||
|
||||
if (self->ID == COMMON_INTERLOCK)
|
||||
// Check if the Interrupt was justified
|
||||
if (!Interlock_isClosed(self))
|
||||
{
|
||||
Error_postError(INTERLOCK_COMMON_FAIL);
|
||||
// The Interlock is open, so the Interrupt was justified
|
||||
if (self->ID == COMMON_INTERLOCK)
|
||||
{
|
||||
Error_postError(INTERLOCK_COMMON_FAIL);
|
||||
}
|
||||
else if (self->ID == TESLA_INTERLOCK)
|
||||
{
|
||||
Error_postError(INTERLOCK_TESLA_FAIL);
|
||||
}
|
||||
}
|
||||
else if (self->ID == TESLA_INTERLOCK)
|
||||
else
|
||||
{
|
||||
Error_postError(INTERLOCK_TESLA_FAIL);
|
||||
// False alarm
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,12 @@ ErrorStatus PID_construct(struct Pid* self, int Kp, int Ki, int Kd, int iMin, in
|
||||
}
|
||||
|
||||
|
||||
void PID_destruct(struct Pid* self)
|
||||
{
|
||||
self->initialized = false;
|
||||
}
|
||||
|
||||
|
||||
int PID_calculate(struct Pid* self, int error)
|
||||
{
|
||||
int returnValue = 0;
|
||||
|
||||
@@ -397,12 +397,21 @@ static ErrorStatus write(const struct DisplayDevice* self, const char* buffer, s
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
if (self->initialized)
|
||||
{
|
||||
if ((length + 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, length);
|
||||
int loopcounter;
|
||||
for (loopcounter = 0; loopcounter < length; loopcounter++)
|
||||
{
|
||||
returnValue = NHD0420_sendData((const struct NHD0420*)self, &buffer[loopcounter], 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user