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
14c34ca2
Commit
14c34ca2
authored
Jul 31, 2011
by
maniacbug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle -A1 -s2
parent
602d9626
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
58 deletions
+67
-58
RF24.cpp
RF24.cpp
+67
-58
No files found.
RF24.cpp
View file @
14c34ca2
...
...
@@ -355,7 +355,8 @@ void RF24::begin(void)
// reset our data rate back to default value. This works
// because a non-P variant won't allow the data rate to
// be set to 250Kbps.
if
(
setDataRate
(
RF24_250KBPS
)
)
{
if
(
setDataRate
(
RF24_250KBPS
)
)
{
p_variant
=
true
;
}
setDataRate
(
RF24_2MBPS
)
;
...
...
@@ -715,7 +716,8 @@ bool RF24::isAckPayloadAvailable(void)
/****************************************************************************/
boolean
RF24
::
isPVariant
(
void
)
{
boolean
RF24
::
isPVariant
(
void
)
{
return
p_variant
;
}
...
...
@@ -736,9 +738,12 @@ void RF24::setAutoAck( uint8_t pipe, bool enable )
if
(
pipe
<=
6
)
{
uint8_t
en_aa
=
read_register
(
EN_AA
)
;
if
(
enable
)
{
if
(
enable
)
{
en_aa
|=
_BV
(
pipe
)
;
}
else
{
}
else
{
en_aa
&=
~
_BV
(
pipe
)
;
}
write_register
(
EN_AA
,
en_aa
)
;
...
...
@@ -856,7 +861,8 @@ boolean RF24::setDataRate(rf24_datarate_e speed)
// Verify our result
setup
=
read_register
(
RF_SETUP
)
;
if
(
setup
==
setup
)
{
if
(
setup
==
setup
)
{
return
true
;
}
...
...
@@ -866,12 +872,14 @@ boolean RF24::setDataRate(rf24_datarate_e speed)
/******************************************************************/
rf24_datarate_e
RF24
::
getDataRate
(
void
)
{
rf24_datarate_e
RF24
::
getDataRate
(
void
)
{
rf24_datarate_e
result
;
uint8_t
setup
=
read_register
(
RF_SETUP
)
;
// Order matters in our case below
switch
(
setup
&
(
_BV
(
RF_DR_LOW
)
|
_BV
(
RF_DR_HIGH
))
)
{
switch
(
setup
&
(
_BV
(
RF_DR_LOW
)
|
_BV
(
RF_DR_HIGH
))
)
{
case
_BV
(
RF_DR_LOW
):
// '10' = 250KBPS
result
=
RF24_250KBPS
;
...
...
@@ -902,7 +910,8 @@ void RF24::setCRCLength(rf24_crclength_e length)
// Now config 8 or 16 bit CRCs - only 16bit need be turned on
// 8b is the default.
if
(
length
==
RF24_CRC_16
)
{
if
(
length
==
RF24_CRC_16
)
{
config
|=
_BV
(
CRCO
)
;
}
...
...
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