Skip to content
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

Allow caller to choose transmit and receive pins #3

Merged
merged 1 commit into from Dec 30, 2013
Merged

Allow caller to choose transmit and receive pins #3

merged 1 commit into from Dec 30, 2013

Conversation

@ribbons
Copy link
Contributor

@ribbons ribbons commented Dec 10, 2013

I've got my transmitter connected to different pins than those in the library due to other constraints, so this adds an overload of lw_setup that the caller can use to specify which pins should be used for transmitting and receiving messages.

As lw_setup always called attachInterrupt, most of the receive code (~1k for my Arduino Uno) ended up being compiled even if it wasn't being used. I've split the setup code into lw_tx_setup and lw_rx_setup to allow calling only one of them if just tx or rx is being performed in a project.

* Add an overload of lw_setup so that the caller can optionally specify
  which pins should be used for transmitting and receiving messages
  (and which interrupt to attach).
* Split setup into lw_tx_setup and lw_rx_setup so that these can be
  called individually for projects only using transmit or receive to
  reduce the compiled code size.
@ribbons
Copy link
Contributor Author

@ribbons ribbons commented Dec 30, 2013

@lawrie Would you be able to take a look at this pull request?

lawrie added a commit that referenced this issue Dec 30, 2013
Allow caller to choose transmit and receive pins
@lawrie lawrie merged commit 395630c into lawrie:master Dec 30, 2013
@ribbons ribbons deleted the specify-pins branch Dec 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants