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
dd35e7cb
Commit
dd35e7cb
authored
9 years ago
by
Jedian Marcos Brambilla
Browse files
Options
Downloads
Patches
Plain Diff
proberx correto, falta fazer funcionar de verdade so
Signed-off-by:
Jedian Marcos Brambilla
<
jmb15@inf.ufpr.br
>
parent
023d33a1
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/tests/handlerUART.s
+0
-2
0 additions, 2 deletions
cMIPS/tests/handlerUART.s
cMIPS/tests/jedidafu.c
+15
-7
15 additions, 7 deletions
cMIPS/tests/jedidafu.c
with
15 additions
and
9 deletions
cMIPS/tests/handlerUART.s
+
0
−
2
View file @
dd35e7cb
...
@@ -67,8 +67,6 @@ UARTrxinter:
...
@@ -67,8 +67,6 @@ UARTrxinter:
sw
$a1
,
2
*
4
(
$k0
)
#
and
return
from
interrupt
sw
$a1
,
2
*
4
(
$k0
)
#
and
return
from
interrupt
addiu
$a1
,
$zero
,
1
addiu
$a1
,
$zero
,
1
sw
$a1
,
3
*
4
(
$k0
)
#
Signal
new
arrival
sw
$a1
,
3
*
4
(
$k0
)
#
Signal
new
arrival
#
Jedian
:
when
a
new
char
is
on
the
UART
's buffer,
#
i
have
to
enqueue
it
and
update
nrx
.
#
check
if
queue
is
full
,
maybe
increment
#
check
if
queue
is
full
,
maybe
increment
lui
$
5
,
%
hi
(
nrx
)
lui
$
5
,
%
hi
(
nrx
)
...
...
This diff is collapsed.
Click to expand it.
cMIPS/tests/jedidafu.c
+
15
−
7
View file @
dd35e7cb
...
@@ -10,6 +10,8 @@ extern Tproberx proberxs ;
...
@@ -10,6 +10,8 @@ extern Tproberx proberxs ;
volatile
Tserial
*
uart
;
// tell GCC not to optimize away code
volatile
Tserial
*
uart
;
// tell GCC not to optimize away code
int
proberx
()
{
int
proberx
()
{
if
(
proberxs
.
overun
)
return
-
1
;
return
Ud
.
nrx
;
return
Ud
.
nrx
;
}
}
...
@@ -144,15 +146,15 @@ int main(void) { // receive a string through the UART serial interface
...
@@ -144,15 +146,15 @@ int main(void) { // receive a string through the UART serial interface
uart
=
(
void
*
)
IO_UART_ADDR
;
// bottom of UART address range
uart
=
(
void
*
)
IO_UART_ADDR
;
// bottom of UART address range
Ud
.
ntx
=
16
;
// initializing number of empty spaces in tx queue
Ud
.
ntx
=
16
;
// initializing number of empty spaces in tx queue
ioctl
(
ctrl_util
(
1
,
1
,
1
,
1
));
// Speed = 2, intRX = 1, intTX = 1, rts = 1
ioctl
(
ctrl_util
(
2
,
1
,
1
,
1
));
// Speed = 2, intRX = 1, intTX = 1, rts = 1
do
{
do
{
state
++
;
// state is a volatile variable just for optimize blocking
state
++
;
// state is a volatile variable just for optimize blocking
while
(
!
proberx
())
to_stdout
(
'-'
);
// wait until first reception
while
(
!
proberx
())
to_stdout
(
'-'
);
// wait until first reception
if
(
proberx
s
.
overun
){
if
(
proberx
()
==
-
1
){
to_stdout
(
'
e
'
);
to_stdout
(
'
E
'
);
to_stdout
(
'
r
'
);
to_stdout
(
'
R
'
);
to_stdout
(
'
r
'
);
to_stdout
(
'
R
'
);
to_stdout
(
'\0'
);
to_stdout
(
'\0'
);
return
state
;
return
state
;
}
}
...
@@ -177,8 +179,14 @@ int main(void) { // receive a string through the UART serial interface
...
@@ -177,8 +179,14 @@ int main(void) { // receive a string through the UART serial interface
j
=
-
1
;
j
=
-
1
;
do
{
do
{
j
++
;
j
++
;
while
(((
rxz
=
proberx
())
<
10
)
&&
!
(
q
=
Putc
(
p
[
j
])));
while
(((
rxz
=
proberx
())
<
10
&&
(
rxz
>=
0
))
&&
!
(
q
=
Putc
(
p
[
j
])));
if
(
rxz
==
-
1
){
to_stdout
(
'E'
);
to_stdout
(
'R'
);
to_stdout
(
'R'
);
to_stdout
(
'\0'
);
return
state
;
}
while
((
c
=
Getc
())
!=
-
1
){
while
((
c
=
Getc
())
!=
-
1
){
filona
[
tlona
]
=
c
;
filona
[
tlona
]
=
c
;
tlona
++
;
tlona
++
;
...
...
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