Browse Source

extmod/webrepl: Move webrepl scripts to common place and use manifest.

Move webrepl support code from ports/esp8266/modules into extmod/webrepl
(to be alongside extmod/modwebrepl.c), and use frozen manifests to include
it in the build on esp8266 and esp32.

A small modification is made to webrepl.py to make it work on non-ESP
ports, i.e. don't call dupterm_notify if not available.
pull/4016/head
Jim Mussared 5 years ago
committed by Damien George
parent
commit
7ce1e0b1dc
  1. 1
      extmod/webrepl/manifest.py
  2. 5
      extmod/webrepl/webrepl.py
  3. 0
      extmod/webrepl/webrepl_setup.py
  4. 0
      extmod/webrepl/websocket_helper.py
  5. 2
      ports/esp32/boards/manifest.py
  6. 1
      ports/esp8266/boards/manifest.py

1
extmod/webrepl/manifest.py

@ -0,0 +1 @@
freeze('.', ('webrepl.py', 'webrepl_setup.py', 'websocket_helper.py',))

5
ports/esp8266/modules/webrepl.py → extmod/webrepl/webrepl.py

@ -43,8 +43,9 @@ def accept_conn(listen_sock):
ws = uwebsocket.websocket(cl, True)
ws = _webrepl._webrepl(ws)
cl.setblocking(False)
# notify REPL on socket incoming data
cl.setsockopt(socket.SOL_SOCKET, 20, uos.dupterm_notify)
# notify REPL on socket incoming data (ESP32/ESP8266-only)
if hasattr(uos, 'dupterm_notify'):
cl.setsockopt(socket.SOL_SOCKET, 20, uos.dupterm_notify)
uos.dupterm(ws)

0
ports/esp8266/modules/webrepl_setup.py → extmod/webrepl/webrepl_setup.py

0
ports/esp8266/modules/websocket_helper.py → extmod/webrepl/websocket_helper.py

2
ports/esp32/boards/manifest.py

@ -1,6 +1,6 @@
freeze('$(PORT_DIR)/modules')
freeze('$(MPY_DIR)/tools', ('upip.py', 'upip_utarfile.py'))
freeze('$(MPY_DIR)/ports/esp8266/modules', 'ntptime.py')
freeze('$(MPY_DIR)/ports/esp8266/modules', ('webrepl.py', 'webrepl_setup.py', 'websocket_helper.py',))
freeze('$(MPY_DIR)/drivers/dht', 'dht.py')
freeze('$(MPY_DIR)/drivers/onewire')
include('$(MPY_DIR)/extmod/webrepl/manifest.py')

1
ports/esp8266/boards/manifest.py

@ -2,3 +2,4 @@ freeze('$(PORT_DIR)/modules')
freeze('$(MPY_DIR)/tools', ('upip.py', 'upip_utarfile.py'))
freeze('$(MPY_DIR)/drivers/dht', 'dht.py')
freeze('$(MPY_DIR)/drivers/onewire')
include('$(MPY_DIR)/extmod/webrepl/manifest.py')

Loading…
Cancel
Save