Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cMIPS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Strozzi
cMIPS
Commits
28d2aca1
Commit
28d2aca1
authored
9 years ago
by
Jedian
Browse files
Options
Downloads
Patches
Plain Diff
dafu
Signed-off-by:
Jedian
<
jmb15@c3sl.ufpr.br
>
parent
b365a502
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cMIPS/serial.inp
+4
-5
4 additions, 5 deletions
cMIPS/serial.inp
cMIPS/tests/jedidafu.c
+22
-18
22 additions, 18 deletions
cMIPS/tests/jedidafu.c
with
26 additions
and
23 deletions
cMIPS/serial.inp
+
4
−
5
View file @
28d2aca1
1
2
3
4
5
1a
2a
2a
2a
2a
This diff is collapsed.
Click to expand it.
cMIPS/tests/jedidafu.c
+
22
−
18
View file @
28d2aca1
...
...
@@ -164,7 +164,7 @@ int main(void) { // receive a string through the UART serial interface
int
hdona
=
0
;
int
tlona
=
0
;
int
filonx
=
0
;
int
valfib
,
qt
;
int
valfib
,
qt
,
rxz
;
char
p
[
15
];
Tcontrol
ctrl
;
...
...
@@ -195,36 +195,40 @@ int main(void) { // receive a string through the UART serial interface
while
((
c
=
Getc
())
!=
-
1
){
filona
[
tlona
]
=
c
;
tlona
++
;
if
(
c
==
'\n'
)
tlona
%=
145
;
if
(
c
==
'\n'
){
filonx
++
;
/*if(c=='\n'){
print(hex2int((filona+hdona)));
hdona = tlona;
}*/
filona
[
tlona
]
=
0
;
}
}
while
(
filonx
>
0
){
qt
=
Strlen
(
filona
+
hdona
);
valfib
=
hex2int
((
filona
+
hdona
));
print
(
valfib
);
valfib
=
buf
[
valfib
];
hdona
+=
qt
+
1
;
hdona
%=
145
;
print
(
valfib
);
hdona
+=
qt
-
1
;
qt
=
int2hex
(
p
,
valfib
);
j
=
-
1
;
do
{
j
++
;
while
(
!
Putc
(
p
[
j
]));
while
(((
rxz
=
proberx
())
<
16
)
&&
!
Putc
(
p
[
j
]));
if
(
rxz
>=
2
){
while
((
c
=
Getc
())
!=
-
1
){
filona
[
tlona
]
=
c
;
tlona
++
;
tlona
%=
145
;
if
(
c
==
'\n'
){
filonx
++
;
filona
[
tlona
]
=
0
;
}
}
j
--
;
}
}
while
(
p
[
j
]
!=
0
);
filonx
--
;
}
/*for(j=0; j<145; j++) //isso aqui buga porque ele invalida os char quando hex2inteia
if(filona[j]==0 || filona[j]==10)
to_stdout('_');
else
to_stdout(filona[j]);
to_stdout('\0');
hdona = tlona;
print(hex2int((filona+hdona)));*/
}
while
(
i
<
5
);
...
...
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