diagdummy srpr2 wait for device lock
This commit is contained in:
@ -6,6 +6,8 @@
|
||||
#define SENDREADY 1
|
||||
#define RECVB 2
|
||||
#define RECVREADY 3
|
||||
#define LOCK 4
|
||||
#define UNLOCK 5
|
||||
|
||||
void diagdummy_srpr(void) {
|
||||
char *str = "Hello world\n";
|
||||
@ -35,9 +37,13 @@ void diagdummy_srpr2(void) {
|
||||
Dev_t serialdev;
|
||||
dev_gethandle(&serialdev, "serialdev");
|
||||
|
||||
while(dev_cmd(&serialdev, LOCK, NULL, 0) != E_OK);
|
||||
|
||||
for (;;) {
|
||||
while (!dev_cmd(&serialdev, SENDREADY, NULL, 0));
|
||||
dev_cmd(&serialdev, SENDB, str, 1);
|
||||
schedsleep(500);
|
||||
}
|
||||
|
||||
dev_cmd(&serialdev, UNLOCK, NULL, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user