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

update description of nvs_get #427

Open
wants to merge 1 commit into
base: publish
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/firmwareapi/pycom/pycom.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ Get or set the colour of the RGB LED. The colour is specified as 24 bit value re

Set the value of the specified key in the NVRAM memory area of the external flash. Data stored here is preserved across resets and power cycles. Value can only take 32-bit integers at the moment. Example:

### pycom.nvs_get(key)
### pycom.nvs_get(key[, optional_default_value])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The square brackets already indicate 'optional', perhaps its better to call it 'default_value'? I couldn't find how we call it in the firmware, but its always best to match that.


Get the value the specified key from the NVRAM memory area of the external flash. Example:
Get the value with the specified key from the NVRAM memory area of the external flash.

If a non-existing key is given the returned value will be `None`.
If a non-existing key is given the returned value will be the optional_default_value if it is provided, else an error will be raised. The error message for missing key is: "No matching object for the provided key"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we mention the error type (ValueError) instead of the error text?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please hold.
It seems there are more info to add. I have other priorities at the moment but I will be back with changes.


### pycom.nvs_erase(key)

Expand Down