Pavol Rusnak
3d4a535208
unix: implement -i option (inspect - start REPL after script is finished)
2016-04-01 12:35:45 +03:00
Paul Sokolovsky
5531437941
esp8266: Move PHY mode constants from modesp to modnetwork.
2016-04-01 12:10:11 +03:00
Damien George
4b597a1c1a
esp8266: Reset term_obj on reboot.
...
Also, term_obj can be NULL if socket enables REPL duplication signalling
before os.dupterm is called, so it should be checked.
2016-03-31 19:56:52 +03:00
Paul Sokolovsky
98af891610
esp8266: Implement input part of dupterm handling.
...
The idea is following: underlying interrupt-driven or push-style data source
signals that more data is available for dupterm processing via call to
mp_hal_signal_dupterm_input(). This triggers a task which pumps data between
actual dupterm object (which may perform additional processing on data from
low-level data source) and input ring buffer.
2016-03-31 19:49:55 +03:00
Paul Sokolovsky
61fa7c8152
esp8266: Switch back to accumulating input data via ring buffer.
...
But now it's generic ring buffer implemented via ringbuf.h, and is intended
for any type of input, including dupterm's, not just UART. The general
process work like this: an interrupt-driven input source puts data into
input_buf, and then signals new data available via call to
mp_hal_signal_input().
2016-03-30 18:50:38 +03:00
Paul Sokolovsky
2e75a17bab
esp8266: Fix issue when current repl line was garbage-collected.
...
Reference it from root pointers section.
2016-03-30 18:13:03 +03:00
Paul Sokolovsky
b1dfdaf6cb
py/ringbuf.h: Add reusable ring buffer class.
...
Features inline get/put operations for the highest performance. Locking
is not part of implementation, operation should be wrapped with locking
externally as needed.
2016-03-30 14:48:31 +03:00
Paul Sokolovsky
f50d9477c1
docs: network: esp8266: .scan() is now synchronous and returns result list.
2016-03-30 11:56:20 +03:00
Paul Sokolovsky
d7019d0628
docs: network: esp8266: status is WLAN object method.
2016-03-30 11:53:45 +03:00
Damien George
9475cc59e6
esp8266: Support synchronous wifi scanning.
...
That is: aps = if0.scan()
TODO: make sure that returned list has tuple with values in "standard"
order (whatever that standard is).
2016-03-30 11:35:03 +03:00
Damien George
2599672384
py/parsenum: Use pow function to apply exponent to decimal number.
...
Pow is already a dependency when compiling with floats, so may as well
use it here to reduce code size and speed up the conversion for most
cases.
2016-03-29 22:12:07 +01:00
Damien George
e1e7657277
py/formatfloat: Fix further cases of buffer overflow in formatting.
...
Includes extensive test cases to catch hopefully all cases where
buffer might overflow.
2016-03-29 22:07:15 +01:00
Damien George
03b8bb7ec9
py/formatfloat: Fix case of float format where leading digit was "10".
...
When taking the logarithm of the float to determine the exponent, there
are some edge cases that finish the log loop too large. Eg for an
input value of 1e32-epsilon, this is actually less than 1e32 from the
log-loop table and finishes as 10.0e31 when it should be 1.0e32. It
is thus rendered as :e32 (: comes after 9 in ascii).
There was the same problem with numbers less than 1.
2016-03-29 22:03:13 +01:00
Paul Sokolovsky
d88250c06e
esp8266: Reduce heap size for now to avoid random segfaults on WiFi connect.
2016-03-29 21:14:41 +03:00
Paul Sokolovsky
c4506ed869
esp8266: Let esp8266 "os" messages go to standard (REPL) UART.
...
That's definitely helpful for debugging.
2016-03-29 21:10:10 +03:00
Paul Sokolovsky
402a743821
esp8266/esp_mphal: Add support for debug UART-only output.
...
Helpful when debugging dupterm support (because otherwise all output is
spooled to dupterm too).
To use:
mp_printf(&mp_debug_print, "...");
2016-03-29 11:48:43 +03:00
Paul Sokolovsky
8fc5e56a6a
esp8266: Enable uos.dupterm() method.
2016-03-29 11:41:23 +03:00
Paul Sokolovsky
c961889e34
esp8266: Add basic support for duplicating REPL output.
2016-03-29 11:13:32 +03:00
Damien George
6ca17c1922
esp8266: Implement os.urandom function.
...
Uses what is suspected to be a hardware random number generator.
2016-03-29 10:29:57 +03:00
Paul Sokolovsky
b4070ee8a4
esp8266: Allow to build without FatFs support again.
2016-03-28 21:35:41 +03:00
Paul Sokolovsky
2f02302e22
esp8266: Support importing modules from filesystem.
2016-03-28 18:39:34 +03:00
danicampora
193795398d
docs: Correct pin interrupt example code for the WiPy.
2016-03-28 13:12:58 +02:00
Damien George
71d40f132d
esp8266: Zero out fs_user_mount state on (soft) reset.
...
Otherwise device stays mounted on soft reset and leads to corruption
(since block device object is now gone).
2016-03-28 13:28:41 +03:00
Paul Sokolovsky
9edd736ee6
esp8266/moduos: Add os.remove(), proxying to VFS object.
2016-03-28 12:50:07 +03:00
Paul Sokolovsky
e8e116e7fc
esp8266/moduos: Factor out VFS method proxy helper.
2016-03-28 12:44:36 +03:00