Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
5142a242
Commit
5142a242
authored
Aug 08, 2012
by
Alejandro Mery
Browse files
fexc: fix fex compiler to accept port:powerN GPIOs
parent
bcde0fc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
script_fex.c
View file @
5142a242
...
...
@@ -257,15 +257,31 @@ int script_parse_fex(FILE *in, const char *filename, struct script *script)
continue
;
}
perror
(
"malloc"
);
}
else
if
(
memcmp
(
"port:
P
"
,
p
,
6
)
==
0
)
{
}
else
if
(
memcmp
(
"port:"
,
p
,
5
)
==
0
)
{
/* GPIO */
p
+=
6
;
if
(
*
p
<
'A'
||
*
p
>
'Z'
)
p
+=
5
;
if
(
p
[
0
]
==
'P'
&&
(
p
[
1
]
<
'A'
||
p
[
1
]
>
'I'
))
;
else
if
(
*
p
!=
'P'
&&
memcmp
(
p
,
"power"
,
5
)
!=
0
)
;
else
{
char
*
end
;
int
port
=
*
p
++
-
'A'
+
1
;
long
v
=
strtol
(
p
,
&
end
,
10
);
int
port
;
long
v
;
if
(
*
p
==
'P'
)
{
/* port:PXN */
port
=
p
[
1
]
-
'A'
+
1
;
p
+=
2
;
}
else
{
/* port:powerN */
port
=
0xffff
;
p
+=
5
;
}
v
=
strtol
(
p
,
&
end
,
10
);
if
(
end
==
p
)
goto
invalid_char_at_p
;
else
if
(
v
<
0
||
v
>
255
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment