diadummy Testing serial device
This commit is contained in:
21
user/diagdummy/serial.c
Normal file
21
user/diagdummy/serial.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ulib.h>
|
||||
|
||||
void diagdummy_serialprint(void) {
|
||||
char *str = "Hello world\n";
|
||||
|
||||
if (argslen() >= 2) {
|
||||
str = args()[1];
|
||||
}
|
||||
|
||||
Dev_t serialdev;
|
||||
dev_gethandle(&serialdev, "serialdev");
|
||||
|
||||
char *s = str;
|
||||
while (*s) {
|
||||
while(!dev_cmd(&serialdev, DEV_SERIALDEV_SENDREADY, NULL, 0));
|
||||
dev_cmd(&serialdev, DEV_SERIALDEV_SENDB, s, 1);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user