-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added rf12_set_sender_id to allow senderID to be switched without having #108
Open
alandpearson
wants to merge
1
commit into
jeelabs:master
Choose a base branch
from
alandpearson:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,11 @@ | |
#endif | ||
|
||
#if RF12_COMPAT | ||
/* | ||
#define rf12_rawlen rf12_buf[1] | ||
#define rf12_dest (rf12_buf[2] & RF12_HDR_MASK) | ||
#define rf12_orig (rf12_buf[3] & RF12_HDR_MASK) | ||
*/ | ||
#define rf12_rawlen rf12_buf[1] | ||
#define rf12_dest (rf12_buf[2] & RF12_HDR_MASK) | ||
#define rf12_orig (rf12_buf[3] & RF12_HDR_MASK) | ||
|
@@ -497,7 +502,8 @@ void rf12_sendStart (uint8_t hdr) { | |
uint8_t parity = group ^ (group << 4); | ||
parity = (parity ^ (parity << 2)) & 0xC0; | ||
// the lower 6 bits are the destination, or zer of broadcasting | ||
rf12_dst = parity | (hdr & RF12_HDR_DST ? hdr & RF12_HDR_MASK : 0); | ||
//rf12_dst = parity | (hdr & RF12_HDR_DST ? hdr & RF12_HDR_MASK : 0); | ||
rf12_dst = parity | ( hdr & RF12_HDR_MASK ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't grasp what this change does. |
||
// the header byte has the two flag bits and the origin address | ||
rf12_hdr = (hdr & ~RF12_HDR_MASK) + (nodeid & NODE_ID); | ||
#else | ||
|
@@ -694,6 +700,10 @@ uint8_t rf12_initialize (uint8_t id, uint8_t band, uint8_t g, uint16_t f) { | |
return nodeid; | ||
} | ||
|
||
void rf12_sender_id (uint8_t id) { | ||
nodeid = id ; | ||
} | ||
|
||
/// @details | ||
/// This can be used to send out slow bit-by-bit On Off Keying signals to other | ||
/// devices such as remotely controlled power switches operating in the 433, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,9 @@ | |
|
||
// Modify the RF12 driver in such a way that it can inter-operate with RFM69 | ||
// modules running in "native" mode. This affects packet layout and some more. | ||
#define RF12_COMPAT 0 | ||
#define RF12_COMPAT 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Native mode on the RFM69 is not the default mode of operation. |
||
|
||
// | ||
#include <stdint.h> | ||
|
||
/// RFM12B Protocol version. | ||
|
@@ -94,6 +95,9 @@ uint8_t rf12_initialize(uint8_t id, uint8_t band, uint8_t group=0xD4, uint16_t f | |
/// Initialize the RFM12B module from settings stored in EEPROM by "RF12demo" | ||
/// don't call rf12_initialize() if you init the hardware with rf12_config(). | ||
/// @return the node ID as 1..31, or 0 if there is no config on EEPROM. | ||
/// | ||
void rf12_sender_id(uint8_t id) ; | ||
|
||
uint8_t rf12_configSilent(); | ||
/// Call this to send a description of the EEPROM settings to the serial port. | ||
void rf12_configDump(); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this change do?