summarylogtreecommitdiffstats
path: root/01-Arch-Support.patch
blob: 87b65250ef3e73fa13091b4dedf57811b3964a59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c
index f1c748f..15b1862 100644
--- a/wiringPi/wiringPi.c
+++ b/wiringPi/wiringPi.c
@@ -2076,98 +2076,7 @@ void piGpioLayoutOops (const char *why)
 
 void piBoardId (int * model)
 {
-	FILE *cpuFd ;
-	char line [40] ;
-	char *c;
-	char revision[40];
-	unsigned int i = 0;
-
-	if ((cpuFd = fopen ("/etc/orangepi-release", "r")) == NULL)
-		if ((cpuFd = fopen ("/etc/armbian-release", "r")) == NULL)
-			piGpioLayoutOops ("Unable to open /etc/orangepi-release or /etc/armbian-release.");
-
-	while (fgets (line, 40, cpuFd) != NULL)
-	if (strncmp (line, "BOARD=", 6) == 0)
-		break ;
-
-	fclose (cpuFd) ;
-
-	if (strncmp (line, "BOARD=", 6) != 0)
-		piGpioLayoutOops ("No \"Revision\" line") ;
-
-	if (wiringPiDebug)
-		printf ("piBoardId: Revision string: %s\n", line) ;
-
-	// Chomp trailing CR/NL
-	for (c = &line [strlen (line) - 1] ; (*c == '\n') || (*c == '\r') ; --c)
-		*c = 0 ;
-
-	// Need to work out if it's using the new or old encoding scheme:
-	// Scan to the first character of the revision number
-	for (c = line ; *c ; ++c)
-    	if (*c == '=')
-      		break ;
-
-	if (*c != '=')
-    	piGpioLayoutOops ("Revision line (no equal)");
-
-	c++;
-	for (i = 0; *c ; ++c)
-		revision[i++] = *c;
-
-	revision[i] = '.';
-
-	if (wiringPiDebug)
-		printf ("piBoardId: Board string: %s\n", revision) ;
-
-	/**/ if (strncmp(revision, "orangepi3.",               10) == 0) { *model = PI_MODEL_3; }
-	else if (strncmp(revision, "orangepi3-lts.",           14) == 0) { *model = PI_MODEL_3; }
-	else if (strncmp(revision, "orangepioneplus.",         16) == 0) { *model = PI_MODEL_LTIE_2; }
-	else if (strncmp(revision, "orangepilite2.", 	       14) == 0) { *model = PI_MODEL_LTIE_2; }
-	else if (strncmp(revision, "orangepizero.",            13) == 0) { *model = PI_MODEL_ZERO; }
-	else if (strncmp(revision, "orangepizerolts.",         16) == 0) { *model = PI_MODEL_ZERO; }
-	else if (strncmp(revision, "orangepizero-lts.",        17) == 0) { *model = PI_MODEL_ZERO; }
-	else if (strncmp(revision, "orangepir1.",              11) == 0) { *model = PI_MODEL_ZERO; }
-	else if (strncmp(revision, "orangepi-r1.",             12) == 0) { *model = PI_MODEL_ZERO; }
-	else if (strncmp(revision, "orangepipc.",              11) == 0) { *model = PI_MODEL_H3; }
-	else if (strncmp(revision, "orangepipcplus.",	       15) == 0) { *model = PI_MODEL_H3; }
-	else if (strncmp(revision, "orangepione.",             12) == 0) { *model = PI_MODEL_H3; }
-	else if (strncmp(revision, "orangepilite.",            13) == 0) { *model = PI_MODEL_H3; }
-	else if (strncmp(revision, "orangepiplus.",            13) == 0) { *model = PI_MODEL_H3; }
-	else if (strncmp(revision, "orangepiplue2e.",	       15) == 0) { *model = PI_MODEL_H3; }
-	else if (strncmp(revision, "orangepizeroplus2h3.",     20) == 0) { *model = PI_MODEL_ZERO_PLUS_2; }
-	else if (strncmp(revision, "orangepizeroplus2-h3.",    21) == 0) { *model = PI_MODEL_ZERO_PLUS_2; }
-	else if (strncmp(revision, "orangepiwin.",             12) == 0) { *model = PI_MODEL_WIN; }
-	else if (strncmp(revision, "orangepiwinplus.",         16) == 0) { *model = PI_MODEL_WIN; }
-	else if (strncmp(revision, "orangepiprime.",	       14) == 0) { *model = PI_MODEL_PRIME; }
-	else if (strncmp(revision, "orangepipc2.",             12) == 0) { *model = PI_MODEL_PC_2; }
-	else if (strncmp(revision, "orangepizeroplus.",        17) == 0) { *model = PI_MODEL_ZERO_PLUS; }
-	else if (strncmp(revision, "orangepizeroplus2h5.",     20) == 0) { *model = PI_MODEL_ZERO_PLUS_2; }
-	else if (strncmp(revision, "orangepizeroplus2-h5.",    21) == 0) { *model = PI_MODEL_ZERO_PLUS_2; }
-	else if (strncmp(revision, "orangepizero2.",           14) == 0) { *model = PI_MODEL_ZERO_2; }
-	else if (strncmp(revision, "orangepizero2w.",          14) == 0) { *model = PI_MODEL_ZERO_2_W; }
-	else if (strncmp(revision, "orangepizero3.",           14) == 0) { *model = PI_MODEL_ZERO_2; }
-	else if (strncmp(revision, "orangepirk3399.",          15) == 0) { *model = PI_MODEL_RK3399; }
-	else if (strncmp(revision, "orangepi-rk3399.",         16) == 0) { *model = PI_MODEL_RK3399; }
-	else if (strncmp(revision, "orangepi800.",             12) == 0) { *model = PI_MODEL_800; }
-	else if (strncmp(revision, "orangepi4.",               10) == 0) { *model = PI_MODEL_4; }
-	else if (strncmp(revision, "orangepi4-lts.",           14) == 0) { *model = PI_MODEL_4_LTS; }
-	else if (strncmp(revision, "orangepir1plus.",          15) == 0) { *model = PI_MODEL_R1_PLUS; }
-	else if (strncmp(revision, "orangepi-r1plus.",         16) == 0) { *model = PI_MODEL_R1_PLUS; }
-	else if (strncmp(revision, "orangepir1plus-lts.",      18) == 0) { *model = PI_MODEL_R1_PLUS; }
-	else if (strncmp(revision, "orangepi-r1plus-lts.",     20) == 0) { *model = PI_MODEL_R1_PLUS; }
-	else if (strncmp(revision, "orangepi5.",               10) == 0) { *model = PI_MODEL_5; }
-	else if (strncmp(revision, "orangepi5b.",              11) == 0) { *model = PI_MODEL_5B; }
-	else if (strncmp(revision, "orangepi5pro.",            13) == 0) { *model = PI_MODEL_5_PRO; }
-	else if (strncmp(revision, "orangepi5max.",            13) == 0) { *model = PI_MODEL_5_MAX; }
-	else if (strncmp(revision, "orangepi5plus.",           14) == 0) { *model = PI_MODEL_5_PLUS; }
-	else if (strncmp(revision, "orangepi900.",             12) == 0) { *model = PI_MODEL_900; }
-	else if (strncmp(revision, "orangepicm4.",             12) == 0) { *model = PI_MODEL_CM4; }
-	else if (strncmp(revision, "orangepi3b.",              11) == 0) { *model = PI_MODEL_3B; }
-	else if (strncmp(revision, "orangepi3plus.",           14) == 0) { *model = PI_MODEL_3_PLUS; }
-
-	if (wiringPiDebug)
-		printf("piBoardId: model = %d\n", *model);
+	*model = PI_MODEL_5_PLUS;
 }
 
 /*