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
af8146ef
Commit
af8146ef
authored
Jul 31, 2012
by
Alejandro Mery
Browse files
pio: clean offset pattern in pio_get() and pio_set()
parent
22e82981
Changes
1
Hide whitespace changes
Inline
Side-by-side
pio.c
View file @
af8146ef
...
...
@@ -77,10 +77,10 @@ static int pio_get(const char *buf, uint32_t port, uint32_t port_num, struct pio
uint32_t
offset_func
,
offset_pull
;
port_num_func
=
port_num
>>
3
;
offset_func
=
((
port_num
-
(
port_num_func
<<
3
)
)
<<
2
);
offset_func
=
((
port_num
&
0x07
)
<<
2
);
port_num_pull
=
port_num
>>
4
;
offset_pull
=
((
port_num
-
(
port_num_pull
<<
4
)
)
<<
1
);
offset_pull
=
((
port_num
&
0x0f
)
<<
1
);
/* func */
val
=
LE32TOH
(
PIO_REG_CFG
(
buf
,
port
,
port_num_func
));
...
...
@@ -111,10 +111,10 @@ static int pio_set(char *buf, uint32_t port, uint32_t port_num, struct pio_statu
uint32_t
offset_func
,
offset_pull
;
port_num_func
=
port_num
>>
3
;
offset_func
=
((
port_num
-
(
port_num_func
<<
3
)
)
<<
2
);
offset_func
=
((
port_num
&
0x07
)
<<
2
);
port_num_pull
=
port_num
>>
4
;
offset_pull
=
((
port_num
-
(
port_num_pull
<<
4
)
)
<<
1
);
offset_pull
=
((
port_num
&
0x0f
)
<<
1
);
/* func */
if
(
pio
->
mul_sel
>=
0
)
{
...
...
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