Commit 0a8b1d3d authored by komby's avatar komby

Merge branch 'master' of https://github.com/TMRh20/RF24

parents c4d222ce 7005c479
...@@ -388,11 +388,9 @@ void RF24::print_byte_register(const char* name, uint8_t reg, uint8_t qty) ...@@ -388,11 +388,9 @@ void RF24::print_byte_register(const char* name, uint8_t reg, uint8_t qty)
//char extra_tab = strlen_P(name) < 8 ? '\t' : 0; //char extra_tab = strlen_P(name) < 8 ? '\t' : 0;
//printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab); //printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);
#if defined (RF24_LINUX) #if defined (RF24_LINUX)
char extra_tab = strlen_P(name) < 8 ? '\t' : 0; printf("%s\t =", name);
printf("%s\t%c =", name, extra_tab);
#else #else
char extra_tab = strlen_P(name) < 8 ? '\t' : 0; printf_P(PSTR(PRIPSTR"\t ="),name);
printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);
#endif #endif
while (qty--) while (qty--)
printf_P(PSTR(" 0x%02x"),read_register(reg++)); printf_P(PSTR(" 0x%02x"),read_register(reg++));
...@@ -405,11 +403,9 @@ void RF24::print_address_register(const char* name, uint8_t reg, uint8_t qty) ...@@ -405,11 +403,9 @@ void RF24::print_address_register(const char* name, uint8_t reg, uint8_t qty)
{ {
#if defined (RF24_LINUX) #if defined (RF24_LINUX)
char extra_tab = strlen_P(name) < 8 ? '\t' : 0; printf("%s\t =",name);
printf("%s\t%c =",name,extra_tab);
#else #else
char extra_tab = strlen_P(name) < 8 ? '\t' : 0; printf_P(PSTR(PRIPSTR"\t ="),name);
printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);
#endif #endif
while (qty--) while (qty--)
{ {
...@@ -560,14 +556,14 @@ void RF24::printDetails(void) ...@@ -560,14 +556,14 @@ void RF24::printDetails(void)
print_address_register(PSTR("RX_ADDR_P0-1"),RX_ADDR_P0,2); print_address_register(PSTR("RX_ADDR_P0-1"),RX_ADDR_P0,2);
print_byte_register(PSTR("RX_ADDR_P2-5"),RX_ADDR_P2,4); print_byte_register(PSTR("RX_ADDR_P2-5"),RX_ADDR_P2,4);
print_address_register(PSTR("TX_ADDR"),TX_ADDR); print_address_register(PSTR("TX_ADDR\t"),TX_ADDR);
print_byte_register(PSTR("RX_PW_P0-6"),RX_PW_P0,6); print_byte_register(PSTR("RX_PW_P0-6"),RX_PW_P0,6);
print_byte_register(PSTR("EN_AA"),EN_AA); print_byte_register(PSTR("EN_AA\t"),EN_AA);
print_byte_register(PSTR("EN_RXADDR"),EN_RXADDR); print_byte_register(PSTR("EN_RXADDR"),EN_RXADDR);
print_byte_register(PSTR("RF_CH"),RF_CH); print_byte_register(PSTR("RF_CH\t"),RF_CH);
print_byte_register(PSTR("RF_SETUP"),RF_SETUP); print_byte_register(PSTR("RF_SETUP"),RF_SETUP);
print_byte_register(PSTR("CONFIG"),CONFIG); print_byte_register(PSTR("CONFIG\t"),CONFIG);
print_byte_register(PSTR("DYNPD/FEATURE"),DYNPD,2); print_byte_register(PSTR("DYNPD/FEATURE"),DYNPD,2);
#if defined(__arm__) || defined (RF24_LINUX) || defined (__ARDUINO_X86__) || defined(LITTLEWIRE) || defined (RF24_BBB) #if defined(__arm__) || defined (RF24_LINUX) || defined (__ARDUINO_X86__) || defined(LITTLEWIRE) || defined (RF24_BBB)
......
...@@ -502,6 +502,8 @@ s * ...@@ -502,6 +502,8 @@ s *
* @warning Only three of these can be pending at any time as there are only 3 FIFO buffers.<br> Dynamic payloads must be enabled. * @warning Only three of these can be pending at any time as there are only 3 FIFO buffers.<br> Dynamic payloads must be enabled.
* @note Ack payloads are handled automatically by the radio chip when a payload is received. Users should generally * @note Ack payloads are handled automatically by the radio chip when a payload is received. Users should generally
* write an ack payload as soon as startListening() is called, so one is available when a regular payload is received. * write an ack payload as soon as startListening() is called, so one is available when a regular payload is received.
* @note Ack payloads are dynamic payloads. This only works on pipes 0&1 by default. Call
* enableDynamicPayloads() to enable on all pipes.
* *
* @param pipe Which pipe# (typically 1-5) will get this response. * @param pipe Which pipe# (typically 1-5) will get this response.
* @param buf Pointer to data that is sent * @param buf Pointer to data that is sent
...@@ -768,6 +770,8 @@ s * ...@@ -768,6 +770,8 @@ s *
* Ack payloads are a handy way to return data back to senders without * Ack payloads are a handy way to return data back to senders without
* manually changing the radio modes on both units. * manually changing the radio modes on both units.
* *
* @note Ack payloads are dynamic payloads. This only works on pipes 0&1 by default. Call
* enableDynamicPayloads() to enable on all pipes.
*/ */
void enableAckPayload(void); void enableAckPayload(void);
......
...@@ -112,17 +112,6 @@ ...@@ -112,17 +112,6 @@
#define _BV(bit) (1<<(bit)) #define _BV(bit) (1<<(bit))
#endif #endif
// Avoid spurious warnings
// Arduino DUE is arm and uses traditional PROGMEM constructs
#if 1
#if ! defined( NATIVE ) && defined( ARDUINO ) && ! defined(__arm__)
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
#endif
#endif
// Progmem is Arduino-specific // Progmem is Arduino-specific
// Arduino DUE is arm and does not include avr/pgmspace // Arduino DUE is arm and does not include avr/pgmspace
#if defined(ARDUINO) && ! defined(__arm__) && !defined (__ARDUINO_X86__) #if defined(ARDUINO) && ! defined(__arm__) && !defined (__ARDUINO_X86__)
......
...@@ -84,7 +84,7 @@ int main(int argc, char** argv){ ...@@ -84,7 +84,7 @@ int main(int argc, char** argv){
printf("RPi/RF24/examples/gettingstarted_call_response\n"); printf("RPi/RF24/examples/gettingstarted_call_response\n");
radio.begin(); radio.begin();
radio.enableAckPayload(); // Allow optional ack payloads radio.enableAckPayload(); // Allow optional ack payloads
radio.enableDynamicAck(); radio.enableDynamicPayloads();
radio.printDetails(); // Dump the configuration of the rf unit for debugging radio.printDetails(); // Dump the configuration of the rf unit for debugging
......
{
"name": "RF24",
"keywords": "rf, radio, wireless, spi",
"description": "Optimized High Speed Driver for nRF24L01(+) 2.4GHz Wireless Transceiver",
"repository":
{
"type": "git",
"url": "https://github.com/TMRh20/RF24.git"
},
"include": [
"*.h",
"*.c",
"*.cpp",
"arch/ATTiny/*",
"arch/Due/*",
"arch/Teensy/*",
"examples/*/*.ino"
],
"frameworks": "arduino",
"platforms": [
"atmelavr",
"atmelsam",
"teensy"
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment