Commit Graph

5688 Commits

Author SHA1 Message Date
Paul Sokolovsky
c888831410 esp8266/scripts/webrepl: Print connection address.
Based on active network interfaces.
2016-04-26 00:59:30 +03:00
stijn
29c8c8aecb windows/msvc: Rewrite qstr auto-generation.
Builds have been broken since reworking autogeneration in c618f91 and
related, this gets fixed here by applying similar qstr generation logic
for the msvc builds: c files are only preprocessed when changed (or not
yet preprocessed) and the concatenated output is fed into makeqstrdefs.py.
To speed up this process, the concatenated output is already filtered to
contain only lines which makeqstrdefs really needs: this makes the qstr
generation stage about twice as fast (checked on different machines).
2016-04-25 22:34:24 +01:00
stijn
9264d42e2a py/makeqstrdefs.py: Windows compatibility.
- msvc preprocessor output contains full paths with backslashes so the
  ':' and '\' characters needs to be erased from the paths as well
- use a regex for extraction of filenames from preprocessor output so it
  can handle both gcc and msvc preprocessor output, and spaces in paths
  (also thanks to a PR from @travnicekivo for part of that regex)
- os.rename will fail on windows if the destination file already exists,
  so simply attempt to delete that file first
2016-04-25 22:34:22 +01:00
stijn
b2b771ca02 py/makeqstrdefs.py: Remove unused function/variable/import. 2016-04-25 22:34:20 +01:00
Paul Sokolovsky
7a012f4793 extmod/modlwip: Protect recv/accept Python callback against exceptions.
Using usual call_function_*_protected() helper, to avoid NLR jump crashes.
2016-04-25 21:27:55 +03:00
Paul Sokolovsky
bababce6de py/runtime_utils: Fix nanbox build. 2016-04-25 20:03:14 +03:00
Paul Sokolovsky
6d103b6548 py: Move call_function_*_protected() functions to py/ for reuse.
They almost certainly needed by any C code which calls Python callbacks.
2016-04-25 19:31:17 +03:00
Colin Hogben
104aa26271 cc3200, stmhal, teensy: Use pyhelp_print_obj function.
Update the help() implementations in the cc3200, stmhal and teensy
ports to use the pyhelp_print_obj function.
2016-04-25 18:54:59 +03:00
Colin Hogben
2b46da234c lib/utils/pyhelp: Extract implementation of help(obj) to a library function.
Several ports use identical code for the 1-argument form of the builtin
help function.  Move this code to a library function to allow easier
re-use by ports.
2016-04-25 18:54:09 +03:00
Paul Sokolovsky
4296a8dc5c esp8266/scripts/webrepl: Allow to override port. 2016-04-25 18:44:37 +03:00
Paul Sokolovsky
bd66b09512 esp8266/scripts/webrepl: Don't start on import.
Explicit .start() is required now.
2016-04-25 00:33:27 +03:00
Paul Sokolovsky
8db4f363e9 esp8266/scripts/webrepl: Convert to persistent daemon. 2016-04-25 00:31:43 +03:00
Paul Sokolovsky
7c40b15a3f esp8266/scripts/webrepl: WebREPL based on C-level websocket object. 2016-04-24 23:04:21 +03:00
Paul Sokolovsky
0d10e5310a docs/usocket: Describe address format once at the beginning.
Different ports may have different formats.
2016-04-23 00:31:05 +03:00
Paul Sokolovsky
92497bff94 docs/usocket: socket.IPPROTO_SEC is WiPy-specific. 2016-04-23 00:17:34 +03:00
Paul Sokolovsky
955b8526f4 docs/usocket: Socket-specific exceptions are for WiPy only. 2016-04-23 00:17:09 +03:00
Paul Sokolovsky
71c6f93016 docs/library/usocket: Add link to CPython's socket module. 2016-04-23 00:08:43 +03:00
Paul Sokolovsky
bbe5245028 docs: esp8266: Include usocket module reference. 2016-04-23 00:08:11 +03:00
Paul Sokolovsky
3bc9b571bb docs/ustruct: There's no complete "struct" module, only "ustruct" subset.
"ustruct" is good example of micro-ified module, so rather should belong
to the corresponding list.
2016-04-22 22:37:14 +03:00
Paul Sokolovsky
5c8147528e docs/esp8266/tutorial: Add tutorial placeholder page. 2016-04-22 22:37:02 +03:00
Paul Sokolovsky
d422e56631 esp8266/scripts/websocket_helper: Disable debug output. 2016-04-22 18:19:54 +03:00
Paul Sokolovsky
eb40769613 esp8266/scripts/websocket_helper: Module encapsulating handshake sequences. 2016-04-22 18:18:27 +03:00
Damien George
51dca54cd0 py/mkrules.mk: Remove obsolete rules for auto qstr generation. 2016-04-22 11:36:19 +01:00
Damien George
b372156f74 esp8266: Change software SPI driver to use general pin HAL. 2016-04-22 10:44:06 +01:00
Damien George
67a6d31955 esp8266: Allow GPIO16 to be used as a pin in the uPy pin HAL.
Now I2C works with GPIO16 as the SCL or SDA pin.
2016-04-22 10:35:26 +01:00
Damien George
a2d5d84ecc esp8266: Convert mp_hal_pin_obj_t from pin ptr to simple integer.
Most pin I/O can be done just knowing the pin number as a simple
integer, and it's more efficient this way (code size, speed) because it
doesn't require a memory lookup to get the pin id from the pin object.

