-
Notifications
You must be signed in to change notification settings - Fork 81
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
base: publish
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]) | ||
|
||
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" | ||
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. Could we mention the error type (ValueError) instead of the error text? 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. Please hold. |
||
|
||
### pycom.nvs_erase(key) | ||
|
||
|
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.
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.