aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-05-08 17:09:20 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-05-08 17:09:20 +0000
commitd0a2e55ed0cf97be924ebbdae2497fd77bfac5b6 (patch)
treea31ebbd42904206131ff4eb661b4341558ca8925 /test
parentba6519a2eaf35bc6d39188e10b6ea12ef553009d (diff)
downloadChibiOS-d0a2e55ed0cf97be924ebbdae2497fd77bfac5b6.tar.gz
ChibiOS-d0a2e55ed0cf97be924ebbdae2497fd77bfac5b6.tar.bz2
ChibiOS-d0a2e55ed0cf97be924ebbdae2497fd77bfac5b6.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4175 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r--test/test.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/test/test.c b/test/test.c
index 55cfdf445..09596e592 100644
--- a/test/test.c
+++ b/test/test.c
@@ -85,7 +85,12 @@ void * ROMCONST wa[5] = {test.wa.T0, test.wa.T1, test.wa.T2,
/*
* Console output.
*/
-static BaseChannel *chp;
+static BaseSequentialStream *chp;
+
+static void _putc(BaseSequentialStream *chp, char c) {
+
+ chSequentialStreamWrite(chp, (const uint8_t *)&c, 1);
+}
/**
* @brief Prints a decimal unsigned number.
@@ -96,13 +101,13 @@ void test_printn(uint32_t n) {
char buf[16], *p;
if (!n)
- chIOPut(chp, '0');
+ _putc(chp, '0');
else {
p = buf;
while (n)
*p++ = (n % 10) + '0', n /= 10;
while (p > buf)
- chIOPut(chp, *--p);
+ _putc(chp, *--p);
}
}
@@ -114,7 +119,7 @@ void test_printn(uint32_t n) {
void test_print(const char *msgp) {
while (*msgp)
- chIOPut(chp, *msgp++);
+ _putc(chp, *msgp++);
}
/**
@@ -125,8 +130,7 @@ void test_print(const char *msgp) {
void test_println(const char *msgp) {
test_print(msgp);
- chIOPut(chp, '\r');
- chIOPut(chp, '\n');
+ chSequentialStreamWrite(chp, (const uint8_t *)"\r\n", 1);
}
/*
@@ -141,7 +145,7 @@ static void print_tokens(void) {
char *cp = tokens_buffer;
while (cp < tokp)
- chIOPut(chp, *cp++);
+ _putc(chp, *cp++);
}
/**
@@ -306,9 +310,8 @@ static void print_line(void) {
unsigned i;
for (i = 0; i < 76; i++)
- chIOPut(chp, '-');
- chIOPut(chp, '\r');
- chIOPut(chp, '\n');
+ _putc(chp, '-');
+ chSequentialStreamWrite(chp, (const uint8_t *)"\r\n", 1);
}
/**