-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CPX] custom data types from gap8 to stm32 #1245
Conversation
…s serialized to cpx and sent from gap8 to stm32, this is the receiving end after routing to the stm32 please run this with (aideck-gap8-examples/examples/other/send_data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is great to have a documented easy-way for app to communicate between the Gap8 and the STM32!
However, most of this code is application specific, so it should live in a Crazyflie app in the example\
sub-folder of the firmware. The only thing that looks like it should be in the firmware main code (in the src\
folder) is the packet routing in cpx\
, the rest should be moved to an example app.
|
||
#if GAP8_ENABLED | ||
// https://stackoverflow.com/a/6002598 | ||
static void reserve_space(uint8_t *data, size_t bytes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function does nothing, it should likely be removed or implemented.
uint16_t y; // uint16 (2 bytes) | ||
} __attribute__((packed)) Pixel; | ||
|
||
typedef struct _TagPacket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too application-specific to be in src/
it should likely be in an example app somewhere in examples/
.
@@ -126,8 +126,14 @@ static void cpx(void* _param) { | |||
} | |||
} | |||
break; | |||
case CPX_F_APP: | |||
{ | |||
messageReceive(cpxRx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should likely be an API to register a callback for app messages or to receive packet from it. A similar things is done in CRTP with the appchannel. I feel like a similar API could be used there since it is a very similar concept.
@matthewoots could you address these changes? If we wait any longer then perhaps it no longer can be merged and we would like to prevent that. |
Sorry I wasn't with the hardware to do any testing recently, Will try to get it up by this week, thank you! |
I'll close this first and touch back on this when I have the time |
This PR addresses bitcraze/aideck-gap8-examples#116. A look at it is as shown below, using an example of
sending apriltag detection of corners
andpose estimation
related data