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

Disable WKP pin waking device up from SLEEP_MODE_DEEP #1409

Merged
merged 4 commits into from Jan 23, 2018

Conversation

@avtolstoy
Copy link
Member

commented Oct 23, 2017

submission notes
**Important:** Please sanitize/remove any confidential info like usernames, passwords, org names, product names/ids, access tokens, client ids/secrets, or anything else you don't wish to share.

Please Read and Sign the Contributor License Agreement ([Info here](https://github.com/spark/firmware/blob/develop/CONTRIBUTING.md)).

You may also delete this submission notes header if you'd like. Thank you for contributing!

Problem

See #1345

Solution

Adds SLEEP_DISABLE_WKP_PIN System.sleep() flag to disable waking up from STANDBY (deep sleep).

Steps to Test

  • wiring/api

Example App

void setup() {
}

void loop() {
    System.sleep(SLEEP_MODE_DEEP, SLEEP_DISABLE_WKP_PIN, 60);
}

References


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • TODO: Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy changed the title Disable WKP waking device up from SLEEP_MODE_DEEP Disable WKP pin waking device up from SLEEP_MODE_DEEP Oct 23, 2017

@ScruffR

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2017

I remember a proposal (by Mat or Brett?) to have "OR-able" flags like SLEEP_NETWORK_STANDBY | SLEEP_DISABLE_WKP_PIN instead of creating new overloads all over the place.
This overload would now have the flag as second parameter while SLEEP_NETWORK_STANDBY currently is third and would need to be fourth then.


Oops: Missed that one f653ce9

void HAL_Core_Enter_Safe_Mode(void* reserved);
void HAL_Core_Enter_Bootloader(bool persist);
void HAL_Core_Enter_Stop_Mode(uint16_t wakeUpPin, uint16_t edgeTriggerMode, long seconds);
void HAL_Core_Execute_Stop_Mode(void);
void HAL_Core_Enter_Standby_Mode(uint32_t seconds, void* reserved);
void HAL_Core_Enter_Standby_Mode(uint32_t seconds, uint32_t flags);

This comment has been minimized.

Copy link
@m-mcgowan

m-mcgowan Jan 18, 2018

Contributor

can we make the 2nd param a struct so that we have some extensibility in future?

@m-mcgowan m-mcgowan added this to the 0.8.0-rc.2 milestone Jan 18, 2018

avtolstoy added 4 commits Oct 23, 2017
Adds HAL_STANDBY_MODE_FLAG_DISABLE_WKP_PIN and modifies
HAL_Core_Enter_Standby_Mode() to accept flags
system_sleep: passes HAL_STANDBY_MODE_FLAG_DISABLE_WKP_PIN to HAL_Cor…
…e_Enter_Standby_Mode when SLEEP_DISABLE_WKP_PIN was used in a call to System.sleep()

@m-mcgowan m-mcgowan force-pushed the feature/deepsleep-disable-wkp-pin branch from e766b3e to f24fbdf Jan 22, 2018

@m-mcgowan m-mcgowan merged commit a552336 into develop Jan 23, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details

@m-mcgowan m-mcgowan deleted the feature/deepsleep-disable-wkp-pin branch Jan 23, 2018

avtolstoy added a commit to particle-iot/docs that referenced this pull request Feb 23, 2018
`System.sleep()`: documents new `SLEEP_DISABLE_WKP_PIN` option
Disable WKP pin waking device up from SLEEP_MODE_DEEP (particle-iot/device-os#1409)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.