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

Add FrSky SPI RX support (with MIDELICF3 target as example) #3682

Closed
wants to merge 1 commit into from

Conversation

mikeller
Copy link
Member

For discussion about inclusion in 3.2.

This adds support for CC2500 based FrSky SPI RX. The rx code still needs more work to be brought in line with Betaflight coding standards, but the shared code has been cleaned up, and conflicts resolved.

The MIDELICF3 target definition is included as an example of how to add a FrSky SPI RX to a board, and to add build coverage for the FrSky SPI RX code. It will be replaced by the FREUNDF3 target (which will be commercially available) when this is finalised.

@@ -22,10 +22,13 @@ typedef enum {
FRSKY_VFAS_PRECISION_HIGH
} frskyVFasPrecision_e;

typedef void frSkyTelemetryInitFrameFunc(void);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although not all code complies, standard suffix for function pointer is FnPtr so this should be frSkyTelemetryInitFrameFnPtr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't a pointer, just function prototype. Which is IMO good idea (* in variable definition marks pointer)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I wasn't thinking clearly there. Revised comment: standard suffix for function typedef is Fn, so this should be frSkyTelemetryInitFrameFn.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, will fix. Will have to fix pwm_output.h as well, as this is what I used as a template.

#if defined FRSKY_TELEMETRY
static void compute_RSSIdbm(uint8_t *packet){
if(packet[ccLen-2] >=128){
RSSI_dBm =((((uint16_t)packet[ccLen-2])*18)>>5)- 82;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you convert 8-space indenting to 4-space?

@martinbudden
Copy link
Contributor

Looks good. Although I don't think it needs to be fully compliant with coding standards before inclusion, it would be good to get some of the gross non-compliance sorted, in particular 8-space indenting and K&R braces style.

@slawek89
Copy link

slawek89 commented Jul 31, 2017

Is it plan to implement also X series telemetry?

@mikeller
Copy link
Member Author

@martinbudden: I can do that. I was trying out different IDEs before I left for the holidays for the quality of the auto-formatting that they offer for C. Is there one that you can recommend for this?

You wouldn't happen to have the hardware and time to test that serial FrSky hub telemetry still works with this PR?

@slawek89: @midelic is working on this I believe.

@mikeller mikeller added this to the Betaflight v3.2 milestone Jul 31, 2017
added more files/target mods

typo error/cosmetics

mod telemetry files

cosmetics

update to full telemetry

Add images

telemetry select default

info readme

activate full telemetry

added FrskyRX main files

added info

cosmetics

fix telemetry buffer range

fix range

fix telemetry buffer

typo fix

added MIDELICF3V2 target

cosmetics

a2 telemetry fix

change status LED pin for production board

telemetry fix

telemetry fix

forgot  to add bind via cli

Fixes to make MIDELICF3 build.

Switched FrSky bind information to PG.

Added 'autoBind' as a config setting.

Some fixups.

Fixed binding (Langkawi edit).

Made FrSky binding non-blocking.

Fixups before PR.

Fixed telemetry integration.
@mikeller
Copy link
Member Author

@martinbudden: Fixed the formatting. VS Code does a good job, after some wrangling with clang-format settings.

@mikeller
Copy link
Member Author

mikeller commented Aug 1, 2017

Closed. Will submit new PR for 3.3.

@mikeller mikeller closed this Aug 1, 2017
@mikeller mikeller deleted the added_frsky_spi_rx branch August 1, 2017 01:43
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.

None yet

5 participants