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
4542464e
Commit
4542464e
authored
Aug 02, 2011
by
maniacbug
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for static payloads
parents
d436895f
af00a615
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
RF24.cpp
RF24.cpp
+6
-18
No files found.
RF24.cpp
View file @
4542464e
...
...
@@ -111,16 +111,11 @@ uint8_t RF24::write_payload(const void* buf, uint8_t len)
csn
(
LOW
);
status
=
SPI
.
transfer
(
W_TX_PAYLOAD
);
uint8_t
data_len
=
min
(
len
,
payload_size
);
uint8_t
blank_len
=
payload_size
-
data_len
;
while
(
data_len
--
)
SPI
.
transfer
(
*
current
++
);
// This does not seem to be needed. Keeping it here in case
// removing it does cause problems for static payloads
//
// Send blanks out to the chip to finish off the payload
//uint8_t blank_len = payload_size - data_len;
//while ( blank_len-- )
// SPI.transfer(0);
while
(
blank_len
--
)
SPI
.
transfer
(
0
);
csn
(
HIGH
);
...
...
@@ -137,18 +132,11 @@ uint8_t RF24::read_payload(void* buf, uint8_t len)
csn
(
LOW
);
status
=
SPI
.
transfer
(
R_RX_PAYLOAD
);
uint8_t
data_len
=
min
(
len
,
payload_size
);
uint8_t
blank_len
=
payload_size
-
data_len
;
while
(
data_len
--
)
*
current
++
=
SPI
.
transfer
(
0xff
);
// This does not seem to be needed. Keeping it here in case
// removing it does cause problems for static payloads
//
// Read the remaining payload off the chip, even though we will
// throw it away.
//uint8_t blank_len = payload_size - data_len;
//while ( blank_len-- )
// SPI.transfer(0xff);
while
(
blank_len
--
)
SPI
.
transfer
(
0xff
);
csn
(
HIGH
);
return
status
;
...
...
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