main.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # WizIO 2021 Georgi Angelov
  2. # http://www.wizio.eu/
  3. # https://github.com/Wiz-IO/wizio-pico
  4. from __future__ import print_function
  5. from os.path import join
  6. from SCons.Script import (AlwaysBuild, Builder, COMMAND_LINE_TARGETS, Default, DefaultEnvironment)
  7. from colorama import Fore
  8. from wpioasm import dev_pioasm # https://github.com/Wiz-IO/wizio-pico/issues/98#issuecomment-1128747885
  9. env = DefaultEnvironment()
  10. print( '<<<<<<<<<<<< ' + env.BoardConfig().get("name").upper() + " 2021 Georgi Angelov >>>>>>>>>>>>" )
  11. dev_pioasm(env)
  12. elf = env.BuildProgram()
  13. src = env.ElfToBin( join("$BUILD_DIR", "${PROGNAME}"), elf )
  14. prg = env.Alias( "buildprog", src, [ env.VerboseAction("", "DONE") ] )
  15. AlwaysBuild( prg )
  16. upload = env.Alias("upload", prg, [
  17. env.VerboseAction("$UPLOADCMD", "Uploading..."),
  18. env.VerboseAction("", ""),
  19. ])
  20. AlwaysBuild( upload )
  21. debug_tool = env.GetProjectOption("debug_tool")
  22. if None == debug_tool:
  23. Default( prg )
  24. else:
  25. if 'cmsis-dap' in debug_tool:
  26. Default( upload )
  27. else:
  28. Default( prg )