Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
OpenSource
Baitboat
Commits
c3ae1253
Commit
c3ae1253
authored
12 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
MAVLink: moved CRC table into program
this saves 256 bytes of memory
parent
0c191256
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/GCS_MAVLink/GCS_MAVLink.cpp
+8
-0
8 additions, 0 deletions
libraries/GCS_MAVLink/GCS_MAVLink.cpp
libraries/GCS_MAVLink/GCS_MAVLink.h
+12
-0
12 additions, 0 deletions
libraries/GCS_MAVLink/GCS_MAVLink.h
with
20 additions
and
0 deletions
libraries/GCS_MAVLink/GCS_MAVLink.cpp
+
8
−
0
View file @
c3ae1253
...
@@ -51,3 +51,11 @@ uint8_t mav_var_type(enum ap_var_type t)
...
@@ -51,3 +51,11 @@ uint8_t mav_var_type(enum ap_var_type t)
}
}
static
const
uint8_t
mavlink_message_crc_progmem
[
256
]
PROGMEM
=
MAVLINK_MESSAGE_CRCS
;
// return CRC byte for a mavlink message ID
uint8_t
mavlink_get_message_crc
(
uint8_t
msgid
)
{
return
pgm_read_byte
(
&
mavlink_message_crc_progmem
[
msgid
]);
}
This diff is collapsed.
Click to expand it.
libraries/GCS_MAVLink/GCS_MAVLink.h
+
12
−
0
View file @
c3ae1253
...
@@ -12,6 +12,15 @@
...
@@ -12,6 +12,15 @@
// to select MAVLink 1.0 in the arduino GUI build
// to select MAVLink 1.0 in the arduino GUI build
#define MAVLINK_SEPARATE_HELPERS
#define MAVLINK_SEPARATE_HELPERS
// define our own MAVLINK_MESSAGE_CRC() macro to allow it to be put
// into progmem
#define MAVLINK_MESSAGE_CRC(msgid) mavlink_get_message_crc(msgid)
#if defined( __AVR_ATmega1280__ ) || defined( __AVR_ATmega2560__ )
#include
<util/crc16.h>
#define HAVE_CRC_ACCUMULATE
#endif
#include
"include/mavlink/v1.0/ardupilotmega/version.h"
#include
"include/mavlink/v1.0/ardupilotmega/version.h"
// this allows us to make mavlink_message_t much smaller. It means we
// this allows us to make mavlink_message_t much smaller. It means we
...
@@ -124,4 +133,7 @@ uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid);
...
@@ -124,4 +133,7 @@ uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid);
// return a MAVLink variable type given a AP_Param type
// return a MAVLink variable type given a AP_Param type
uint8_t
mav_var_type
(
enum
ap_var_type
t
);
uint8_t
mav_var_type
(
enum
ap_var_type
t
);
// return CRC byte for a mavlink message ID
uint8_t
mavlink_get_message_crc
(
uint8_t
msgid
);
#endif // GCS_MAVLink_h
#endif // GCS_MAVLink_h
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