Skip to content

Commit

Permalink
extmod/webrepl: Move webrepl scripts to common place and use manifest.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jimmo authored and pfalcon committed Jul 3, 2020
1 parent ba00ce7 commit fff03b9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions extmod/webrepl/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
freeze('.', ('webrepl.py', 'webrepl_setup.py', 'websocket_helper.py',))
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ports/esp32/boards/manifest.py
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions ports/esp8266/boards/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
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')

0 comments on commit fff03b9

Please sign in to comment.