Skip to content

Commit

Permalink
move SLOW_RESPONSE macro to Network lvl
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jul 26, 2021
1 parent f301912 commit b7d052d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ if(DEFINED MAX_PAYLOAD_SIZE) # don't use CMake's `option()` for this one
message(STATUS "MAX_PAYLOAD_SIZE set to ${MAX_PAYLOAD_SIZE}")
target_compile_definitions(${LibTargetName} PUBLIC MAX_PAYLOAD_SIZE=${MAX_PAYLOAD_SIZE})
endif()
if(DEFINED SLOW_ADDR_POLL_RESPONSE)
message(STATUS "SLOW_ADDR_POLL_RESPONSE set to ${SLOW_ADDR_POLL_RESPONSE}")
target_compile_definitions(${LibTargetName} PUBLIC SLOW_ADDR_POLL_RESPONSE=${SLOW_ADDR_POLL_RESPONSE})
endif()

###########################
# target install rules for the RF24Log lib
Expand Down
4 changes: 2 additions & 2 deletions RF24Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ uint8_t RF24Network::update(void)
if (!(networkFlags & FLAG_NO_POLL) && node_address != NETWORK_DEFAULT_ADDRESS) {
header->to_node = header->from_node;
header->from_node = node_address;
#ifdef MESH_SLOW_ADDRESS_RESPONSE
delay(parent_pipe + MESH_SLOW_ADDRESS_RESPONSE);
#ifdef SLOW_ADDR_POLL_RESPONSE
delay(parent_pipe + SLOW_ADDR_POLL_RESPONSE);
#else
delay(parent_pipe);
#endif
Expand Down
13 changes: 13 additions & 0 deletions RF24Network_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
/** @brief A sentinel value for internally indicating that the frame should be automatically routed as necessary */
#define NETWORK_AUTO_ROUTING 070

#ifdef DOXYGEN_FORCED
/**
* @brief Adds a delay to node prior to transmitting NETWORK_ADDR_RESPONSE messages
*
* By default this is undefined for speed. This defined number of milliseconds is
* only applied to the master node when replying to a child trying to connect to the
* mesh network.
* @note It is advised to define this if any child node is running CircuitPython because
* the execution speed in pure python is inherently slower than it is in C++.
*/
#define SLOW_ADDR_POLL_RESPONSE 10
#endif // defined DOXYGEN_FORCED

#if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)

/********** USER CONFIG - non ATTiny **************/
Expand Down

0 comments on commit b7d052d

Please sign in to comment.