Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

matthewoots
Copy link

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 and pose estimation related data
cpx

…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)
Copy link
Member

@ataffanel ataffanel left a 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,
Copy link
Member

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
Copy link
Member

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);
Copy link
Member

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.

@ataffanel ataffanel requested review from ataffanel and removed request for evoggy and hmllr March 7, 2023 09:16
@knmcguire
Copy link
Member

@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.

@matthewoots
Copy link
Author

@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!

@matthewoots
Copy link
Author

I'll close this first and touch back on this when I have the time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants