Most parts of the menu structure are functional.
Error handler added Screens for warning, pause, FINISH etc yet to be added git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@255 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -44,11 +44,16 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COMMON_INTERLOCK = 0,
|
||||
TESLA_INTERLOCK = !COMMON_INTERLOCK
|
||||
} T_INTERLOCK_ID;
|
||||
|
||||
struct InterlockElement
|
||||
{
|
||||
struct Gpio* io;
|
||||
@@ -60,6 +65,7 @@ struct Interlock
|
||||
struct InterlockElement NO;
|
||||
struct InterlockElement NC;
|
||||
bool initialized;
|
||||
T_INTERLOCK_ID ID;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -82,7 +88,7 @@ struct Interlock
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus Interlock_construct(struct Interlock* self, struct Gpio* NO, EXTI_InitTypeDef NOEXTI, struct Gpio* NC, EXTI_InitTypeDef NCEXTI);
|
||||
extern ErrorStatus Interlock_construct(struct Interlock* self, T_INTERLOCK_ID ID, struct Gpio* NO, EXTI_InitTypeDef NOEXTI, struct Gpio* NC, EXTI_InitTypeDef NCEXTI);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
|
||||
@@ -54,11 +54,12 @@
|
||||
// Function definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
ErrorStatus Interlock_construct(struct Interlock* self, struct Gpio* NO, EXTI_InitTypeDef NOEXTI, struct Gpio* NC, EXTI_InitTypeDef NCEXTI)
|
||||
ErrorStatus Interlock_construct(struct Interlock* self, T_INTERLOCK_ID ID, struct Gpio* NO, EXTI_InitTypeDef NOEXTI, struct Gpio* NC, EXTI_InitTypeDef NCEXTI)
|
||||
{
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
if (!self->initialized)
|
||||
{
|
||||
self->ID = ID;
|
||||
self->NO.io = NO;
|
||||
self->NO.ioEXTI = NOEXTI;
|
||||
self->NC.io = NC;
|
||||
@@ -77,8 +78,9 @@ void Interlock_getStatus(struct Interlock* self, FunctionalState* command, int*
|
||||
{
|
||||
*command = self->NO.ioEXTI.EXTI_LineCmd;
|
||||
|
||||
IODevice_read((struct IODevice*)self->NO.io, (char*)NO, 1, NULL);
|
||||
IODevice_read((struct IODevice*)self->NC.io, (char*)NC, 1, NULL);
|
||||
size_t actualLength;
|
||||
IODevice_read((struct IODevice*)self->NO.io, (char*)NO, 1, &actualLength);
|
||||
IODevice_read((struct IODevice*)self->NC.io, (char*)NC, 1, &actualLength);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,9 +90,10 @@ bool Interlock_isClosed(struct Interlock* self)
|
||||
|
||||
char no;
|
||||
char nc;
|
||||
size_t actualLength;
|
||||
|
||||
IODevice_read((struct IODevice*)self->NO.io, &no, 1, NULL);
|
||||
IODevice_read((struct IODevice*)self->NC.io, &nc, 1, NULL);
|
||||
IODevice_read((struct IODevice*)self->NO.io, &no, 1, &actualLength);
|
||||
IODevice_read((struct IODevice*)self->NC.io, &nc, 1, &actualLength);
|
||||
|
||||
if ((no != 0) && (nc == 0))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user