summaryrefslogtreecommitdiff
path: root/cc3200/mods
AgeCommit message (Collapse)Author
2017-08-21all: Make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros.Damien George
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-24all: Don't include system errno.h when it's not needed.Damien George
2017-07-18all: Unify header guard usage.Alexander Steffen
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
2017-07-11cc3200/modusocket: Fix connect() when in non-blocking or timeout mode.Damien George
Non-blocking connect on the CC3100 has non-POSIX behaviour and needs to be modified to match standard semantics.
2017-06-20cc3200: Initialise variable to zero to prevent compiler warnings.Damien George
2017-06-20cc3200: Make non-zero socket timeout work with connect/accept/send.Damien George
The CC3100 only allows to set a timeout for receiving data, not for accept, connect or send. But it can set non-blocking for all these operations and this patch uses that feature to implement socket timeout in terms of non- blocking behaviour combined with a loop.
2017-06-14cc3200/modusocket: Simplify socket.makefile() function.Damien George
Following how extmod/modlwip.c does it.
2017-05-21cc3200/mods/pybpin: Remove toggle() method.Paul Sokolovsky
It's not part of MicroPython HW API and can be easily implemented on Python level in case of need. Saved 56 bytes of binary.
2017-05-10ports: Add ilistdir in uos module.Damien George
2017-04-18cc3200/mods/pybi2c: Make readfnom_mem_into/writeto_mem return None.Damien George
This aligns the I2C class to match the standard machine.I2C API. Note that this is a (small) breaking change to the existing cc3200 API. The original API just returned the size of the input buffer so there's no information lost by this change. To update scripts users should just use the size of the buffer passed to these functions to get the number of bytes that are read/written.
2017-04-18cc3200/mods/pybi2c: Make machine.I2C constructor/init conform to HW API.Damien George
This is a user-facing change to the cc3200's API, to make it conform to the new machine hardware API. The changes are: - change I2C constructor to: I2C(id=0, *, freq=100000, scl=None, sda=None) - change I2C init to: init(*, freq, scl, sda) - removal of machine.I2C.MASTER constant - I2C str/repr no longer prints I2C.MASTER To update existing code it should be enough to just remove the I2C.MASTER constant from contructor/init for I2C.
2017-04-09cc3200/pybuart: Make parity specifications consistent with HW API.Paul Sokolovsky
parity=0 means even parity, parity=1 - odd.
2017-04-05cc3200/modmachine: Return frequency value directly, like other ports.Paul Sokolovsky
2017-03-31all: Use full path name when including mp-readline/timeutils/netutils.Damien George
This follows the pattern of how all other headers are now included, and makes it explicit where the header file comes from. This patch also removes -I options from Makefile's that specify the mp-readline/timeutils/ netutils directories, which are no longer needed.
2017-03-29cc3200/mods/pybi2c: Raise OSError if readfrom_mem fails to write addr.Damien George
2017-03-29cc3200: Update for changes to mp_obj_str_get_data.Damien George
2017-03-29cc3200: Update to use size_t for tuple/list accessors.Damien George
2017-03-22cc3200/mods/modutime: Use generic sleep_ms and sleep_us implementations.Damien George
2017-02-23cc3200/moduos: Remove uos.sep, as it's strictly optional.Paul Sokolovsky
In MicroPython, the path separator is guaranteed to be "/", extra unneeded things take precious code space (in the port which doesn't have basic things like floating-port support).
2017-02-22cc3200: Remove socket.timeout class, use OSError(ETIMEDOUT) instead.Damien George
socket.timeout is a subclass of OSError, and using the latter is more efficient than having a dedicated class. The argument of OSError is ETIMEDOUT so the error can be distinguished from other kinds of OSErrors. This follows how the esp8266 port does it.
2017-02-22cc3200/mods/modusocket: Init vars to 0 to silence compiler warnings.Damien George
Some compilers can't analyse the code to determine that these variables are always set before being used.
2017-02-22cc3200: When raising OSError's use MP_Exxx as arg instead of a string.Damien George
2017-02-22cc3200: Convert to using uPy internal errno numbers.Damien George
2017-02-22cc3200: Move wlan socket glue functions from modwlan to modusocket.Damien George
It saves about 400 bytes of code space because the functions can now be inlined.
2017-02-21cc3200: Remove remaining references to std.h.Damien George
2017-02-21cc3200/mods/modwlan: Add int casts to silence compiler warnings.Damien George
2017-02-21cc3200/mods/modwlan: Allow antenna diversity to be fully compiled out.Damien George
2017-02-21cc3200/mods/modwlan: Make multi-threaded a proper compile-time option.Damien George
2017-02-21cc3200/mods/modwlan: Remove unused header includes; simplify others.Damien George
2017-02-21cc3200: Remove util/std.h, can just use stdio.h instead.Damien George
2017-02-21cc3200: Use simplelink API instead of emulated BSD API.Damien George
Most of cc3200 uses explicit simplelink calls anyway, and this means there are no longer any clashes with macros from the C stdlib.
2017-02-16py: Add iter_buf to getiter type method.Damien George
Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
2017-02-06cc3200: Refactor "ticks" functions to use common extmod implementation.Damien George
The port now uses the common mp_utime_ticks_{ms,us,cpu,add,diff} functions from extmod/utime_mphal.c. The mp_utime_sleep_XXX functions are still cc3200-specific because they handle the GIL differently to the ones in extmod. The files misc/mpsystick.[ch] have been removed because they contain 2 unused functions, and the other remaining function is renamed to mp_hal_ticks_us and moved to hal/cc3200_hal.c.
2017-01-30extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h.Damien George
vfs.h is for generic VFS declarations, and vfs_fat.h is for VfsFat specific things.
2017-01-30cc3200: Convert to use new VFS sub-system and new ooFatFs library.Damien George
2017-01-29cc3200/modusocket: Remove deprecated socket.error.Paul Sokolovsky
socket.error is deprecated even in upstream: https://docs.python.org/3/library/socket.html#socket.error, and never was a part of MicroPython socket API.
2017-01-27extmod: Rename vfs_fat_file.h to vfs_fat.h.Damien George
And move declaration of mp_fat_vfs_type to this file.
2017-01-07cc3200/modwlan: Add network.WLAN.print_ver() diagnostic function.Paul Sokolovsky
Prints NWP/MAC/PHY version, as affected by servicepack installed.
2017-01-04all: Consistently update signatures of .make_new and .call methods.Paul Sokolovsky
Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
2016-12-02py/stream: Move ad-hoc ioctl constants to stream.h and rename them.Damien George
The constants MP_IOCTL_POLL_xxx, which were stmhal-specific, are moved from stmhal/pybioctl.h (now deleted) to py/stream.h. And they are renamed to MP_STREAM_POLL_xxx to be consistent with other such constants. All uses of these constants have been updated.
2016-11-15cc3200/mods/pybspi: Remove SPI.MASTER constant, it's no longer needed.Damien George
2016-11-15cc3200/pybspi: Remove static mode=SPI.MASTER parameter for latest HW API.Paul Sokolovsky
Per the latest HW API, "SPI" class implements only master side of the protocol, so mode=SPI.MASTER (which was static for WiPy anyway) is not required (or allowed). This change is required to correspond to updated documentation of machine.SPI class which no longer lists "mode".
2016-11-14all: Remove readall() method, which is equivalent to read() w/o args.Paul Sokolovsky
Its addition was due to an early exploration on how to add CPython-like stream interface. It's clear that it's not needed and just takes up bytes in all ports.
2016-10-18cc3200/mods/pybspi: Allow "write" arg of read/readinto to be positional.Damien George
To conform with Hardware API.
2016-10-18cc3200: Use mp_raise_XXX helper functions to reduce code size.Damien George
Reduces code size by 632 bytes.
2016-10-01cc3200: Add ssl_version argument to ssl.wrap_socket().daniel
This resolves issue #2343.
2016-09-22all: Remove 'name' member from mp_obj_module_t struct.Damien George
One can instead lookup __name__ in the modules dict to get the value.
2016-09-08stmhal,cc3200,esp8266: Consistently use PWRON_RESET constant.Damien George
machine.POWER_ON is renamed to machine.PWRON_RESET to match other reset-cause constants that all end in _RESET. The cc3200 port keeps a legacy definition of POWER_ON for backwards compatibility.
2016-06-18all: Rename mp_obj_type_t::stream_p to protocol.Paul Sokolovsky
It's now used for more than just stream protocol (e.g. pin protocol), so don't use false names.