File tree Expand file tree Collapse file tree 5 files changed +18
-8
lines changed Expand file tree Collapse file tree 5 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 1
- #include "fcntl.h"
1
+ #include <fcntl.h>
2
+ #include <unistd.h>
2
3
3
- void main (void ) {
4
+ int main (void ) {
4
5
int led [4 ];
5
6
int i ;
6
7
@@ -22,4 +23,5 @@ void main(void) {
22
23
for (i = 0 ; i < 4 ; i ++ ) {
23
24
close (led [i ]);
24
25
}
26
+ return 0 ;
25
27
}
Original file line number Diff line number Diff line change 1
- #include "fcntl.h"
1
+ #include <fcntl.h>
2
+ #include <stdio.h>
3
+ #include <stdlib.h>
4
+ #include <unistd.h>
2
5
3
6
int _Getch (void ) {
4
7
int ch ;
@@ -8,7 +11,7 @@ int _Getch(void) {
8
11
return ch ;
9
12
}
10
13
11
- void main (void ) {
14
+ int main (void ) {
12
15
int buzzer = open ("/dev/rtbuzzer0" , O_WRONLY );
13
16
int c = 1 ;
14
17
@@ -63,4 +66,5 @@ void main(void) {
63
66
}
64
67
}
65
68
close (buzzer );
69
+ return 0 ;
66
70
}
Original file line number Diff line number Diff line change 1
- #include "fcntl.h"
1
+ #include <fcntl.h>
2
+ #include <unistd.h>
2
3
3
4
char get_SW0 (void ) {
4
5
char buf [2 ];
@@ -27,7 +28,7 @@ char get_SW2(void) {
27
28
return buf [0 ];
28
29
}
29
30
30
- void main (void ) {
31
+ int main (void ) {
31
32
int state0 , state1 , state2 ;
32
33
int LED0 , LED1 , LED2 , LED3 ;
33
34
@@ -78,4 +79,5 @@ void main(void) {
78
79
}
79
80
}
80
81
}
82
+ return 0 ;
81
83
}
Original file line number Diff line number Diff line change 2
2
#include <stdio.h>
3
3
#include <unistd.h>
4
4
5
- void main (void ) {
5
+ int main (void ) {
6
6
int motoren = open ("/dev/rtmotoren0" , O_WRONLY );
7
7
int motor_l = open ("/dev/rtmotor_raw_l0" , O_WRONLY );
8
8
int motor_r = open ("/dev/rtmotor_raw_r0" , O_WRONLY );
@@ -44,4 +44,5 @@ void main(void) {
44
44
close (motor_l );
45
45
close (motor_r );
46
46
close (motor );
47
+ return 0 ;
47
48
}
Original file line number Diff line number Diff line change 2
2
#include <stdio.h>
3
3
#include <unistd.h>
4
4
5
- void main (void ) {
5
+ int main (void ) {
6
6
int buff_size = 256 ;
7
7
FILE * fp ;
8
8
@@ -16,4 +16,5 @@ void main(void) {
16
16
fclose (fp );
17
17
usleep (500 * 1000 );
18
18
}
19
+ return 0 ;
19
20
}
You can’t perform that action at this time.
0 commit comments