Index

auto-plow / dev

A wheelchair motor-propelled battery-powered ESP32-driven remote control snow plow.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
8514 Jan 2023 16:171b2c8f0Update PPM interrupt handler to not use RTOS queues, write data directlyJosh Stockin152G

Blob @ auto-plow / build.xsh

text/plain858 bytesdownload raw
1#!/usr/bin/env xonsh
2
3import os
4
5SCRIPT_SOURCE_DIR = os.path.realpath(os.path.dirname(__file__))
6cd @(SCRIPT_SOURCE_DIR)
7ARGS = "".join($ARGS).lower()
8
9if not $(which idf.py):
10 if os.path.exists(f"{os.path.expanduser('~')}/esp/esp-idf/export.sh"):
11 print("Running esp-idf/export.sh")
12 source-bash $HOME/esp/esp-idf/export.sh
13 $PATH=$PATH
14 else:
15 print("idf.py not found")
16 os.exit(1)
17else:
18 print("idf.py already on path")
19
20mkdir -p @(SCRIPT_SOURCE_DIR)/build
21
22if "b" in ARGS:
23
24 cd @(SCRIPT_SOURCE_DIR)/build
25
26 if "d" in ARGS:
27 print("building in DEV_MODE")
28 cmake .. -G Ninja -DDEV_MODE=1
29 else:
30 print("building")
31 cmake .. -G Ninja
32
33 ninja
34
35 cd @(SCRIPT_SOURCE_DIR)
36
37if "f" in ARGS:
38 idf.py flash -p /dev/ttyUSB0
39
40if "m" in ARGS:
41 idf.py monitor -p /dev/ttyUSB0
42