2024-02-25 22:29:46 -05:00
|
|
|
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
2022-05-23 09:30:13 -04:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2020-03-02 10:07:49 -05:00
|
|
|
import collections
|
2019-10-03 12:26:44 -04:00
|
|
|
import multiprocessing
|
|
|
|
import os
|
|
|
|
import platform
|
2024-02-25 22:29:46 -05:00
|
|
|
from typing import Dict
|
|
|
|
from typing import Union
|
2019-10-03 12:26:44 -04:00
|
|
|
|
2021-12-08 12:29:14 -05:00
|
|
|
GENERATORS: Dict[str, Union[str, Dict, list]] = collections.OrderedDict([
|
2019-11-08 10:46:02 -05:00
|
|
|
# - command: build command line
|
|
|
|
# - version: version command line
|
|
|
|
# - dry_run: command to run in dry run mode
|
|
|
|
# - verbose_flag: verbose flag
|
2021-12-08 12:29:14 -05:00
|
|
|
# - force_progression: one liner status of the progress
|
2021-01-25 21:49:01 -05:00
|
|
|
('Ninja', {
|
|
|
|
'command': ['ninja'],
|
|
|
|
'version': ['ninja', '--version'],
|
|
|
|
'dry_run': ['ninja', '-n'],
|
2021-12-08 12:29:14 -05:00
|
|
|
'verbose_flag': '-v',
|
|
|
|
# as opposed to printing the status updates each in a in new line
|
|
|
|
'force_progression': True,
|
2020-03-02 10:07:49 -05:00
|
|
|
}),
|
|
|
|
])
|
2019-10-03 12:26:44 -04:00
|
|
|
|
2021-11-09 07:10:56 -05:00
|
|
|
if os.name != 'nt':
|
|
|
|
MAKE_CMD = 'gmake' if platform.system() == 'FreeBSD' else 'make'
|
|
|
|
GENERATORS['Unix Makefiles'] = {'command': [MAKE_CMD, '-j', str(multiprocessing.cpu_count() + 2)],
|
|
|
|
'version': [MAKE_CMD, '--version'],
|
|
|
|
'dry_run': [MAKE_CMD, '-n'],
|
2021-12-08 12:29:14 -05:00
|
|
|
'verbose_flag': 'VERBOSE=1',
|
2022-08-01 14:24:02 -04:00
|
|
|
'force_progression': False}
|
2021-11-09 07:10:56 -05:00
|
|
|
|
2021-06-03 11:14:38 -04:00
|
|
|
URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf'
|
2020-01-15 08:50:19 -05:00
|
|
|
|
2023-03-21 15:41:44 -04:00
|
|
|
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2']
|
2024-02-25 22:29:46 -05:00
|
|
|
PREVIEW_TARGETS = ['linux', 'esp32p4', 'esp32c5', 'esp32c61']
|
2022-09-07 16:45:04 -04:00
|
|
|
|
|
|
|
OPENOCD_TAGET_CONFIG_DEFAULT = '-f interface/ftdi/esp32_devkitj_v1.cfg -f target/{target}.cfg'
|
|
|
|
OPENOCD_TAGET_CONFIG: Dict[str, str] = {
|
|
|
|
'esp32': '-f board/esp32-wrover-kit-3.3v.cfg',
|
|
|
|
'esp32s2': '-f board/esp32s2-kaluga-1.cfg',
|
|
|
|
'esp32c3': '-f board/esp32c3-builtin.cfg',
|
|
|
|
'esp32s3': '-f board/esp32s3-builtin.cfg',
|
2023-01-12 01:31:46 -05:00
|
|
|
'esp32c6': '-f board/esp32c6-builtin.cfg',
|
2023-11-09 04:18:39 -05:00
|
|
|
'esp32c5': '-f board/esp32c5-builtin.cfg',
|
2023-02-02 10:11:18 -05:00
|
|
|
'esp32h2': '-f board/esp32h2-builtin.cfg',
|
2022-09-07 16:45:04 -04:00
|
|
|
}
|