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
50450a9f
Commit
50450a9f
authored
Nov 25, 2014
by
TMRh20
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38 from jfktrey/master
Non-conflicting names
parents
58293d6f
1650b6bd
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
+6
-6
RF24_config.h
RF24_config.h
+2
-2
No files found.
RF24.cpp
View file @
50450a9f
...
...
@@ -220,7 +220,7 @@ uint8_t RF24::write_payload(const void* buf, uint8_t data_len, const uint8_t wri
uint8_t
status
;
const
uint8_t
*
current
=
reinterpret_cast
<
const
uint8_t
*>
(
buf
);
data_len
=
min
(
data_len
,
payload_size
);
data_len
=
rf24_
min
(
data_len
,
payload_size
);
uint8_t
blank_len
=
dynamic_payloads_enabled
?
0
:
payload_size
-
data_len
;
//printf("[Writing %u bytes %u blanks]",data_len,blank_len);
...
...
@@ -479,14 +479,14 @@ RF24::RF24(uint8_t _cepin, uint8_t _cspin, uint32_t _spi_speed):
void
RF24
::
setChannel
(
uint8_t
channel
)
{
const
uint8_t
max_channel
=
127
;
write_register
(
RF_CH
,
min
(
channel
,
max_channel
));
write_register
(
RF_CH
,
rf24_
min
(
channel
,
max_channel
));
}
/****************************************************************************/
void
RF24
::
setPayloadSize
(
uint8_t
size
)
{
payload_size
=
min
(
size
,
32
);
payload_size
=
rf24_
min
(
size
,
32
);
}
/****************************************************************************/
...
...
@@ -1129,7 +1129,7 @@ void RF24::openWritingPipe(uint64_t value)
//const uint8_t max_payload_size = 32;
//write_register(RX_PW_P0,min(payload_size,max_payload_size));
//write_register(RX_PW_P0,
rf24_
min(payload_size,max_payload_size));
write_register
(
RX_PW_P0
,
payload_size
);
}
...
...
@@ -1143,7 +1143,7 @@ void RF24::openWritingPipe(const uint8_t *address)
write_register
(
TX_ADDR
,
address
,
addr_width
);
//const uint8_t max_payload_size = 32;
//write_register(RX_PW_P0,min(payload_size,max_payload_size));
//write_register(RX_PW_P0,
rf24_
min(payload_size,max_payload_size));
write_register
(
RX_PW_P0
,
payload_size
);
}
...
...
@@ -1311,7 +1311,7 @@ void RF24::writeAckPayload(uint8_t pipe, const void* buf, uint8_t len)
{
const
uint8_t
*
current
=
reinterpret_cast
<
const
uint8_t
*>
(
buf
);
uint8_t
data_len
=
min
(
len
,
32
);
uint8_t
data_len
=
rf24_
min
(
len
,
32
);
#if defined (RF24_LINUX)
uint8_t
*
ptx
=
spi_txbuff
;
...
...
RF24_config.h
View file @
50450a9f
...
...
@@ -33,8 +33,8 @@
#include "RPi/bcm2835.h"
// GCC a Arduino Missing
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define
rf24_
max(a,b) (a>b?a:b)
#define
rf24_
min(a,b) (a<b?a:b)
#define _BV(x) (1<<(x))
#define pgm_read_word(p) (*(p))
#define pgm_read_byte(p) (*(p))
...
...
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