Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Arpist
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
Avionics
Autonomous Rocket Pointer
Arpist
Commits
5b49688e
Commit
5b49688e
authored
1 year ago
by
Federico Lolli
Browse files
Options
Downloads
Patches
Plain Diff
Added receiver entrypoint
parent
eb1ad183
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
on-device/src/entrypoints/arpist_device_receiver.cpp
+8
-28
8 additions, 28 deletions
on-device/src/entrypoints/arpist_device_receiver.cpp
on-device/src/entrypoints/arpist_device_sender.cpp
+2
-0
2 additions, 0 deletions
on-device/src/entrypoints/arpist_device_sender.cpp
with
10 additions
and
28 deletions
on-device/src/entrypoints/arpist_device_receiver.cpp
+
8
−
28
View file @
5b49688e
...
...
@@ -30,42 +30,22 @@ using namespace miosix;
using
namespace
Boardcore
;
using
namespace
Arpist
;
// === CONSTANTS ===
/** @brief End of transmission character */
constexpr
uint8_t
ACK
=
0x06
;
using
MavDriver
=
MavlinkDriver
<
20
,
10
>
;
// === DEFINITIONS ===
void
onReceive
(
MavDriver
*
channel
,
mavlink_message_t
msg
);
void
onReceive
(
mavlink_message_t
msg
);
// === MAIN ===
int
main
()
{
mavlink_message_t
msg
;
mavlink_payload_flight_tm_t
payload
;
MavDriver
*
mavlink
;
// init radio
if
(
Radio
::
init
())
{
printf
(
"Radio init success
\n
"
);
}
else
int
main
()
{
printf
(
"Radio init failed
\n
"
);
return
-
1
;
}
// init mavlink
mavlink
=
new
MavDriver
(
sx1278
,
onReceive
,
256
);
if
(
mavlink
->
start
())
// start radio
if
(
Radio
::
getInstance
().
start
(
onReceive
))
{
printf
(
"
Mavlink ini
t success
\n
"
);
printf
(
"
Radio star
t success
\n
"
);
}
else
{
printf
(
"
Mavlink ini
t failed
\n
"
);
printf
(
"
Radio star
t failed
\n
"
);
return
-
1
;
}
...
...
@@ -76,7 +56,7 @@ int main()
return
0
;
}
void
onReceive
(
MavDriver
*
channel
,
mavlink_message_t
msg
)
void
onReceive
(
mavlink_message_t
msg
)
{
mavlink_payload_flight_tm_t
payload
;
...
...
This diff is collapsed.
Click to expand it.
on-device/src/entrypoints/arpist_device_sender.cpp
+
2
−
0
View file @
5b49688e
...
...
@@ -31,10 +31,12 @@ using namespace Boardcore;
using
namespace
Arpist
;
// === CONSTANTS ===
/** @brief End of transmission character */
constexpr
uint8_t
ACK
=
0x06
;
// === MAIN ===
int
main
()
{
mavlink_message_t
msg
;
...
...
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