@@ -13,28 +13,30 @@ function build_micropython_red_vision {
1313 # Install necessary python packages (could also move this to a requirements.txt file)
1414 pip install freezefs
1515
16- # Clone the Red Vision submodule
17- git submodule update --init --recursive micropython/lib/red_vision
18-
1916 # Set Pico SDK path to $GITHUB_WORKSPACE/micropython/lib/pico-sdk if $GITHUB_WORKSPACE is set, otherwise use the current directory
2017 if [ -n " $GITHUB_WORKSPACE " ]; then
2118 export PICO_SDK_PATH=" $GITHUB_WORKSPACE /micropython/lib/pico-sdk"
19+ # Ensure we're in the micropython directory
20+ cd micropython
2221 else
23- export PICO_SDK_PATH=$( dirname " $0 " ) /micropython/ lib/pico-sdk
22+ export PICO_SDK_PATH=$( dirname " $0 " ) /lib/pico-sdk
2423 fi
2524
25+ # Clone the Red Vision submodule
26+ git submodule update --init --recursive lib/red_vision
27+
2628 # Build MPY Cross compiler
27- make -C micropython/ mpy-cross ${MAKEOPTS}
29+ make -C mpy-cross ${MAKEOPTS}
2830
2931 # Update necessary MicroPython submodules
30- make -C micropython/ ports/rp2 BOARD=SPARKFUN_XRP_CONTROLLER submodules
32+ make -C ports/rp2 BOARD=SPARKFUN_XRP_CONTROLLER submodules
3133
3234 # Build OpenCV
33- make -C micropython/ lib/red_vision/micropython-opencv PLATFORM=rp2350 --no-print-directory ${MAKEOPTS}
35+ make -C lib/red_vision/micropython-opencv PLATFORM=rp2350 --no-print-directory ${MAKEOPTS}
3436
3537 # Build firmware
36- make -C micropython/ lib/red_vision PORT_DIR=micropython/ports/rp2 BOARD=SPARKFUN_XRP_CONTROLLER ${MAKEOPTS}
38+ make -C lib/red_vision PORT_DIR=~ / micropython/ports/rp2 BOARD=SPARKFUN_XRP_CONTROLLER --no-print-directory ${MAKEOPTS}
3739
3840 # Rename firmware file to identify it as the Red Vision build and which board it's for
39- mv micropython/ ports/rp2/build-SPARKFUN_XRP_CONTROLLER-RED_VISION/firmware.uf2 micropython/ ports/rp2/build-SPARKFUN_XRP_CONTROLLER-RED_VISION/RED_VISION_MICROPYTHON_SPARKFUN_XRP_CONTROLLER.uf2
41+ mv ports/rp2/build-SPARKFUN_XRP_CONTROLLER-RED_VISION/firmware.uf2 ports/rp2/build-SPARKFUN_XRP_CONTROLLER-RED_VISION/RED_VISION_MICROPYTHON_SPARKFUN_XRP_CONTROLLER.uf2
4042}
0 commit comments