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

Telemetry functions #931

Merged
merged 22 commits into from
Nov 10, 2014
Merged

Telemetry functions #931

merged 22 commits into from
Nov 10, 2014

Conversation

gautierhattenberger
Copy link
Member

Replacing the old macros with functions. This is done by introducing a generic transport structure and a generic device structure.
It is only a small step on purpose, changing everything at once usually fails.

There is no functional changes, except that the transport and device for periodic function is passed as an argument, which will allow to create a telemetry task for logging in parallel of the normal telemetry (soon).

We now have:

  • 4 transports (pprz, pprzlog, xbee, ivy)
  • 5 devices (uart, usb_uart, sdio(chibios), udp, w5100)

This was tested on:

  • lpc (pprz)
  • stm32f4 (pprz, pprzlog, xbee)
  • sim/nps (ivy)

@flixr
Copy link
Member

flixr commented Nov 6, 2014

Nice!
Didn't have a close look, nor properly test it yet though...

But regarding the style and naming I noticed some things:

  • maybe device is a bit to generic and something like DownlinkDevice or LinkDevice would make more sense
  • I would advocate to capitalize the first letter of struct declarations names (or CamelCase) just like is comon for classes (e.g. struct Device device)
    • Maybe that is something for another issue, but we should start a proper naming convention there and it would make sense to name the new ones accordingly now..

@gautierhattenberger
Copy link
Member Author

Most of the peripherals structure are using the CamelCase, but mcu_periph and datalink stuff are more C style, that's why I did it like this. I don't mind changing if we set the coding style to CamelCase (although it doesn't seems to be recommended for C codes in the coding style I found).

For the name, I prefer LinkDevice since it not meant to be only downlink but also uplink, logging, inter-mcu/cpu com,...

So:
link_device or LinkDevice ?
transport_tx or TransportTX ?

@flixr
Copy link
Member

flixr commented Nov 7, 2014

Yeah, not sure what style makes more sense and we already have it mixed... guess I'm kind of used to CamelCase structs and classes from C++ and under_score variables/instances.

link_device is fine with me.

Another style thing: you aligned the pointer with the name (also what I'm used to and seems to be more common). The fix_code_style.sh script currently aligns with type, but I would change that to align with name again as when adding it first, see #617.

@flixr
Copy link
Member

flixr commented Nov 8, 2014

Nice thing is that it also decreases code size (at least in most common cases with default telemetry set).
E.g. for LisaM2 quadrotor firmware: .text section goes down from 149KB to 137KB, .data is the same with 16KB

@gautierhattenberger
Copy link
Member Author

do we have a strategy to merge this ?
more soft/hardware test needed ?

@flixr
Copy link
Member

flixr commented Nov 9, 2014

Looks good to merge to me, but I didn't have a chance to test on real hardware yet...

@gautierhattenberger
Copy link
Member Author

I just could test it on ardrone and lisa/s yet, would be nice if someone can do it. Otherwise I'll do that at the end of the week. If it works, I'll merge it then if you're okay.

@flixr
Copy link
Member

flixr commented Nov 10, 2014

Works fine on my LisaMX as well, merging.

flixr added a commit that referenced this pull request Nov 10, 2014
Datalink/Telemetry functions

Replacing the old macros with functions. This is done by introducing a generic transport structure and a generic link_device structure.
It is only a small step on purpose, changing everything at once usually fails.

There is no functional changes, except that the transport and link_device for periodic function is passed as an argument, which will allow to create a telemetry task for logging in parallel of the normal telemetry (soon).

We now have:
- 4 transports (pprz, pprzlog, xbee, ivy)
- 5 devices (uart, usb_uart, sdio(chibios), udp, w5100)
@flixr flixr merged commit 31b6600 into master Nov 10, 2014
@flixr flixr deleted the datalink_functions branch November 10, 2014 10:52
@flixr flixr added this to the v5.4 milestone Nov 10, 2014
{
dev->transmit(dev->periph, trans->ck_a_tx);
dev->transmit(dev->periph, trans->ck_b_tx);
dev->send_message(dev);
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 incorrect should be dev->periph. This fails in a a lot of the datalinks ;)

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

Successfully merging this pull request may close these issues.

3 participants