arduino-RP2040.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. # WizIO 2022 Georgi Angelov
  2. # http://www.wizio.eu/
  3. # https://github.com/Wiz-IO/wizio-pico
  4. from os.path import join
  5. from SCons.Script import DefaultEnvironment, Builder
  6. from common import *
  7. def dev_init(env, platform):
  8. env.platform = platform
  9. env.framework_dir = env.PioPlatform().get_package_dir("framework-wizio-pico")
  10. env.libs = []
  11. dev_compiler(env, 'ARDUINO')
  12. dev_create_template(env)
  13. core = env.BoardConfig().get("build.core")
  14. variant= env.BoardConfig().get("build.variant")
  15. PLATFORM_DIR = join( env.framework_dir, platform )
  16. env.Append(
  17. CPPDEFINES = [ "ARDUINO=200" ],
  18. CPPPATH = [
  19. join(PLATFORM_DIR, platform),
  20. join(PLATFORM_DIR, "cores", core),
  21. join(PLATFORM_DIR, "variants", variant),
  22. ],
  23. LIBSOURCE_DIRS = [ join(PLATFORM_DIR, "libraries", core) ],
  24. LIBPATH = [ join(PLATFORM_DIR, "libraries", core) ],
  25. )
  26. dev_config_board(env)
  27. OBJ_DIR = join( "$BUILD_DIR", platform, "arduino" )
  28. env.BuildSources( join( OBJ_DIR, "arduino" ), join( PLATFORM_DIR, platform ) )
  29. env.BuildSources( join( OBJ_DIR, "core" ), join( PLATFORM_DIR, "cores", core ) )
  30. env.BuildSources( join( OBJ_DIR, "variant" ), join( PLATFORM_DIR, "variants", variant ) )
  31. dev_finalize(env)