Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Nicolò Caruso
Skyward Boardcore
Commits
6e428319
Commit
6e428319
authored
3 years ago
by
Davide Mor
Browse files
Options
Downloads
Patches
Plain Diff
[sx1278] Pushed temporary serial fix
parent
fb14f9df
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tests/drivers/sx1278/test-sx1278-serial.cpp
+8
-9
8 additions, 9 deletions
src/tests/drivers/sx1278/test-sx1278-serial.cpp
with
8 additions
and
9 deletions
src/tests/drivers/sx1278/test-sx1278-serial.cpp
+
8
−
9
View file @
6e428319
...
@@ -77,15 +77,13 @@ void initBoard()
...
@@ -77,15 +77,13 @@ void initBoard()
void
recvLoop
()
void
recvLoop
()
{
{
uint8_t
msg
[
256
];
uint8_t
msg
[
256
];
auto
console
=
miosix
::
DefaultConsole
::
instance
().
get
();
while
(
1
)
while
(
1
)
{
{
int
len
=
sx1278
->
receive
(
msg
,
sizeof
(
msg
));
int
len
=
sx1278
->
receive
(
msg
,
sizeof
(
msg
));
if
(
len
>
0
)
if
(
len
>
0
)
{
{
console
->
writeBlock
(
msg
,
len
,
0
);
auto
serial
=
miosix
::
DefaultConsole
::
instance
().
get
(
);
// TODO: Flushing?
serial
->
writeBlock
(
msg
,
len
,
0
);
}
}
}
}
}
}
...
@@ -93,11 +91,10 @@ void recvLoop()
...
@@ -93,11 +91,10 @@ void recvLoop()
void
sendLoop
()
void
sendLoop
()
{
{
uint8_t
msg
[
256
];
uint8_t
msg
[
256
];
auto
console
=
miosix
::
DefaultConsole
::
instance
().
get
();
while
(
1
)
while
(
1
)
{
{
int
len
=
console
->
readBlock
(
msg
,
sizeof
(
msg
),
0
);
auto
serial
=
miosix
::
DefaultConsole
::
instance
().
get
();
int
len
=
serial
->
readBlock
(
msg
,
sizeof
(
msg
),
0
);
if
(
len
>
0
)
if
(
len
>
0
)
{
{
sx1278
->
send
(
msg
,
len
);
sx1278
->
send
(
msg
,
len
);
...
@@ -127,8 +124,10 @@ int main()
...
@@ -127,8 +124,10 @@ int main()
printf
(
"
\n
[sx1278] Initialization complete!
\n
"
);
printf
(
"
\n
[sx1278] Initialization complete!
\n
"
);
while
(
1
)
// God please forgive me
miosix
::
Thread
::
wait
();
// FIXME(davide.mor): ABSOLUTELY fix this
miosix
::
Thread
::
sleep
(
10000
);
miosix
::
reboot
();
return
0
;
return
0
;
}
}
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