diff --git a/Makefile b/Makefile index 843e4e1..a1460f3 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ MPY_TARGETS = $(patsubst $(SRC_DIR)/%.py,$(BUILD_DIR)/%.mpy,$(NON_INIT_PY)) INIT_TARGETS = $(patsubst $(SRC_DIR)/%.py,$(BUILD_DIR)/%.py,$(filter %__init__.py,$(PY_FILES))) .PHONY: all -all: clean toolchain static-checkers unit-test build test-unix deploy publish +all: clean toolchain static-checkers unit-test build test-unix deploy deploy-config tls-cert deploy-cert deploy-example # ================================================ # Build @@ -179,7 +179,7 @@ run-unix: stage-example # ----------------------------- .PHONY: deploy-example deploy-example: - @echo "Uploading boot.py" + @echo "Uploading boot.py, app.py" @mpremote $(DEVICE) soft-reset mpremote $(DEVICE) cp $(EXAMPLE_DIR)/boot.py :boot.py mpremote $(DEVICE) cp $(EXAMPLE_DIR)/app.py :app.py @@ -187,14 +187,15 @@ deploy-example: @echo "Uploading pyrobusta.env" @if [ -f pyrobusta.env ]; then mpremote $(DEVICE) cp pyrobusta.env :pyrobusta.env; fi @mpremote $(DEVICE) reset + @echo "\e[32m$(EXAMPLE_DIR) example is successfully deployed, \n"\ + "run 'make DEVICE=$(DEVICE) run-device' to restart the device and check the output.\e[0m" # ----------------------------- -# Run example directly +# Connect to device through REPL # ----------------------------- .PHONY: run-device run-device: - @mpremote $(DEVICE) soft-reset - mpremote $(DEVICE) run $(EXAMPLE_DIR)/app.py + @mpremote $(DEVICE) reset repl # ================================================ diff --git a/README.md b/README.md index 0a14064..3acb293 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ make build # Cross-compile, create build artifacts make deploy # Upload build artifacts to device using mpremote make tls-cert # Optional: generate self-signed certificate for the device make deploy-cert # Optional: upload generated certificate to the device -make deploy-example # Upload example application using mpremote -make run-device # Run application on the device using mpremote run +make deploy-example # Deploy the selected example app using mpremote +make run-device # Optional: Reset the device and connect through REPL ``` ```deploy-example``` and ```run-device``` uses the DEVICE argument set to ```u0``` (/dev/ttyUSB0) by default, passed to mpremote. diff --git a/assets/www/examples.html b/assets/www/examples.html index 7c6cbef..bce9539 100644 --- a/assets/www/examples.html +++ b/assets/www/examples.html @@ -103,14 +103,14 @@

Simple Server Application

logging.warning(f"loop stopped: {e}") asyncio.get_event_loop().close() -