Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RF24
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
RF24
Commits
d8b2512e
Commit
d8b2512e
authored
May 12, 2011
by
maniacbug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow opening pipe 0 for reading. Useful if it's on a different subnet from others
parent
4f6c4c90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
RF24.cpp
RF24.cpp
+5
-5
RF24.h
RF24.h
+3
-3
No files found.
RF24.cpp
View file @
d8b2512e
...
...
@@ -489,16 +489,16 @@ void RF24::openWritingPipe(uint64_t value)
void
RF24
::
openReadingPipe
(
uint8_t
child
,
uint64_t
value
)
{
const
uint8_t
child_pipe
[]
=
{
RX_ADDR_P1
,
RX_ADDR_P2
,
RX_ADDR_P3
,
RX_ADDR_P4
,
RX_ADDR_P5
};
RX_ADDR_P
0
,
RX_ADDR_P
1
,
RX_ADDR_P2
,
RX_ADDR_P3
,
RX_ADDR_P4
,
RX_ADDR_P5
};
const
uint8_t
child_payload_size
[]
=
{
RX_PW_P1
,
RX_PW_P2
,
RX_PW_P3
,
RX_PW_P4
,
RX_PW_P5
};
RX_PW_P
0
,
RX_PW_P
1
,
RX_PW_P2
,
RX_PW_P3
,
RX_PW_P4
,
RX_PW_P5
};
const
uint8_t
child_pipe_enable
[]
=
{
ERX_P1
,
ERX_P2
,
ERX_P3
,
ERX_P4
,
ERX_P5
};
ERX_P
0
,
ERX_P
1
,
ERX_P2
,
ERX_P3
,
ERX_P4
,
ERX_P5
};
if
(
--
child
<
5
)
if
(
child
<
5
)
{
// For pipes 2-5, only write the LSB
if
(
!
child
)
if
(
child
<
2
)
write_register
(
child_pipe
[
child
],
reinterpret_cast
<
uint8_t
*>
(
&
value
),
5
);
else
write_register
(
child_pipe
[
child
],
reinterpret_cast
<
uint8_t
*>
(
&
value
),
1
);
...
...
RF24.h
View file @
d8b2512e
...
...
@@ -307,7 +307,7 @@ public:
*
* @see openWritingPipe
*
* @warning
all 5 reading pipes
should share the first 32 bits.
* @warning
Pipes 1-5
should share the first 32 bits.
* Only the least significant byte should be unique, e.g.
*
* @code
...
...
@@ -315,9 +315,9 @@ public:
* openReadingPipe(2,0xF0F0F0F066);
* @endcode
*
* @todo Enforce the restriction that
all pipes
must share the top 32 bits
* @todo Enforce the restriction that
pipes 1-5
must share the top 32 bits
*
* @param number Which pipe# to open,
1
-5.
* @param number Which pipe# to open,
0
-5.
* @param address The 40-bit address of the pipe to open.
*/
void
openReadingPipe
(
uint8_t
number
,
uint64_t
address
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment