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
72602783
Commit
72602783
authored
Oct 19, 2011
by
maniacbug
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:maniacbug/RF24
parents
066d79f2
ef02ce6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
RF24.cpp
RF24.cpp
+9
-4
No files found.
RF24.cpp
View file @
72602783
...
...
@@ -266,14 +266,16 @@ void RF24::setChannel(uint8_t channel)
// TODO: This method could take advantage of the 'wide_band' calculation
// done in setChannel() to require certain channel spacing.
write_register
(
RF_CH
,
min
(
channel
,
127
));
const
uint8_t
max_channel
=
127
;
write_register
(
RF_CH
,
min
(
channel
,
max_channel
));
}
/****************************************************************************/
void
RF24
::
setPayloadSize
(
uint8_t
size
)
{
payload_size
=
min
(
size
,
32
);
const
uint8_t
max_payload_size
=
32
;
payload_size
=
min
(
size
,
max_payload_size
);
}
/****************************************************************************/
...
...
@@ -593,7 +595,9 @@ void RF24::openWritingPipe(uint64_t value)
write_register
(
RX_ADDR_P0
,
reinterpret_cast
<
uint8_t
*>
(
&
value
),
5
);
write_register
(
TX_ADDR
,
reinterpret_cast
<
uint8_t
*>
(
&
value
),
5
);
write_register
(
RX_PW_P0
,
min
(
payload_size
,
32
));
const
uint8_t
max_payload_size
=
32
;
write_register
(
RX_PW_P0
,
min
(
payload_size
,
max_payload_size
));
}
/****************************************************************************/
...
...
@@ -707,7 +711,8 @@ void RF24::writeAckPayload(uint8_t pipe, const void* buf, uint8_t len)
csn
(
LOW
);
SPI
.
transfer
(
W_ACK_PAYLOAD
|
(
pipe
&
B111
)
);
uint8_t
data_len
=
min
(
len
,
32
);
const
uint8_t
max_payload_size
=
32
;
uint8_t
data_len
=
min
(
len
,
max_payload_size
);
while
(
data_len
--
)
SPI
.
transfer
(
*
current
++
);
...
...
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