constants.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: Apache-2.0
  3. import collections
  4. import multiprocessing
  5. import os
  6. import platform
  7. from typing import Dict, Union
  8. GENERATORS: Dict[str, Union[str, Dict, list]] = collections.OrderedDict([
  9. # - command: build command line
  10. # - version: version command line
  11. # - dry_run: command to run in dry run mode
  12. # - verbose_flag: verbose flag
  13. # - force_progression: one liner status of the progress
  14. ('Ninja', {
  15. 'command': ['ninja'],
  16. 'version': ['ninja', '--version'],
  17. 'dry_run': ['ninja', '-n'],
  18. 'verbose_flag': '-v',
  19. # as opposed to printing the status updates each in a in new line
  20. 'force_progression': True,
  21. }),
  22. ])
  23. if os.name != 'nt':
  24. MAKE_CMD = 'gmake' if platform.system() == 'FreeBSD' else 'make'
  25. GENERATORS['Unix Makefiles'] = {'command': [MAKE_CMD, '-j', str(multiprocessing.cpu_count() + 2)],
  26. 'version': [MAKE_CMD, '--version'],
  27. 'dry_run': [MAKE_CMD, '-n'],
  28. 'verbose_flag': 'VERBOSE=1',
  29. 'force_progression': False}
  30. URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf'
  31. SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2']
  32. PREVIEW_TARGETS = ['linux', 'esp32p4']
  33. OPENOCD_TAGET_CONFIG_DEFAULT = '-f interface/ftdi/esp32_devkitj_v1.cfg -f target/{target}.cfg'
  34. OPENOCD_TAGET_CONFIG: Dict[str, str] = {
  35. 'esp32': '-f board/esp32-wrover-kit-3.3v.cfg',
  36. 'esp32s2': '-f board/esp32s2-kaluga-1.cfg',
  37. 'esp32c3': '-f board/esp32c3-builtin.cfg',
  38. 'esp32s3': '-f board/esp32s3-builtin.cfg',
  39. 'esp32c6': '-f board/esp32c6-builtin.cfg',
  40. 'esp32h2': '-f board/esp32h2-builtin.cfg',
  41. }