Added Altium Project files

git-svn-id: file:///srv/dev-disk-by-uuid-17e88007-4d0c-45e0-8757-cacfcc458630/repositories/svn/Diplomarbeit@131 9fe90eed-be63-e94b-8204-d34ff4c2ff93
This commit is contained in:
Matthias
2009-01-15 10:28:29 +00:00
parent e92b94654b
commit f468e09499
66 changed files with 3619 additions and 60 deletions
+2 -1
View File
@@ -96,7 +96,7 @@ void CallMenu(void)
UINT8 buffer;
BOOLEAN receive;
char separator[] = " ";
char separator[] = " "; /* Seperator list for strtok() */
char *commandt;
char *pcmd;
char *arg1t;
@@ -126,6 +126,7 @@ void CallMenu(void)
do /* do-while loop for String input */
{
/* Read from serial port input buffer */
if ((receive = serGet(MenuPort, &buffer) == TRUE))
{
if (buffer == '\t')
@@ -49,6 +49,16 @@ typedef void (*fpointer)(void);
* ---------------------------------------------------------------------------
*/
/* ---------------------------------------------------------------------------
* Function: menuInit
*
* Initialises the menu structure and calculates the offset table
*
* Parameters: void
*
* Return: void
* ---------------------------------------------------------------------------
*/
void menuInit (void);
#endif /*MENUARGS_H_*/
@@ -49,6 +49,7 @@
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalInitialised = FALSE;
/* ---------------------------------------------------------------------------
* Local variable definitions
* ---------------------------------------------------------------------------
@@ -72,6 +73,8 @@ void remoteDioInit (void)
NewLine, "Initialise digital remote buffers", Dummy);
sendString (SerOutPort, FALSE, importantMessage,
"\tInputs...", Dummy, Dummy);
/* reset stat array of remote digital inputs */
for (loopcnt = 0; loopcnt < NUMBER_OF_TOTAL_DI; loopcnt++)
{
remoteDigitalInputs[loopcnt] = FALSE;
@@ -81,6 +84,8 @@ void remoteDioInit (void)
sendString (SerOutPort, FALSE, importantMessage,
"\tOutputs...", Dummy, Dummy);
/* Reset stat array of remote digital outputs */
for (loopcnt = 0; loopcnt < NUMBER_OF_TOTAL_DO; loopcnt++)
{
remoteDigitalOutputs[loopcnt] = FALSE;
@@ -88,10 +93,11 @@ void remoteDioInit (void)
sendString (SerOutPort, FALSE, importantMessage,
"Done", Dummy, Dummy);
/* Create and afterwards take the remote_digital semaphore */
vSemaphoreCreateBinary (remoteDigitalSemaphore);
sendString (SerOutPort, TRUE, importantMessage,
"Take digital semaphore... ", Dummy, Dummy);
/* Print out if semaphore-taking was successful */
if (xSemaphoreTake(remoteDigitalSemaphore, 0) == pdTRUE)
{
sendString (SerOutPort, FALSE, importantMessage,
@@ -103,12 +109,13 @@ void remoteDioInit (void)
"Failed", Dummy, Dummy);
}
/* Set all mainboard and extensionboard outputs to LOW */
sendString(SerOutPort, TRUE, importantMessage,
"reset remote digital outputs...", Dummy, Dummy);
set_mb = remoteDioWriteAll (remoteDeviceNumber, digital_mb, FALSE);
set_eb = remoteDioWriteAll (remoteDeviceNumber, digital_eb, FALSE);
/* Print out if setting of remote outputs was successful */
if ((set_mb == OK) && (set_eb == OK))
{
sendString(SerOutPort, FALSE, importantMessage, "Done", Dummy, Dummy);
@@ -131,27 +138,32 @@ RESULT remoteDioWrite (UINT8 device, UINT8 channel, BOOLEAN value)
/* Remote digital driver is not initialised */
sendString (SerOutPort, TRUE, importantMessage,
"\t\tdigital not intialised", Dummy, Dummy);
return (ERROR);
return (ERROR); /* Return error result */
}
/* Copy channelnumber and value to array that will be sent */
sendArray[0] = (INT32) channel;
sendArray[1] = (INT32) value;
/* Call DigitalWrite on remote device */
bpSendCallRpc(handleBus1, device, 20, 2, sendArray);
/* Take digital Semaphore with predefined timeout */
if (xSemaphoreTake(remoteDigitalSemaphore, 3000) != pdTRUE)
{
sendString (SerOutPort, TRUE, importantMessage,
s_tab, "digital write was not successful", Dummy);
returnValue = ERROR;
}
else
{
remoteDigitalOutputs[channel] = value;
returnValue = OK;
}
{
/* Semaphore was able to be taken, return error result */
sendString (SerOutPort, TRUE, importantMessage,
s_tab, "digital write was not successful", Dummy);
returnValue = ERROR;
}
else
{
/* Semaphore was taken successfully, return OK result */
remoteDigitalOutputs[channel] = value;
returnValue = OK;
}
return (returnValue);
}
@@ -165,6 +177,7 @@ RESULT remoteDioWriteAll(UINT8 device, t_boardtype_digital board, BOOLEAN value)
RESULT returnValue;
if (remoteDigitalInitialised == FALSE)
{
/* Remote digital driver is not initialised */
@@ -173,13 +186,17 @@ RESULT remoteDioWriteAll(UINT8 device, t_boardtype_digital board, BOOLEAN value)
return (ERROR);
}
/* Copy boardtype and value to array that will be sent */
sendArray[0] = (INT32)board;
sendArray[1] = (INT32)value;
/* Call DigitalWriteAll on remote device */
bpSendCallRpc(handleBus1, device, 21, 2, sendArray);
/* Take digital Semaphore with predefined timeout */
if (xSemaphoreTake(remoteDigitalSemaphore, 3000) != pdTRUE)
{
/* Semaphore was able to be taken, return error result */
sendString(SerOutPort, TRUE, importantMessage, s_tab,
"digital write was not successful", Dummy);
@@ -187,30 +204,34 @@ RESULT remoteDioWriteAll(UINT8 device, t_boardtype_digital board, BOOLEAN value)
}
else
{
/* Semaphore was taken successfully */
/* Switch depending on the board type */
switch (board)
{
case digital_mb:
/* Set loop values for mainboard */
loopcnt = 0;
loopend = NUMBER_OF_DO_MB;
break;
case digital_eb:
/* Set loop values for extensionboard */
loopcnt = NUMBER_OF_DO_MB;
loopend = NUMBER_OF_TOTAL_DO;
break;
}
/* Write all values in local stat array to given value in a loop */
for (loopcnt; loopcnt < loopend; loopcnt++)
{
remoteDigitalOutputs[loopcnt] = value;
// \TODO IS THIS LOOP WORKING??
}
returnValue = OK;
returnValue = OK; /* Set result to OK */
}
return (returnValue);
return (returnValue); /* Return result */
}
@@ -229,19 +250,27 @@ BOOLEAN remoteDioRead (UINT8 device, INT32 channel)
return (ERROR);
}
/* Call DigitalRead on remote device */
bpSendCallRpc(handleBus1, device, 22, 1, channelArray);
/* Take digital Semaphore with predefined timeout */
if (xSemaphoreTake(remoteDigitalSemaphore, 3000) != pdTRUE)
{
/* Semaphore was able to be takenprint out error message */
sendString (SerOutPort, TRUE, importantMessage,
s_tab, "digital read did not receive a readback", Dummy);
}
else
{
/* The actual value is received in the resultfunction
* "digitalReadResult" (see below in this file). This function
* handles the received value to the global variable
* "remoteDioReadresult", which is read below
*/
remoteDigitalInputs[channel] = remoteDioReadResult;
}
return (remoteDioReadResult);
return (remoteDioReadResult); /* Return result */
}
@@ -259,9 +288,13 @@ void remoteDioReadAll (UINT8 device, t_boardtype_digital board)
return;
}
/* Call DigitalReadAll on remote device */
bpSendCallRpc(handleBus1, device, 23, 1, boardArray);
/* Take digital Semaphore with predefined timeout */
if (xSemaphoreTake(remoteDigitalSemaphore, 3000) != pdTRUE)
{
/* Semaphore was able to be takenprint out error message */
sendString (SerOutPort, TRUE, importantMessage,
s_tab, "digital read all did not receive a readback", Dummy);
}
@@ -276,18 +309,18 @@ void remoteDioReadAll (UINT8 device, t_boardtype_digital board)
void remoteDigitalSemaphoreRelease (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results)
{
if (remoteDigitalInitialised == FALSE)
{
/* Remote digital driver is not initialised */
/* Remote digital driver is not initialised, semaphore unaccessible */
sendString (SerOutPort, TRUE, importantMessage,
"\t\tdigital not intialised", Dummy, Dummy);
return;
return; /* Return without action */
}
xSemaphoreGive (remoteDigitalSemaphore);
xSemaphoreGive (remoteDigitalSemaphore); /* Release digital Semaphore */
}
void digitalReadResult (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results)
{
@@ -296,7 +329,7 @@ void digitalReadResult (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results)
/* Remote digital driver is not initialised */
sendString (SerOutPort, TRUE, importantMessage,
"\t\tdigital not intialised", Dummy, Dummy);
return;
return; /* Return without action */
}
/* nrOfResults = 2
@@ -312,7 +345,7 @@ void digitalReadResult (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results)
/* Remote digital input is HIGH */
remoteDioReadResult = TRUE;
}
xSemaphoreGive (remoteDigitalSemaphore);
xSemaphoreGive (remoteDigitalSemaphore); /* Release digital Semaphore */
}
@@ -342,13 +375,16 @@ void digitalReadAllResult (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results)
/* Incoming Results are from Mainboard */
for (loopcnt = 0; loopcnt < NUMBER_OF_DI_MB; loopcnt++)
{
/* Write incoming result to channel bit */
tempValue = (results[1] & (0x0000 | (1 << loopcnt)));
if (tempValue == 0)
{
/* Received result is a LOW value - write to stat array */
remoteDigitalInputs[loopcnt] = FALSE;
}
else
{
/* Received result is a HIGH value - write to stat array */
remoteDigitalInputs[loopcnt] = TRUE;
}
}
@@ -359,18 +395,21 @@ void digitalReadAllResult (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results)
/* Incoming Results are from Extensionboard */
for (loopcnt = 0; loopcnt < NUMBER_OF_DI_EB; loopcnt++)
{
/* Write incoming result to channel bit */
tempValue = (results[1] & (0x0000 | (1 << loopcnt)));
if (tempValue == 0)
{
/* Received result is a LOW value - write to stat array */
remoteDigitalInputs[(loopcnt + NUMBER_OF_DI_MB)] = FALSE;
}
else
{
/* Received result is a HIGH value - write to stat array */
remoteDigitalInputs[(loopcnt + NUMBER_OF_DI_MB)] = TRUE;
}
}
}
xSemaphoreGive (remoteDigitalSemaphore);
xSemaphoreGive (remoteDigitalSemaphore); /* Release digital Semaphore */
}
@@ -55,32 +55,137 @@ typedef enum
* Variable declarations.
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalInputs[(NUMBER_OF_TOTAL_DI)];
BOOLEAN remoteDigitalOutputs[(NUMBER_OF_TOTAL_DO)];
xSemaphoreHandle remoteDigitalSemaphore;
xSemaphoreHandle remoteDigitalSemaphore; /* Prototype of digital Semaphore*/
/* ---------------------------------------------------------------------------
* Function declarations.
* ---------------------------------------------------------------------------
*/
/* ---------------------------------------------------------------------------
* Function: remoteDioInit
*
* Initialisation of the digital remote driver, creates and takes digital
* Semaphore.
*
* Parameters: void
*
* Return: void
* ---------------------------------------------------------------------------
*/
void remoteDioInit (void);
/* ---------------------------------------------------------------------------
* Function: remoteDioWrite
*
* Sets or cleans a digital output on the remote device
*
* Parameters: UINT8 device - Number of the remote device
* UINT8 channel - Number of the effected remote channel
* BOOLEAN value - Value to be written
*
* Return: RESULT - Indicates the status of the write action
* ---------------------------------------------------------------------------
*/
RESULT remoteDioWrite (UINT8 device, UINT8 channel, BOOLEAN value);
/* ---------------------------------------------------------------------------
* Function: remoteDioWriteAll
*
* Sets or cleans all digital outputs of a kind on the remote device
*
* Parameters: UINT8 device - Number of the remote device
* t_boardtype_digital board - Type of board (MB or EB)
* BOOLEAN value - Value to be written
*
* Return: RESULT - Indicates the status of the write action
* ---------------------------------------------------------------------------
*/
RESULT remoteDioWriteAll (UINT8 device, t_boardtype_digital board, BOOLEAN value);
/* ---------------------------------------------------------------------------
* Function: remoteDioRead
*
* reads from one remote digital input. If the result fails, the previous
* generated result will be returned.
*
* Parameters: UINT8 device - Number of the remote device
* UINT8 channel - Number of the effected remote channel
*
* Return: BOOLEAN - The read result
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDioRead (UINT8 device, INT32 channel);
/* ---------------------------------------------------------------------------
* Function: remoteDioReadAll
*
* reads from all remote digital inputs. If the result fails, nothing happens
*
* Parameters: UINT8 device - Number of the remote device
* t_boardtype_digital board - Type of board (MB or EB)
*
* Return: void
* ---------------------------------------------------------------------------
*/
void remoteDioReadAll (UINT8 device, t_boardtype_digital board);
/* ---------------------------------------------------------------------------
* Function: remoteDigitalSemaphoreRelease
*
* Is called as a result from the remote device to release the digital
* Semaphore. This call is the last statement within the remote procedure.
* It assures that the complete function is executed before the local
* software resumes working.
*
* Parameters: UINT8 requestNr - Number of the momentary request
* UINT8 nrOfResults - Indicates how many values are returned
* UINT32 *results - Result-Array of "NrOfResults"-size
*
* Return: void
* ---------------------------------------------------------------------------
*/
void remoteDigitalSemaphoreRelease (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results);
/* ---------------------------------------------------------------------------
* Function: digitalReadResult
*
* Is called as a result from the remote device to transfer the read value.
* digitalReadResult stores the received value to a global variable.
*
* Parameters: UINT8 requestNr - Number of the momentary request
* UINT8 nrOfResults - Indicates how many values are returned
* UINT32 *results - Result-Array of "NrOfResults"-size
*
* Return: void
* ---------------------------------------------------------------------------
*/
void digitalReadResult (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results);
/* ---------------------------------------------------------------------------
* Function: digitalReadAllResult
*
* Is called as a result from the remote device to transfer the read value.
* digitalReadResult stores the received value to a global array.
*
* Parameters: UINT8 requestNr - Number of the momentary request
* UINT8 nrOfResults - Indicates how many values are returned
* UINT32 *results - Result-Array of "NrOfResults"-size
*
* Return: void
* ---------------------------------------------------------------------------
*/
void digitalReadAllResult (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results);
#endif /*DIGITAL_TEST_H_*/
@@ -80,11 +80,11 @@ BOOLEAN remoteAnalogueLinetestMBExecute (void)
remoteAnalogueOutput = remoteAnalogueOutputTest_MB();
sendString (SerOutPort, TRUE, resultMessage,
"remote analogue output test: ", f_tab, BoolRestoStr(remoteAnalogueOutput));
"remote analogue output: ", f_tab, BoolRestoStr(remoteAnalogueOutput));
remoteAnalogueInput = remoteAnalogueInputTest_MB();
sendString (SerOutPort, TRUE, resultMessage,
"remote analogue input test: ", f_tab, BoolRestoStr(remoteAnalogueInput));
"remote analogue input: ", f_tab, BoolRestoStr(remoteAnalogueInput));
if ((remoteAnalogueOutput == TRUE) && (remoteAnalogueInput == TRUE))
{
@@ -95,6 +95,9 @@ BOOLEAN remoteAnalogueLinetestMBExecute (void)
returnValue = FALSE;
}
sendString (SerOutPort, TRUE, resultMessage,
"remote analogue test: ", f_tab, BoolRestoStr(remoteAnalogueInput));
return (returnValue);
}
@@ -69,53 +69,71 @@ BOOLEAN remoteDigitalLinetestMBExecute (void)
BOOLEAN remoteDigitalOutput;
BOOLEAN remoteDigitalInput;
/* Call mainboard digital output test and print out result afterwards */
remoteDigitalOutput = remoteDigitalOutputTest_MB();
sendString (SerOutPort, TRUE, resultMessage,
"remote digital_mb output test: ", f_tab, BoolRestoStr(remoteDigitalOutput));
"remote digital_mb output: ", f_tab, BoolRestoStr(remoteDigitalOutput));
/* Call mainboard digital input test and print out result afterwards */
remoteDigitalInput = remoteDigitalInputTest_MB();
sendString (SerOutPort, TRUE, resultMessage,
"remote digital_mb input test: ", f_tab, BoolRestoStr(remoteDigitalInput));
"remote digital_mb input: ", f_tab, BoolRestoStr(remoteDigitalInput));
/* Calculate test result */
if ((remoteDigitalOutput == TRUE) && (remoteDigitalInput == TRUE))
{
/* Test is passed */
returnValue = TRUE;
}
else
{
/* Test is passed */
returnValue = FALSE;
}
sendString (SerOutPort, TRUE, resultMessage,
"remote digital_mb test: ", f_tab, BoolRestoStr(remoteDigitalInput));
return (returnValue);
}
BOOLEAN remoteDigitalLinetestEBExecute (void)
{
// \MARK NEW PINSETTINGS FOR TESTER (2)
#if (PINSET_TESTER == 2)
#if (PINSET_TESTER == 2)
/* Extensionboard Test is available only on the specified test device */
BOOLEAN returnValue;
BOOLEAN remoteDigitalOutput;
BOOLEAN remoteDigitalInput;
/* Call extensionboard digital output test and print result afterwards */
remoteDigitalOutput = remoteDigitalOutputTest_EB();
sendString (SerOutPort, TRUE, resultMessage,
"remote digital_eb output test: ", f_tab, BoolRestoStr(remoteDigitalOutput));
/* Call extensionboard digital input test and print result afterwards */
remoteDigitalInput = remoteDigitalInputTest_EB();
sendString (SerOutPort, TRUE, resultMessage,
"remote digital_eb input test: ", f_tab, BoolRestoStr(remoteDigitalInput));
/* Calculate test result */
if ((remoteDigitalOutput == TRUE) && (remoteDigitalInput == TRUE))
{
/* Test is passed */
returnValue = TRUE;
}
else
{
/* Test is failed */
returnValue = FALSE;
}
return (returnValue);
#else
/* If other board than specific tester, printf out "test unavailable" text */
sendString (SerOutPort, TRUE, importantMessage,
"Extension Board test not available on this device", Dummy, Dummy);
@@ -136,11 +154,13 @@ BOOLEAN remoteDigitalOutputTest_MB (void)
/* Reset all remote digital outputs to LOW/OFF */
remoteDioWriteAll(remoteDeviceNumber, digital_mb, FALSE);
vTaskDelay (200);
vTaskDelay (500); /* Wait for reset remote outputs*/
/* Test each channel individually within a loop
* Loop-condition is the number of digital outputs on the test item
*/
for (channelcnt = 0; channelcnt < NUMBER_OF_DO_MB; channelcnt++)
{
{
/* Read remote digital channel value for LOW test */
if (dioRead(thisDeviceNumber, channelcnt) == FALSE)
{
@@ -192,11 +212,12 @@ BOOLEAN remoteDigitalOutputTest_MB (void)
}
}
/* Re-set remote digital output to LOW */
remoteDioWrite(remoteDeviceNumber, channelcnt, FALSE);
/* Message out Test Results */
sendString (SerOutPort, TRUE, testMessage,
"\tLinetest for Digital Input ", ItoDStr(channelcnt), ": ");
"\tLinetest for Digital Output (MB) ", ItoDStr(channelcnt), ": ");
sendString (SerOutPort, FALSE, testMessage,
" ", Dummy, BoolRestoStr (Low_Test));
sendString (SerOutPort, FALSE, testMessage,
@@ -205,13 +226,16 @@ BOOLEAN remoteDigitalOutputTest_MB (void)
" ", Dummy, BoolRestoStr (High_Test));
vTaskDelay (50);
/* If one of the individual tests fails, calculate a negative
* over-all test result
*/
if ((Low_Test == FALSE) || (High_Test == FALSE) || (AllOther_Test == FALSE))
{
returnResult = FALSE;
}
}
return (returnResult);
return (returnResult); /* Return test result to caller */
}
BOOLEAN remoteDigitalInputTest_MB (void)
@@ -225,8 +249,11 @@ BOOLEAN remoteDigitalInputTest_MB (void)
BOOLEAN AllOther_Test = TRUE;
dioClean(); /* Clean local digital outputs */
vTaskDelay (500);
vTaskDelay (500); /* Wait for local outputs */
/* Test each channel individually within a loop
* Loop-condition is the number of digital inputs on the test item
*/
for (channelcnt = 0; channelcnt < NUMBER_OF_DI_MB; channelcnt++)
{
if (remoteDioRead(remoteDeviceNumber, channelcnt) == FALSE)
@@ -239,21 +266,20 @@ BOOLEAN remoteDigitalInputTest_MB (void)
/* read back a HIGH Value, which is incorrect - LOW test failed */
Low_Test = FALSE;
}
vTaskDelay (200);
dioWrite(thisDeviceNumber, channelcnt, TRUE);
vTaskDelay(200);
/* Write local output to HIGH state */
dioWrite(thisDeviceNumber, channelcnt, TRUE);
vTaskDelay(200); /* Wait for local output */
if (remoteDioRead(remoteDeviceNumber, channelcnt) == TRUE)
{
/* Read back a HIGH Value, which is correct - HIGH test passed */
vTaskDelay(500);
High_Test = TRUE;
}
else
{
/* read back a LOW Value, which is incorrect - HIGH test failed */
vTaskDelay(500);
High_Test = FALSE;
}
@@ -286,7 +312,7 @@ BOOLEAN remoteDigitalInputTest_MB (void)
/* Message out Test Results */
sendString (SerOutPort, TRUE, testMessage,
"\tLinetest for Digital Input ", ItoDStr(channelcnt), ": ");
"\tLinetest for Digital Input (MB) ", ItoDStr(channelcnt), ": ");
sendString (SerOutPort, FALSE, testMessage,
" ", Dummy, BoolRestoStr (Low_Test));
sendString (SerOutPort, FALSE, testMessage,
@@ -295,13 +321,16 @@ BOOLEAN remoteDigitalInputTest_MB (void)
" ", Dummy, BoolRestoStr (High_Test));
vTaskDelay (50);
/* If one of the individual tests fails, calculate a negative
* over-all test result
*/
if ((Low_Test == FALSE) || (High_Test == FALSE) || (AllOther_Test == FALSE))
{
returnResult = FALSE;
}
}
return (returnResult);
return (returnResult); /* Return test result */
}
@@ -317,6 +346,7 @@ BOOLEAN remoteDigitalOutputTest_EB (void)
// \MARK NEW PINSETTINGS FOR TESTER (2)
#if (PINSET_TESTER == 2)
/* Necessary due to compiling on alternative boards */
dio_inMuxEn (TRUE); /* Switch dio to Extension Board*/
#endif
@@ -324,6 +354,14 @@ BOOLEAN remoteDigitalOutputTest_EB (void)
remoteDioWriteAll(remoteDeviceNumber, digital_eb, FALSE);
vTaskDelay (200);
/* Test each channel individually within a loop
* Loop-condition is the total number of digital outputs on the test item
* The remote digital write/read function counts up to 12 (8 MB + 4 EB),
* the local write/read only to 8. The 4 extension board connections
* must be switche manually. That is why the loop counting starts with
* the number of the mainboard outputs, which represents the first
* extensionboard output.
*/
for (channelcnt = NUMBER_OF_DO_MB; channelcnt < NUMBER_OF_TOTAL_DO; channelcnt++)
{
if (dioRead(thisDeviceNumber, (channelcnt - NUMBER_OF_DO_MB)) == FALSE)
@@ -376,7 +414,7 @@ BOOLEAN remoteDigitalOutputTest_EB (void)
}
/* Message out Test Results */
sendString (SerOutPort, TRUE, testMessage,
"\tLinetest for Digital Input ", ItoDStr(channelcnt), ": ");
"\tLinetest for Digital Ouput(EB) ", ItoDStr(channelcnt), ": ");
sendString (SerOutPort, FALSE, testMessage,
" ", Dummy, BoolRestoStr (Low_Test));
sendString (SerOutPort, FALSE, testMessage,
@@ -385,6 +423,9 @@ BOOLEAN remoteDigitalOutputTest_EB (void)
" ", Dummy, BoolRestoStr (High_Test));
vTaskDelay (50);
/* If one of the individual tests fails, calculate a negative
* over-all test result
*/
if ((Low_Test == FALSE) || (High_Test == FALSE) || (AllOther_Test == FALSE))
{
returnResult = FALSE;
@@ -393,10 +434,11 @@ BOOLEAN remoteDigitalOutputTest_EB (void)
// \MARK NEW PINSETTINGS FOR TESTER (2)
#if (PINSET_TESTER == 2)
/* Necessary due to compiling on alternative boards */
dio_inMuxEn (FALSE); /* Switch dio back to main Board*/
#endif
return (returnResult);
return (returnResult); /* Return test result */
}
@@ -412,12 +454,21 @@ BOOLEAN remoteDigitalInputTest_EB (void)
// \MARK NEW PINSETTINGS FOR TESTER (2)
#if (PINSET_TESTER == 2)
/* Necessary due to compiling on alternative boards */
dio_outMuxEn (TRUE); /* Switch dio to Extension Board*/
#endif
dioClean(); /* Clean local digital outputs */
vTaskDelay (500);
vTaskDelay (500); /* assure that cleaning is done */
/* Test each channel individually within a loop
* Loop-condition is the number of digital inputs available on the
* extension board. The remote digital write/read function counts up
* to 12 (8 MB + 4 EB), the local write/read only to 8. The 4 extension
* board connections must be switched manually (first 4 local inputs).
* This is why the remote channel number is added with the number of
* the digital inputs available on the mainboard.
*/
for (channelcnt = 0; channelcnt < NUMBER_OF_DI_EB; channelcnt++)
{
if (remoteDioRead(remoteDeviceNumber, (channelcnt + NUMBER_OF_DI_MB)) == FALSE)
@@ -431,8 +482,9 @@ BOOLEAN remoteDigitalInputTest_EB (void)
Low_Test = FALSE;
}
vTaskDelay (200);
/* Set local digital output to HIGH stat */
dioWrite(thisDeviceNumber, channelcnt, TRUE);
vTaskDelay(200); /* Wait for command is finished */
if (remoteDioRead(remoteDeviceNumber, (channelcnt + NUMBER_OF_DI_MB)) == TRUE)
{
@@ -445,8 +497,9 @@ BOOLEAN remoteDigitalInputTest_EB (void)
High_Test = FALSE;
}
/* Read all remote digital inputs */
remoteDioReadAll(remoteDeviceNumber, digital_eb);
vTaskDelay (200);
vTaskDelay (200); /* Wait for command is finished */
for (loopcnt = 0; loopcnt < NUMBER_OF_DI_EB; loopcnt++)
{
@@ -474,7 +527,7 @@ BOOLEAN remoteDigitalInputTest_EB (void)
/* Message out Test Results */
sendString (SerOutPort, TRUE, testMessage,
"\tLinetest for Digital Input ", ItoDStr(channelcnt), ": ");
"\tLinetest for Digital Input (EB) ", ItoDStr(channelcnt), ": ");
sendString (SerOutPort, FALSE, testMessage,
" ", Dummy, BoolRestoStr (Low_Test));
sendString (SerOutPort, FALSE, testMessage,
@@ -483,6 +536,9 @@ BOOLEAN remoteDigitalInputTest_EB (void)
" ", Dummy, BoolRestoStr (High_Test));
vTaskDelay (50);
/* If one of the individual tests fails, calculate a negative
* over-all test result
*/
if ((Low_Test == FALSE) || (High_Test == FALSE) || (AllOther_Test == FALSE))
{
returnResult = FALSE;
@@ -491,9 +547,10 @@ BOOLEAN remoteDigitalInputTest_EB (void)
// \MARK NEW PINSETTINGS FOR TESTER (2)
#if (PINSET_TESTER == 2)
/* Necessary due to compiling on alternative boards */
dio_outMuxEn (FALSE); /* Switch dio back to main Board*/
#endif
return (returnResult);
return (returnResult); /* Return test result */
}
@@ -52,10 +52,81 @@
* Function declarations.
* ---------------------------------------------------------------------------
*/
/* ---------------------------------------------------------------------------
* Function: remoteDigitalLinetestMBExecute
*
* Main function to the remote mainboard digital in-/output test
*
* Parameter: void
*
* Return: BOOLEAN - Test result
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalLinetestMBExecute (void);
/* ---------------------------------------------------------------------------
* Function: remoteDigitalLinetestEBExecute
*
* Main function to the remote extensionboard digital in-/output test
*
* Parameter: void
*
* Return: BOOLEAN - Test result
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalLinetestEBExecute (void);
/* ---------------------------------------------------------------------------
* Function: remoteDigitalOutputTest_MB
*
* Function to the remote mainboard digital outputs
*
* Parameter: void
*
* Return: BOOLEAN - Test result
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalOutputTest_MB (void);
/* ---------------------------------------------------------------------------
* Function: remoteDigitalInputTest_MB
*
* Function to the remote mainboard digital inputs
*
* Parameter: void
*
* Return: BOOLEAN - Test result
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalInputTest_MB (void);
/* ---------------------------------------------------------------------------
* Function: remoteDigitalOutputTest_EB
*
* Function to the remote extensionboard digital outputs
*
* Parameter: void
*
* Return: BOOLEAN - Test result
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalOutputTest_EB (void);
/* ---------------------------------------------------------------------------
* Function: remoteDigitalInputTest_EB
*
* Function to the remote extensionboard digital inputs
*
* Parameter: void
*
* Return: BOOLEAN - Test result
* ---------------------------------------------------------------------------
*/
BOOLEAN remoteDigitalInputTest_EB (void);
#endif /*TEST_DIGITAL_H_*/
+4 -2
View File
@@ -390,7 +390,8 @@ BOOLEAN dioRead(UINT8 device, /**< 0 = Self, 1..32 = Remote device */
if (*gpioRegister & inputPins[channel].pinMask)
{
Result = FALSE;
} else
}
else
{
Result = TRUE;
}
@@ -456,7 +457,8 @@ BOOLEAN data)
+ CLR_OFFSET);
*gpioRegister = outputPins[channel].pinMask;
}
} else
}
else
{
bpecWriteDioValue(device, channel, data);
}