forked from OpenMYR/IoT_Motors
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSConscript
20 lines (15 loc) · 1.31 KB
/
SConscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Import('base_env')
# This is a bit of a hack. We couldn't get variant_dir working with the way
# SCons manages dependencies and get the firmware in the bin folder,
# so we just hardcoded the bin folder into the commands
base_env.Command(['bin/stepper_driver-0x00000.bin', 'bin/stepper_driver-0x40000.bin'], 'out/stepper_driver', 'esptool.py elf2image $SOURCE --output build/bin/stepper_driver-')
base_env.Command(['bin/quad_servo_driver-0x00000.bin', 'bin/quad_servo_driver-0x40000.bin'], 'out/quad_servo_driver', 'esptool.py elf2image $SOURCE --output build/bin/quad_servo_driver-')
base_env.Alias('quad', 'bin/quad_servo_driver-0x00000.bin')
base_env.Alias('stepper', 'bin/stepper_driver-0x00000.bin')
base_env.Alias('flash-quad', base_env.Command(None, ['bin/quad_servo_driver-0x00000.bin', 'bin/quad_servo_driver-0x40000.bin'], 'esptool.py --port /dev/ttyAMA0 write_flash 0x00000 build/bin/quad_servo_driver-0x00000.bin 0x40000 build/bin/quad_servo_driver-0x40000.bin'))
base_env.Alias('flash-stepper', base_env.Command(None, ['bin/stepper_driver-0x00000.bin', 'bin/stepper_driver-0x40000.bin'], 'esptool.py --port /dev/ttyAMA0 write_flash 0x00000 build/bin/stepper_driver-0x00000.bin 0x40000 build/bin/stepper_driver-0x40000.bin'))
Clean('.', 'bin')
Clean('.', 'out')
Default('quad', 'stepper')
if GetOption("clean"):
Default('.')