Improved test in BDK port.
This commit is contained in:
@@ -41,6 +41,11 @@
|
|||||||
#define BDK_VERSION 4
|
#define BDK_VERSION 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define BINARY_STRING_MAX 3
|
||||||
|
const char * const binary_string[BINARY_STRING_MAX] = {
|
||||||
|
"INACTIVE", "ACTIVE", "RELINQUISH"
|
||||||
|
};
|
||||||
|
|
||||||
/* timer for test task */
|
/* timer for test task */
|
||||||
static struct itimer Test_Timer;
|
static struct itimer Test_Timer;
|
||||||
/* MAC Address of MS/TP */
|
/* MAC Address of MS/TP */
|
||||||
@@ -63,6 +68,21 @@ void test_init(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief send a string of text to the RS-232 port
|
||||||
|
* @param text - C string of text (null terminated)
|
||||||
|
*/
|
||||||
|
static void test_write_string(const char * text)
|
||||||
|
{
|
||||||
|
size_t len = 0;
|
||||||
|
|
||||||
|
if (text) {
|
||||||
|
len = strlen(text);
|
||||||
|
serial_bytes_send((uint8_t *)text, len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Description: Turn on a pin
|
* Description: Turn on a pin
|
||||||
* Returns: none
|
* Returns: none
|
||||||
@@ -161,14 +181,17 @@ void test_task(
|
|||||||
case '0':
|
case '0':
|
||||||
Binary_Output_Present_Value_Set(0, BINARY_INACTIVE, 0);
|
Binary_Output_Present_Value_Set(0, BINARY_INACTIVE, 0);
|
||||||
Binary_Output_Present_Value_Set(1, BINARY_INACTIVE, 0);
|
Binary_Output_Present_Value_Set(1, BINARY_INACTIVE, 0);
|
||||||
|
test_write_string(binary_string[0]);
|
||||||
break;
|
break;
|
||||||
case '1':
|
case '1':
|
||||||
Binary_Output_Present_Value_Set(0, BINARY_ACTIVE, 0);
|
Binary_Output_Present_Value_Set(0, BINARY_ACTIVE, 0);
|
||||||
Binary_Output_Present_Value_Set(1, BINARY_ACTIVE, 0);
|
Binary_Output_Present_Value_Set(1, BINARY_ACTIVE, 0);
|
||||||
|
test_write_string(binary_string[1]);
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2':
|
||||||
Binary_Output_Present_Value_Set(0, BINARY_NULL, 0);
|
Binary_Output_Present_Value_Set(0, BINARY_NULL, 0);
|
||||||
Binary_Output_Present_Value_Set(1, BINARY_NULL, 0);
|
Binary_Output_Present_Value_Set(1, BINARY_NULL, 0);
|
||||||
|
test_write_string(binary_string[2]);
|
||||||
break;
|
break;
|
||||||
case '3':
|
case '3':
|
||||||
rs485_baud_rate_set(38400);
|
rs485_baud_rate_set(38400);
|
||||||
|
|||||||
Reference in New Issue
Block a user