-
Notifications
You must be signed in to change notification settings - Fork 165
Minor mod to build for custom python modules, and NVS string support #226
Conversation
modules to be frozen, along with rules to include said modules in build.
Also add mods to pycom module to provide support for string set/get in NVS--now we have support strings and, with e.g. JSON, basically any data structure (up to the limit of 1984 bytes supported by the ESD-IDF nvs lib). |
} else if (ESP_ERR_NVS_INVALID_NAME == esp_err || ESP_ERR_NVS_KEY_TOO_LONG == esp_err) { | ||
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid key (or too long)")); | ||
} else { | ||
// not ESP_OK, but not reporting? TODO:check this... |
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.
An exception here with a generic message is needed
return mp_const_none; | ||
} | ||
vstr_init_len(&vstr, required_size); | ||
if (ESP_OK != nvs_get_str(pycom_nvs_handle, key, vstr.buf, &required_size)) { |
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.
Instead of this, after the necessary size is fetched I would simply allocate enough byte with m_malloc(), fetch the value from NVS, then create the return object with mp_obj_new_str(), then free up the allocated memory and return the composed string. In this case it is not needed to compose vstr, remove closing \0 etc.
…om-micropython-sigfox into psychogenic-master #226 @psychogenic
### New Features - Esp32 touchpad functionality exposed to micropy ### Improvements - Added RSA signature generation API to moducrypto - Added support for saving strings in NVS - PR #226 , author: @psychogenic - LTE class refactoring ### Bug Fix - Fix UART.sendbreak not defaulting to 13 bits as suggested by Documentation Issue #280
…thon-sigfox into psychogenic-master #226 @psychogenic # Conflicts: # esp32/frozen/Custom/README.md # esp32/mods/modpycom.c
PYFW-334: Merge and test PR #226
### New Features - Esp32 touchpad functionality exposed to micropy - Upgraded LittleFS to v2.0 (Note: this update will format the File system !! ) ### Improvements - Added RSA signature generation API to moducrypto - Added support for saving strings in NVS - PR #226 , author: @psychogenic - LTE class refactoring - BLE advertisement parameters are now configurable via MicroPython <author>: @ninoita - Added BLE raw adv data setting <author>: @ninoita ### Bug Fix - Fix UART.sendbreak not defaulting to 13 bits as suggested by Documentation Issue #280 - Fix wlan.isconnected not returning True when station is connected in AP mode Issue #244
### New Features - Esp32 touchpad functionality exposed to micropy ### Improvements - Added RSA signature generation API to moducrypto - Added support for saving strings in NVS - PR pycom#226 , author: @psychogenic - LTE class refactoring ### Bug Fix - Fix UART.sendbreak not defaulting to 13 bits as suggested by Documentation Issue pycom#280
…thon-sigfox into psychogenic-master pycom#226 @psychogenic # Conflicts: # esp32/frozen/Custom/README.md # esp32/mods/modpycom.c
PYFW-334: Merge and test PR pycom#226
### New Features - Esp32 touchpad functionality exposed to micropy - Upgraded LittleFS to v2.0 (Note: this update will format the File system !! ) ### Improvements - Added RSA signature generation API to moducrypto - Added support for saving strings in NVS - PR pycom#226 , author: @psychogenic - LTE class refactoring - BLE advertisement parameters are now configurable via MicroPython <author>: @ninoita - Added BLE raw adv data setting <author>: @ninoita ### Bug Fix - Fix UART.sendbreak not defaulting to 13 bits as suggested by Documentation Issue pycom#280 - Fix wlan.isconnected not returning True when station is connected in AP mode Issue pycom#244
Small change to allow for a standard, distinct, directory into which we can drop packages/modules to be frozen and included into the generated frozen_mpy.c