Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Killer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vytor Calixto
Killer
Commits
2a1c0925
Commit
2a1c0925
authored
10 years ago
by
Israel Barreto Sant'Anna
Browse files
Options
Downloads
Patches
Plain Diff
Put sign on converted hexadecimals
Signed-off-by:
Israel B. Sant'Anna
<
ibsa14@inf.ufpr.br
>
parent
f75149aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cMIPS/tests/uart.c
+4
-5
4 additions, 5 deletions
cMIPS/tests/uart.c
with
4 additions
and
5 deletions
cMIPS/tests/uart.c
+
4
−
5
View file @
2a1c0925
...
...
@@ -92,6 +92,8 @@ int main(){
}
c
=
getc
();
}
//If it's a negative hex make it a negative integer as well
n
=
0x8000
&
n
?
(
int
)(
0x7FFF
&
n
)
-
0x8000
:
n
;
print
(
n
);
//while(!Putc(c)); // Wait till there's space on queue
}
...
...
@@ -114,15 +116,12 @@ void initUd(){
char
getc
(){
char
c
;
if
(
Ud
.
nrx
>
0
){
// print(1);
// print(Ud.nrx);
disableInterr
();
c
=
Ud
.
rx_q
[
Ud
.
rx_hd
];
Ud
.
rx_hd
=
(
Ud
.
rx_hd
+
1
)
%
16
;
disableInterr
();
Ud
.
nrx
--
;
enableInterr
();
}
else
{
//print(2);
c
=
EOF
;
}
return
c
;
...
...
@@ -136,9 +135,9 @@ int Putc(char c){
}
if
(
Ud
.
ntx
>
0
){
disableInterr
();
Ud
.
tx_q
[
Ud
.
tx_tl
]
=
c
;
Ud
.
tx_tl
=
(
Ud
.
tx_tl
+
1
)
%
16
;
disableInterr
();
Ud
.
ntx
--
;
enableInterr
();
sent
=
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment