We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ee8143 commit dec100dCopy full SHA for dec100d
examples/devshare/eapp/devshare.c
@@ -7,17 +7,23 @@
7
8
int main()
9
{
10
- int ret, i;
+ int ret, fd, i;
11
ret = claim_mmio(SECURE_DEVICE,
12
strlen(SECURE_DEVICE));
13
if(ret < 0) {
14
printf("Failed to claim " SECURE_DEVICE "\n");
15
return -1;
16
}
17
18
+ fd = openat(-2, "uart8250", 0, 0);
19
+ if(fd < 0) {
20
+ printf("Failed to get fd for device\n");
21
+ return -1;
22
+ }
23
+
24
for(i = 0; i < 1000; i++) {
- printf("Writing to UART: %i!\n", i);
- fflush(stdout);
25
+ fprintf(fd, "Writing to UART: %i!\n", i);
26
+ fflush(fd);
27
28
29
// todo do something with the device
0 commit comments