forked from xiaozhi/xiaozhi-esp32
add config.json to boards for auto building
This commit is contained in:
@@ -104,6 +104,18 @@ choice BOARD_TYPE
|
||||
bool "无名科技星智1.54"
|
||||
endchoice
|
||||
|
||||
choice DISPLAY_OLED_TYPE
|
||||
depends on BOARD_TYPE_BREAD_COMPACT_WIFI || BOARD_TYPE_BREAD_COMPACT_ML307 || BOARD_TYPE_BREAD_COMPACT_ESP32
|
||||
prompt "OLED Type"
|
||||
default OLED_SSD1306_128X32
|
||||
help
|
||||
OLED 屏幕类型选择
|
||||
config OLED_SSD1306_128X32
|
||||
bool "SSD1306, 分辨率128*32"
|
||||
config OLED_SSD1306_128X64
|
||||
bool "SSD1306, 分辨率128*64"
|
||||
endchoice
|
||||
|
||||
choice DISPLAY_LCD_TYPE
|
||||
depends on BOARD_TYPE_BREAD_COMPACT_WIFI_LCD
|
||||
prompt "LCD Type"
|
||||
|
||||
9
main/boards/atk-dnesp32s3-box/config.json
Normal file
9
main/boards/atk-dnesp32s3-box/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "atk-dnesp32s3-box",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/atk-dnesp32s3/config.json
Normal file
9
main/boards/atk-dnesp32s3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "atk-dnesp32s3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
12
main/boards/atommatrix-echo-base/config.json
Normal file
12
main/boards/atommatrix-echo-base/config.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"target": "esp32",
|
||||
"builds": [
|
||||
{
|
||||
"name": "atommatrix-echo-base",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_4M.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
14
main/boards/atoms3-echo-base/config.json
Normal file
14
main/boards/atoms3-echo-base/config.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "atoms3-echo-base",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_SPIRAM=n",
|
||||
"CONFIG_USE_AUDIO_PROCESSING=n",
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_8M.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
12
main/boards/atoms3r-echo-base/config.json
Normal file
12
main/boards/atoms3r-echo-base/config.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "atoms3r-echo-base",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_8M.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -36,7 +36,15 @@
|
||||
#define DISPLAY_SDA_PIN GPIO_NUM_4
|
||||
#define DISPLAY_SCL_PIN GPIO_NUM_15
|
||||
#define DISPLAY_WIDTH 128
|
||||
|
||||
#if CONFIG_OLED_SSD1306_128X32
|
||||
#define DISPLAY_HEIGHT 32
|
||||
#elif CONFIG_OLED_SSD1306_128X64
|
||||
#define DISPLAY_HEIGHT 64
|
||||
#else
|
||||
#error "未选择 OLED 屏幕类型"
|
||||
#endif
|
||||
|
||||
#define DISPLAY_MIRROR_X true
|
||||
#define DISPLAY_MIRROR_Y true
|
||||
|
||||
|
||||
21
main/boards/bread-compact-esp32/config.json
Normal file
21
main/boards/bread-compact-esp32/config.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"target": "esp32",
|
||||
"builds": [
|
||||
{
|
||||
"name": "bread-compact-esp32",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_4M.csv\"",
|
||||
"CONFIG_OLED_SSD1306_128X64=y"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bread-compact-esp32-128x32",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_4M.csv\"",
|
||||
"CONFIG_OLED_SSD1306_128X32=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -36,7 +36,15 @@
|
||||
#define DISPLAY_SDA_PIN GPIO_NUM_41
|
||||
#define DISPLAY_SCL_PIN GPIO_NUM_42
|
||||
#define DISPLAY_WIDTH 128
|
||||
|
||||
#if CONFIG_OLED_SSD1306_128X32
|
||||
#define DISPLAY_HEIGHT 32
|
||||
#elif CONFIG_OLED_SSD1306_128X64
|
||||
#define DISPLAY_HEIGHT 64
|
||||
#else
|
||||
#error "未选择 OLED 屏幕类型"
|
||||
#endif
|
||||
|
||||
#define DISPLAY_MIRROR_X true
|
||||
#define DISPLAY_MIRROR_Y true
|
||||
|
||||
|
||||
17
main/boards/bread-compact-ml307/config.json
Normal file
17
main/boards/bread-compact-ml307/config.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "bread-compact-ml307",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_OLED_SSD1306_128X32=y"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bread-compact-ml307-128x64",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_OLED_SSD1306_128X64=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -37,7 +37,15 @@
|
||||
#define DISPLAY_SDA_PIN GPIO_NUM_41
|
||||
#define DISPLAY_SCL_PIN GPIO_NUM_42
|
||||
#define DISPLAY_WIDTH 128
|
||||
|
||||
#if CONFIG_OLED_SSD1306_128X32
|
||||
#define DISPLAY_HEIGHT 32
|
||||
#elif CONFIG_OLED_SSD1306_128X64
|
||||
#define DISPLAY_HEIGHT 64
|
||||
#else
|
||||
#error "未选择 OLED 屏幕类型"
|
||||
#endif
|
||||
|
||||
#define DISPLAY_MIRROR_X true
|
||||
#define DISPLAY_MIRROR_Y true
|
||||
|
||||
|
||||
17
main/boards/bread-compact-wifi/config.json
Normal file
17
main/boards/bread-compact-wifi/config.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "bread-compact-wifi",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_OLED_SSD1306_128X32=y"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bread-compact-wifi-128x64",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_OLED_SSD1306_128X64=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/du-chatx/config.json
Normal file
9
main/boards/du-chatx/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "du-chatx",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/esp-box-3/config.json
Normal file
9
main/boards/esp-box-3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp-box-3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/esp-sparkbot/config.json
Normal file
9
main/boards/esp-sparkbot/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp-sparkbot",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/esp32-s3-touch-amoled-1.8/config.json
Normal file
9
main/boards/esp32-s3-touch-amoled-1.8/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp32-s3-touch-amoled-1.8",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/esp32-s3-touch-lcd-1.46/config.json
Normal file
9
main/boards/esp32-s3-touch-lcd-1.46/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp32-s3-touch-lcd-1.46",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/esp32-s3-touch-lcd-1.85/config.json
Normal file
9
main/boards/esp32-s3-touch-lcd-1.85/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp32-s3-touch-lcd-1.85",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/esp32-s3-touch-lcd-1.85c/config.json
Normal file
9
main/boards/esp32-s3-touch-lcd-1.85c/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp32-s3-touch-lcd-1.85c",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/esp32s3-korvo2-v3/config.json
Normal file
9
main/boards/esp32s3-korvo2-v3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "esp32s3-korvo2-v3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/kevin-box-1/config.json
Normal file
9
main/boards/kevin-box-1/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "kevin-box-1",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/kevin-box-2/config.json
Normal file
9
main/boards/kevin-box-2/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "kevin-box-2",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/kevin-c3/config.json
Normal file
9
main/boards/kevin-c3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32c3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "kevin-c3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
12
main/boards/lichuang-c3-dev/config.json
Normal file
12
main/boards/lichuang-c3-dev/config.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"target": "esp32c3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "lichuang-c3-dev",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_8M.csv\""
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/lichuang-dev/config.json
Normal file
9
main/boards/lichuang-dev/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "lichuang-dev",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/lilygo-t-circle-s3/config.json
Normal file
9
main/boards/lilygo-t-circle-s3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "lilygo-t-circle-s3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
11
main/boards/m5stack-core-s3/config.json
Normal file
11
main/boards/m5stack-core-s3/config.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "m5stack-core-s3",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_SPIRAM_MODE_QUAD=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/magiclick-2p4/config.json
Normal file
9
main/boards/magiclick-2p4/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "magiclick-2p4",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/magiclick-c3/config.json
Normal file
9
main/boards/magiclick-c3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32c3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "magiclick-c3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/movecall-moji-esp32s3/config.json
Normal file
9
main/boards/movecall-moji-esp32s3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "movecall-moji-esp32s3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/taiji-pi-s3/config.json
Normal file
9
main/boards/taiji-pi-s3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "taiji-pi-s3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/xingzhi-cube-oled/config.json
Normal file
9
main/boards/xingzhi-cube-oled/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "xingzhi-cube-oled",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/xingzhi-cube-tft/config.json
Normal file
9
main/boards/xingzhi-cube-tft/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32s3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "xingzhi-cube-tft",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
9
main/boards/xmini-c3/config.json
Normal file
9
main/boards/xmini-c3/config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"target": "esp32c3",
|
||||
"builds": [
|
||||
{
|
||||
"name": "xmini-c3",
|
||||
"sdkconfig_append": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -41,10 +41,85 @@ def zip_bin(board_type, project_version):
|
||||
print(f"zip bin to {output_path} done")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def release_current():
|
||||
merge_bin()
|
||||
board_type = get_board_type()
|
||||
print("board type:", board_type)
|
||||
project_version = get_project_version()
|
||||
print("project version:", project_version)
|
||||
zip_bin(board_type, project_version)
|
||||
|
||||
def get_all_board_types():
|
||||
board_configs = {}
|
||||
with open("main/CMakeLists.txt") as f:
|
||||
lines = f.readlines()
|
||||
for i, line in enumerate(lines):
|
||||
# 查找 if(CONFIG_BOARD_TYPE_*) 行
|
||||
if "if(CONFIG_BOARD_TYPE_" in line:
|
||||
config_name = line.strip().split("if(")[1].split(")")[0]
|
||||
# 查找下一行的 set(BOARD_TYPE "xxx")
|
||||
next_line = lines[i + 1].strip()
|
||||
if next_line.startswith("set(BOARD_TYPE"):
|
||||
board_type = next_line.split('"')[1]
|
||||
board_configs[config_name] = board_type
|
||||
return board_configs
|
||||
|
||||
def release(board_type, board_config):
|
||||
config_path = f"main/boards/{board_type}/config.json"
|
||||
if not os.path.exists(config_path):
|
||||
print(f"跳过 {board_type} 因为 config.json 不存在")
|
||||
return
|
||||
|
||||
with open(config_path, "r") as f:
|
||||
config = json.load(f)
|
||||
target = config["target"]
|
||||
builds = config["builds"]
|
||||
|
||||
for build in builds:
|
||||
name = build["name"]
|
||||
sdkconfig_append = [f"{board_config}=y"]
|
||||
for append in build.get("sdkconfig_append", []):
|
||||
sdkconfig_append.append(append)
|
||||
print(f"name: {name}")
|
||||
print(f"target: {target}")
|
||||
for append in sdkconfig_append:
|
||||
print(f"sdkconfig_append: {append}")
|
||||
# Print Project Version
|
||||
project_version = get_project_version()
|
||||
print(f"Project Version: {project_version}")
|
||||
# unset IDF_TARGET
|
||||
os.environ.pop("IDF_TARGET", None)
|
||||
# Call set-target
|
||||
if os.system(f"idf.py set-target {target}") != 0:
|
||||
print("set-target failed")
|
||||
sys.exit(1)
|
||||
# Append sdkconfig
|
||||
with open("sdkconfig", "a") as f:
|
||||
f.write("\n")
|
||||
for append in sdkconfig_append:
|
||||
f.write(f"{append}\n")
|
||||
# Call merge-bin
|
||||
if os.system("idf.py merge-bin") != 0:
|
||||
print("merge-bin failed")
|
||||
sys.exit(1)
|
||||
# Zip bin
|
||||
zip_bin(name, project_version)
|
||||
print("-" * 80)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
board_configs = get_all_board_types()
|
||||
found = False
|
||||
for board_config, board_type in board_configs.items():
|
||||
if board_type == 'main/boards/bread-compact-wifi-lcd':
|
||||
continue
|
||||
if sys.argv[1] == 'all' or board_type == sys.argv[1]:
|
||||
release(board_type, board_config)
|
||||
found = True
|
||||
if not found:
|
||||
print(f"未找到板子类型: {sys.argv[1]}")
|
||||
print("可用的板子类型:")
|
||||
for board_type in board_configs.values():
|
||||
print(f" {board_type}")
|
||||
else:
|
||||
release_current()
|
||||
|
||||
Reference in New Issue
Block a user