git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6695 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
c082a87062
commit
12a2f695cf
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "hal.h"
|
||||
#include "nil.h"
|
||||
#include "ch_test.h"
|
||||
|
||||
/*
|
||||
* Blinker thread #1.
|
||||
|
@ -92,9 +93,14 @@ THD_FUNCTION(Thread3, arg) {
|
|||
palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(7)); /* USART1 TX. */
|
||||
palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(7)); /* USART1 RX. */
|
||||
|
||||
while (true) {
|
||||
/* Welcome message.*/
|
||||
chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14);
|
||||
chThdSleepMilliseconds(2000);
|
||||
|
||||
/* Waiting for button push and activation of the test suite.*/
|
||||
while (true) {
|
||||
if (palReadPad(GPIOA, GPIOA_BUTTON))
|
||||
test_execute((BaseSequentialStream *)&SD1);
|
||||
chThdSleepMilliseconds(500);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +111,7 @@ THD_FUNCTION(Thread3, arg) {
|
|||
THD_TABLE_BEGIN
|
||||
THD_TABLE_ENTRY(waThread1, "blinker1", Thread1, NULL)
|
||||
THD_TABLE_ENTRY(waThread2, "blinker2", Thread2, NULL)
|
||||
THD_TABLE_ENTRY(waThread3, "hello", Thread3, NULL)
|
||||
THD_TABLE_ENTRY(waThread3, "tester", Thread3, NULL)
|
||||
THD_TABLE_END
|
||||
|
||||
/*
|
||||
|
|
|
@ -129,7 +129,7 @@ static void test_000_001_execute(void) {
|
|||
test_set_step(3);
|
||||
{
|
||||
time = chVTGetSystemTimeX();
|
||||
chThdSleepMicroseconds(100);
|
||||
chThdSleepMilliseconds(100);
|
||||
test_assert_time_window(time + MS2ST(100),
|
||||
time + MS2ST(100) + 1,
|
||||
"out of time window");
|
||||
|
|
Loading…
Reference in New Issue