summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2019-10-21Refine _bleioScott Shawcroft
This PR refines the _bleio API. It was originally motivated by the addition of a new CircuitPython service that enables reading and modifying files on the device. Moving the BLE lifecycle outside of the VM motivated a number of changes to remove heap allocations in some APIs. It also motivated unifying connection initiation to the Adapter class rather than the Central and Peripheral classes which have been removed. Adapter now handles the GAP portion of BLE including advertising, which has moved but is largely unchanged, and scanning, which has been enhanced to return an iterator of filtered results. Once a connection is created (either by us (aka Central) or a remote device (aka Peripheral)) it is represented by a new Connection class. This class knows the current connection state and can discover and instantiate remote Services along with their Characteristics and Descriptors. Relates to #586
2019-10-20Parameterize linker scriptDan Halbert
2019-10-20fix show and fix step > 1Roy Hooper
2019-10-15Merge remote-tracking branch 'adafruit/master' into bonding1Dan Halbert
2019-10-14Switch arg check back to allow ignored args for stringsScott Shawcroft
2019-10-14Support __bytesScott Shawcroft
Fixes #1763
2019-10-14 restructure nlr.h for udefined archtecturesJerry Needell
2019-10-10mp_obj_instance_make_new: clearer way to avoid null pointer dereferenceJeff Epler
2019-10-08mp_obj_instance_make_new: avoid undefined behaviorJeff Epler
If kw_args is NULL then memcpy() gets a NULL source argument. This is undefined behavior under the C standard, even if 0 bytes are being copied. This problem was found using clang 7's scan-build static analyzer.
2019-10-08mp_bytecode_print_str: avoid undefined behaviorJeff Epler
Left shift of negative numbers is undefined in the "C" standard. Multiplying by 128 has the intended effect (in the absence of integer overflow, anyway), can be implemented using the same shift instruction, but does not invoke undefined behavior. This problem was found using clang 7's scan-build static analyzer.
2019-10-08gc_alloc: Remove redundant 'collected' assignmentJeff Epler
The remaining assignment was added in upstream micropython; the deleted assignment was added in circuitpython as part of the long-lived object area feature. During the merge, the redundant assignment was not removed. (since collected is a local variable and no pointers to it escape, it doesn't seem possible for the placement of the assignment before or after GC_ENTER() is important) This diagnostic was found by clang 7's scan-build static analyzer.
2019-10-08mp_binary_get_int: avoid undefined behaviorJeff Epler
Left shift of negative numbers is undefined in the "C" standard. Multiplying by 256 has the intended effect (in the absence of integer overflow, anyway), can be implemented using the same shift instruction, but does not invoke undefined behavior. This problem was found using clang 7's scan-build static analyzer.
2019-10-06WIP: bondingDan Halbert
2019-10-04Revert modules with missed dependenceHierophect
2019-10-03Add Always Build flag, remove redundancyHierophect
2019-09-11In py/, must guard uses of RUN_BACKGROUND_TASKSjepler
2019-09-09stream_readall: This can be long-running, run background tasksjepler
While finding sources of clicks and buzzes in nrf i2sout, I identified this site as one which could be long running. Reproducer code was to play a 22.05kHz sample and repeatedly print `os.listdir('')`
2019-09-09py/obj.c: This can be long-running, run background tasksjepler
While finding sources of clicks and buzzes in nrf i2sout, I identified this site as one which could be long running. Reproducer code was to play a 22.05kHz sample and repeatedly print `os.listdir('')`
2019-09-01Merge branch 'master' of https://github.com/adafruit/circuitpython into ↵sommersoft
mixer_voice
2019-08-29Merge branch 'master' of https://github.com/adafruit/circuitpython into ↵sommersoft
mixer_voice
2019-08-29rename bleio module to _bleioDan Halbert
2019-08-28bleio: API change to create and connect related objects simulatenously: no ↵Dan Halbert
orphan bleio objects
2019-08-27Disable bitbangio on Itsy M0Scott Shawcroft
Also, switch CIRCUITPY_BITBANG_APA102 to makefile setting so it can alter included files
2019-08-24move Mixer & MixerVoice from 'audiocore' to 'audiomixer'sommersoft
2019-08-24Merge branch 'master' of https://github.com/adafruit/circuitpython into ↵sommersoft
mixer_voice
2019-08-23Rework based on Dan's reviewScott Shawcroft
2019-08-22Add initial Monster M4SK buildScott Shawcroft
2019-08-22Rework refresh API and factor common display stuff outScott Shawcroft
NOT TESTED! Just compiles Fixes #1691
2019-08-22Begin refresh rework.Scott Shawcroft
2019-08-22EPaper displays work mostly.Scott Shawcroft
2019-08-20merge from upstream and make translateDan Halbert
2019-08-19Merge pull request #2068 from jepler/audioio-compatScott Shawcroft
audioio: By default, be compatible with 4.x
2019-08-19Merge branch 'master' of https://github.com/adafruit/circuitpython into ↵sommersoft
mixer_voice
2019-08-19Merge remote-tracking branch 'adafruit/master' into run-background-tasksDan Halbert
Restore dependencies indicated by indentation in circuitpy_mpconfig.h.
2019-08-18make nrf touchio be generic: now available for SAMD51 tooDan Halbert
2019-08-17audioio: By default, be compatible with 4.xJeff Epler
Testing performed: That the shipped .mpy files on a PyPortal (CP 4.x) still work (play audio) with this branch, instead of erroring because `WaveFile` can't be found in `audioio`. Flash usage grew by 28 bytes. (I expected 24, there must be some other effect on size/alignment that I didn't predict)
2019-08-16Merge pull request #2066 from dhalbert/ble-pairingScott Shawcroft
BLE: more features
2019-08-14Fix I2CDisplay lifecycle and splash lifecycle.Scott Shawcroft
Fixes https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306/issues/2
2019-08-11cicuitpy_mpconfg.h: Define RUN_BACKGROUND_TASKSJeff Epler
In #2013, @danh says: My choice of where to put the semicolon is deliberate, so that we can say RUN_BACKGROUND_TASKS; not have a redundant semicolon, and not confuse C code formatting.
2019-08-11cicuitpy_mpconfg.h: Alphebetize and standardize indentationJeff Epler
.. no semantic change intended
2019-08-10py: mp_obj_tuple_get: accept any item which can use tuple_getiterJeff Epler
.. such as namedtuple and attrtuple objects. This is the same predicate used elsewhere in the file to check for adequate compatibility between the types. This was discovered due to crashing `time.time()` on the nrf port. Closes: #2052
2019-08-06Merge pull request #2042 from jepler/qstr-expansionScott Shawcroft
makeqstrdata: permit longer "compressed" outputs
2019-08-06makeqstrdata: permit longer "compressed" outputsJeff Epler
It is possible for this routine to expand some inputs, and in fact it does for certan strings in the proposed Korean translation of CircuitPython (#1858). I did not determine what the maximum expansion is -- it's probably modest, like len()/7+2 bytes or something -- so I tried to just make enc[] an adequate over-allocation, and then ensured that all the strings in the proposed ko.po now worked. The worst actual expansion seems to be a string that goes from 65 UTF-8-encoded bytes to 68 compressed bytes (+4.6%). Only a few out of all strings are reported as non-compressed.
2019-08-05Merge remote-tracking branch 'adafruit/master' into ble-pairingDan Halbert
2019-08-03bring MixerVoice back to building state; update documentationsommersoft
2019-08-02WIP: rework of Characteristic properties; enhance Descriptor; not testedDan Halbert
2019-07-31cleanup adapter.address; add uniquish suffix to BLE device nameDan Halbert
2019-07-29PWM audio: Rename AudioOut -> PWMAudioOut, _audioio_ -> _audiopwmio_Jeff Epler
2019-07-26audiopwmio: Add the shared files for this new moduleJeff Epler
2019-07-25Merge pull request #2010 from jepler/audiocoreScott Shawcroft
audiocore: Factor from audioio