From 8b670498639290af47be460d4135503563249c6d Mon Sep 17 00:00:00 2001 From: pascallanger Date: Sun, 4 Sep 2016 16:46:21 +0200 Subject: [PATCH] Added NRF24L01_ReadPayloadLength --- Multiprotocol/NRF24l01_SPI.ino | 11 +++++++++++ Multiprotocol/_Config.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Multiprotocol/NRF24l01_SPI.ino b/Multiprotocol/NRF24l01_SPI.ino index 579cffa..717d4d4 100644 --- a/Multiprotocol/NRF24l01_SPI.ino +++ b/Multiprotocol/NRF24l01_SPI.ino @@ -76,6 +76,16 @@ uint8_t NRF24L01_ReadReg(uint8_t reg) NRF_CSN_on; } */ + +static uint8_t __attribute__((unused)) NRF24L01_ReadPayloadLength() +{ + NRF_CSN_off; + SPI_Write(R_RX_PL_WID); + uint8_t len = SPI_Read(); + NRF_CSN_on; + return len; +} + static void NRF24L01_ReadPayload(uint8_t * data, uint8_t length) { NRF_CSN_off; @@ -221,6 +231,7 @@ uint8_t NRF24L01_packet_ack() return PKT_PENDING; } + /////////////// // XN297 emulation layer uint8_t xn297_scramble_enabled=XN297_SCRAMBLED; //enabled by default diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index cb5a61b..66ebe92 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -148,7 +148,7 @@ const PPM_Parameters PPM_prot[15]= { // Dial Protocol Sub protocol RX_Num Power Auto Bind Option /* 1 */ {MODE_FLYSKY, Flysky , 0 , P_HIGH , NO_AUTOBIND , 0 }, /* 2 */ {MODE_HUBSAN, 0 , 0 , P_HIGH , NO_AUTOBIND , 0 }, -/* 3 */ {MODE_FRSKYD , 0 , 0 , P_HIGH , NO_AUTOBIND , 40 }, // option=fine freq tuning +/* 3 */ {MODE_FRSKYD, 0 , 0 , P_HIGH , NO_AUTOBIND , 40 }, // option=fine freq tuning /* 4 */ {MODE_HISKY , Hisky , 0 , P_HIGH , NO_AUTOBIND , 0 }, /* 5 */ {MODE_V2X2 , 0 , 0 , P_HIGH , NO_AUTOBIND , 0 }, /* 6 */ {MODE_DSM , DSM2 , 0 , P_HIGH , NO_AUTOBIND , 2 }, // option=2=6 channels @ 22ms