If the full pin object is needed then it can be easily looked up in the
pin table.
2016-04-22 10:04:12 +01:00
Damien George
624738ca64 extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr. 2016-04-22 09:56:02 +01:00
Damien George
109990fc32 py/mkenv.mk: Remove -s and -S args from PYTHON variable.
Qstr auto-generation is now much faster so this optimisation for start-up
time is no longer needed.  And passing "-s -S" breaks some things, like
stmhal's "make deploy".
2016-04-21 22:25:35 +01:00
Damien George
fea40ad468 py: Fix bug passing a string as a keyword arg in a dict.
Addresses issue #1998.
2016-04-21 16:51:36 +01:00
Damien George
d4f4cb6a24 esp8266/esp_mphal: Remove mp_hal_feed_watchdog.
It doesn't do anything and is not needed.  ets_loop_iter/ets_event_poll
now take care of feeding the WDT.
2016-04-21 15:30:29 +01:00
Damien George
c4e26dd19a esp8266/uart: Remove obsolete UART rx buffering code.
It's now completely replaced by the ringbuf implementation.
2016-04-21 15:27:18 +01:00
Damien George
d46bea9ffa esp8266: Implement UART.read functionality. 2016-04-21 15:19:19 +01:00
Damien George
7652ab77ef esp8266: Add uart_rx_wait and uart_rx_char functions. 2016-04-21 15:19:00 +01:00
Tobias Badertscher
495da15611 stmhal: L4: Add support for external interrupts/events.
The L4 MCU supports 40 Events/IRQs lines of the type configurable and
direct.  But this L4 port only supports configurable line types which are
already supported by uPy.  For details see page 330 of RM0351, Rev 1.

The USB_FS_WAKUP event is a direct type and there is no support for it.
2016-04-21 13:11:37 +01:00
Tobias Badertscher
067fb2da14 stmhal: L4: Modify flash.c and storage.c to support L4 MCU.
The way to lookup the flash sector now uses a much simpler table for
all MCUs.
2016-04-21 13:03:38 +01:00
Tobias Badertscher
dda1a41205 stmhal: L4: Modify mphalport to support L4 MCU.
__GPIOI_CLK_ENABLE is defined in hal/l4/inc/Legacy/stm32_hal_legacy.h
as __HAL_RCC_GPIOI_CLK_ENABLE, and that latter macro is not defined
anywhere else (because the L4 does not have port GPIOI).  So the test
for GPIOI is needed, along with the test for the CLK_ENABLE macro.
2016-04-21 12:23:28 +01:00
Damien George
36d328e451 ACKNOWLEDGEMENTS: Add list of 842 backers from the ESP8266 campaign. 2016-04-21 12:18:28 +01:00
Damien George
fcc9d43c6d docs/esp8266: Add info about using deep-sleep mode to quickref. 2016-04-21 12:01:50 +01:00
Damien George
32d7cf6e44 esp8266: Implement basic deep-sleep capabilities.
Use the machine.deepsleep() function to enter the sleep mode.  Use the
RTC to configure the alarm to wake the device.

Basic use is the following:

    import machine

    # configure RTC's ALARM0 to wake device from deep sleep
    rtc = machine.RTC()
    rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)

    # do other things
    # ...

    # set ALARM0's alarm to wake after 10 seconds
    rtc.alarm(rtc.ALARM0, 10000)

    # enter deep-sleep state (system is reset upon waking)
    machine.deepsleep()

To detect if the system woke from a deep sleep use:

    if machine.reset_cause() == machine.DEEPSLEEP_RESET:
        print('woke from deep sleep')
2016-04-21 11:43:37 +01:00
Paul Sokolovsky
2a51f72ed1 docs/esp8266/general: Start "General information" for esp8266. 2016-04-21 01:03:51 +03:00
Paul Sokolovsky
f73d78394b docs/topindex.html: esp8266: Enable quickref/general on the main page. 2016-04-21 01:03:27 +03:00
Paul Sokolovsky
4fa1731b6e esp8266/modnetwork: .config(): Add "hidden ESSID" param. 2016-04-21 00:42:45 +03:00
Paul Sokolovsky
cc1ef76f88 esp8266/scripts/flashbdev: Correct bootloader flash size to match real size.
Flash size as seen by vendor SDK doesn't depend on real size, but rather on
a particular value in firmware header, as put there by flash tool. That means
it's user responsibility to know what flash size a particular device has, and
specify correct parameters during flashing. That's not end user friendly
however, so we try to make it "flash and play" by detecting real size vs
from-header size mismatch, and correct the header accordingly.
2016-04-20 18:07:34 +03:00
Paul Sokolovsky
584406880c esp8266/scripts/_boot: Print notice when initial setup is executed. 2016-04-20 18:01:09 +03:00
Paul Sokolovsky
2494399a42 esp8266/scripts/flashbdev: Disable debug output/checks. 2016-04-20 00:35:46 +03:00
Paul Sokolovsky
46f0641fba esp8266/modnetwork: .config(): Add "channel" param. 2016-04-20 00:25:31 +03:00
Paul Sokolovsky
1b60a6dc4e py: Divide "split" and "cat" phases of qstr extraction for better efficiency.
E.g. for stmhal, accumulated preprocessed output may grow large due to
bloated vendor headers, and then reprocessing tens of megabytes on each
build make take couple of seconds on fast hardware (=> potentially dozens
of seconds on slow hardware). So instead, split once after each change,
and only cat repetitively (guaranteed to be fast, as there're thousands
of lines involved at most).
2016-04-19 14:39:08 +03:00
Paul Sokolovsky
8dd704b019 py/makeqstrdefs.py: Process only CPP line-numbering info.
Not stuff like "#pragma", etc.
2016-04-19 12:52:57 +03:00
Paul Sokolovsky
4494b521ea py/mkrules.mk: Fix Bashism. 2016-04-19 12:32:23 +03:00
Paul Sokolovsky
21ab304c41 py/mkrules.mk: Cleanup command passed to shell. 2016-04-19 12:28:30 +03:00