summaryrefslogtreecommitdiff
path: root/esp8266/esp_mphal.c
AgeCommit message (Collapse)Author
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-06-22esp8266: Move mp_hal_pin_open_drain from esp_mphal.c to machine_pin.c.Damien George
It belongs with the other pin config functions in machine_pin.c. Also, esp_mphal.c is put in iRAM so this change saves about 300 bytes of iRAM (and mp_hal_pin_open_drain is not a time critical function so doesn't need to be in iRAM).
2017-03-20esp8266: Enable micropython.schedule() with locking in pin callback.Damien George
2016-09-29lib/interrupt_char: Factor out typical Ctrl+C handling from esp8266 port.Paul Sokolovsky
Utility functions for keyboard interrupt handling, to be reused across (baremetal) ports.
2016-09-20esp8266: Extend system microsecond counter to 64-bits; use in ticks_ms.Damien George
So now ticks_ms can count up to the full 30 bits. Fixes issue #2412.
2016-09-19esp8266/esp_mphal: Add tentative change to mp_hal_stdin_rx_chr() to wait IRQ.Paul Sokolovsky
Instead of busy-looping waiting for UART input. Not enabled by default, needs more testing.
2016-09-03esp8266/modmachinewdt: Add .deinit() method.Paul Sokolovsky
2016-08-20esp8266/esp_mphal: No longer disable watchdog on startup.Paul Sokolovsky
Disabling it was an omission from early development stages.
2016-07-31esp8266/esp_mphal: Implement libc's errno.Paul Sokolovsky
Using __errno() function, and redirect it to use mp_stream_errno from stream module. This is pre-requisite for integrating with 3rd-party libs, like BerkeleyDB.
2016-07-05esp8266/esp_mphal: Properly handle dupterm EOF after switching to readinto().Paul Sokolovsky
2016-07-04esp8266/esp_mphal: call_dupterm_read: Use readinto() method.Paul Sokolovsky
It's memory fragmentation hazard to allocate 1-char string each time by calling read() method.
2016-05-26extmod/machine_i2c: Redo mp_hal_pin macros to use open_drain and od_low.Damien George
mp_hal_pin_config_od is renamed mp_hal_pin_open_drain, and mp_hal_pin_low is mp_hal_pin_od_low.
2016-05-24esp8266/esp_mphal: mp_uos_dupterm_deactivate() may raise exception.Paul Sokolovsky
So, keep call to it protected via NLR still.
2016-05-24esp8266/esp_mphal: Handle Ctrl+C from dupterm (e.g. WebREPL).Paul Sokolovsky
2016-05-24esp8266/esp_mphal: Fix NLR buffer leak in call_dupterm_read().Paul Sokolovsky
2016-05-20extmod/moduos_dupterm: Dumpterm subsystem is responsible for closing stream.Paul Sokolovsky
Make dupterm subsystem close a term stream object when EOF or error occurs. There's no other party than dupterm itself in a better position to do this, and this is required to properly reclaim stream resources, especially if multiple dupterm sessions may be established (e.g. as networking connections).
2016-05-03esp8266/esp_mphal: Add ets_esf_free_bufs(), etc. functions.Paul Sokolovsky
Returning free number of various WiFi driver packet buffers.
2016-04-22esp8266: Allow GPIO16 to be used as a pin in the uPy pin HAL.Damien George
Now I2C works with GPIO16 as the SCL or SDA pin.
2016-04-22esp8266: Convert mp_hal_pin_obj_t from pin ptr to simple integer.Damien George
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-21esp8266/esp_mphal: Remove mp_hal_feed_watchdog.Damien George
It doesn't do anything and is not needed. ets_loop_iter/ets_event_poll now take care of feeding the WDT.
2016-04-17esp8266/esp_mphal: Protect dupterm_task_handler() from recursive exec.Paul Sokolovsky
2016-04-13esp8266/esp_mphal: call_dupterm_read(): Fix order of deactivating on EOF.Paul Sokolovsky
First deactivate, then print diagnostic message.
2016-04-13esp8266/esp_mphal: Don't swallow exceptions in dupterm's read()/write().Paul Sokolovsky
The idea is that if dupterm object can handle exceptions, it will handle them itself. Otherwise, object state can be compromised and it's better to terminate dupterm session. For example, disconnected socket will keep throwing exceptions and dump messages about that.
2016-04-01esp8266: Support dedicated REPL loop (aka pull-style).Paul Sokolovsky
Event-driven loop (push-style) is still supported and default (controlled by MICROPY_REPL_EVENT_DRIVEN setting, as expected). Dedicated loop worked even without adding ets_loop_iter(), though that needs to be revisited later.
2016-03-31esp8266: Implement input part of dupterm handling.Paul Sokolovsky
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-30esp8266: Switch back to accumulating input data via ring buffer.Paul Sokolovsky
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-29esp8266/esp_mphal: Add support for debug UART-only output.Paul Sokolovsky
Helpful when debugging dupterm support (because otherwise all output is spooled to dupterm too). To use: mp_printf(&mp_debug_print, "...");
2016-03-29esp8266: Add basic support for duplicating REPL output.Paul Sokolovsky
2016-03-23esp8266: Make mp_hal_delay_us work with new event framework.Damien George
2016-03-11esp8266/esp_mphal: Add higher-level event polling function.Paul Sokolovsky
ets_event_poll() polls both system events and uPy pending exception.
2016-03-05esp8266: Support raising KeyboardInterrupt on Ctrl+C.Paul Sokolovsky
2016-03-05esp8266: Add custom _assert() function.Paul Sokolovsky
Enabling standard assert() (by removing -DNDEBUG) produces non-bootable binary (because all messages go to .rodata which silently overflows). So, for once-off debugging, have a custom _assert().
2016-03-04esp8266: Reset "virtual RTC" on power on.Paul Sokolovsky
Initialize RTC period coefficients, etc. if RTC RAM doesn't contain valid values. time.time() then will return number of seconds since power-on, unless set to different timebase. This reuses MEM_MAGIC for the purpose beyond its initial purpose (but the whole modpybrtc.c need to be eventually reworked completely anyway).
2016-03-04esp8266: Add mp_hal_delay_us function.Damien George
2015-10-29esp8266: Switch to standard mp_hal_ticks_ms() MPHAL function.Paul Sokolovsky
2015-10-29esp8266: Switch to standard mp_hal_delay_ms() MPHAL function.Paul Sokolovsky
2015-10-29esp8266: Switch to standard mp_hal_delay_us() MPHAL function.Paul Sokolovsky
2015-05-28esp8266: Enable setting CPU frequency to 160MHzJosef Gajdusek
2015-05-12esp8266: Implement time functionsJosef Gajdusek
2015-02-13stmhal: Make pybstdio usable by other ports, and use it.Damien George
Now all ports can use pybstdio.c to provide sys.stdin/stdout/stderr, so long as they implement mp_hal_stdin_* and mp_hal_stdout_* functions.
2014-11-27esp8266: New port of Micro Python to ESP8266 wifi module.Damien George