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

Minor mod to build for custom python modules, and NVS string support #226

Merged
merged 3 commits into from May 14, 2019

Conversation

psychogenic
Copy link
Contributor

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

@psychogenic psychogenic changed the title Minor mod to build to create a dedicated dir for custom python modules Minor mod to build for custom python modules, and NVS string support Nov 21, 2018
@psychogenic
Copy link
Contributor Author

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...
Copy link
Contributor

@husigeza husigeza Apr 17, 2019

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)) {
Copy link
Contributor

@husigeza husigeza Apr 17, 2019

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.

@iwahdan88 iwahdan88 changed the base branch from master to release-candidate April 23, 2019 16:13
iwahdan88 pushed a commit to iwahdan88/pycom-micropython-sigfox that referenced this pull request May 13, 2019
iwahdan88 pushed a commit that referenced this pull request May 14, 2019
### 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
@iwahdan88 iwahdan88 merged commit b636bd7 into pycom:release-candidate May 14, 2019
iwahdan88 pushed a commit that referenced this pull request May 14, 2019
…thon-sigfox into psychogenic-master #226 @psychogenic

# Conflicts:
#	esp32/frozen/Custom/README.md
#	esp32/mods/modpycom.c
iwahdan88 pushed a commit that referenced this pull request May 14, 2019
iwahdan88 pushed a commit that referenced this pull request May 14, 2019
### 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
thinkberg pushed a commit to ubirch/pycom-micropython-sigfox that referenced this pull request May 27, 2019
thinkberg pushed a commit to ubirch/pycom-micropython-sigfox that referenced this pull request May 27, 2019
### 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
X-Ryl669 pushed a commit to X-Ryl669/pycom-micropython-sigfox that referenced this pull request May 12, 2023
…thon-sigfox into psychogenic-master pycom#226 @psychogenic

# Conflicts:
#	esp32/frozen/Custom/README.md
#	esp32/mods/modpycom.c
X-Ryl669 pushed a commit to X-Ryl669/pycom-micropython-sigfox that referenced this pull request May 12, 2023
X-Ryl669 pushed a commit to X-Ryl669/pycom-micropython-sigfox that referenced this pull request May 12, 2023
### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants