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

choose avr sleep mode with sleepNode #109

Open
acejoh opened this issue Mar 30, 2017 · 1 comment
Open

choose avr sleep mode with sleepNode #109

acejoh opened this issue Mar 30, 2017 · 1 comment

Comments

@acejoh
Copy link

acejoh commented Mar 30, 2017

Hi,

I'd like to put the atmega of my rf24 node to sleep, but I need PWM so I can't use the full sleep mode. I need the idle mode instead. I don't see any possibility for this in RF24Network? Maybe it is possible to disable ENABLE_SLEEP_MODE in rf24network_config and use another library for sleeping? I haven't tried that and it would be a solution, but it'd be nice if it was available in rf24network.

@acejoh
Copy link
Author

acejoh commented May 10, 2017

I would propose to add another RF24Network::sleepNode function with an additional parameter:

bool RF24Network::sleepNode( unsigned int cycles, int interruptPin, uint8_t mode ){


  sleep_cycles_remaining = cycles;
  set_sleep_mode(mode); // sleep mode is set here
  sleep_enable();
  ...
}

the original sleepNode method would then be modified like so.

bool RF24Network::sleepNode( unsigned int cycles, int interruptPin ){
  sleepNode(cycles, interruptPin, SLEEP_MODE_PWR_DOWN);
}

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants