diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index 8e591971..208754df 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -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" diff --git a/main/boards/atk-dnesp32s3-box/config.json b/main/boards/atk-dnesp32s3-box/config.json new file mode 100644 index 00000000..e24e983c --- /dev/null +++ b/main/boards/atk-dnesp32s3-box/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "atk-dnesp32s3-box", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/atk-dnesp32s3/config.json b/main/boards/atk-dnesp32s3/config.json new file mode 100644 index 00000000..2f3837dd --- /dev/null +++ b/main/boards/atk-dnesp32s3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "atk-dnesp32s3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/atommatrix-echo-base/config.json b/main/boards/atommatrix-echo-base/config.json new file mode 100644 index 00000000..5b521249 --- /dev/null +++ b/main/boards/atommatrix-echo-base/config.json @@ -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\"" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/atoms3-echo-base/config.json b/main/boards/atoms3-echo-base/config.json new file mode 100644 index 00000000..33dcae9d --- /dev/null +++ b/main/boards/atoms3-echo-base/config.json @@ -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\"" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/atoms3r-echo-base/config.json b/main/boards/atoms3r-echo-base/config.json new file mode 100644 index 00000000..3bef3af3 --- /dev/null +++ b/main/boards/atoms3r-echo-base/config.json @@ -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\"" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/bread-compact-esp32/config.h b/main/boards/bread-compact-esp32/config.h index 0c477e3c..177e866c 100644 --- a/main/boards/bread-compact-esp32/config.h +++ b/main/boards/bread-compact-esp32/config.h @@ -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 diff --git a/main/boards/bread-compact-esp32/config.json b/main/boards/bread-compact-esp32/config.json new file mode 100644 index 00000000..71bb097f --- /dev/null +++ b/main/boards/bread-compact-esp32/config.json @@ -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" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/bread-compact-ml307/config.h b/main/boards/bread-compact-ml307/config.h index 7d4b3f02..53db9c24 100644 --- a/main/boards/bread-compact-ml307/config.h +++ b/main/boards/bread-compact-ml307/config.h @@ -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 diff --git a/main/boards/bread-compact-ml307/config.json b/main/boards/bread-compact-ml307/config.json new file mode 100644 index 00000000..9da8cabd --- /dev/null +++ b/main/boards/bread-compact-ml307/config.json @@ -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" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/bread-compact-wifi/config.h b/main/boards/bread-compact-wifi/config.h index 81ee1c0e..7116f1b8 100644 --- a/main/boards/bread-compact-wifi/config.h +++ b/main/boards/bread-compact-wifi/config.h @@ -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 diff --git a/main/boards/bread-compact-wifi/config.json b/main/boards/bread-compact-wifi/config.json new file mode 100644 index 00000000..ea296f9a --- /dev/null +++ b/main/boards/bread-compact-wifi/config.json @@ -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" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/du-chatx/config.json b/main/boards/du-chatx/config.json new file mode 100644 index 00000000..e6abd31d --- /dev/null +++ b/main/boards/du-chatx/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "du-chatx", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/esp-box-3/config.json b/main/boards/esp-box-3/config.json new file mode 100644 index 00000000..c7a455fc --- /dev/null +++ b/main/boards/esp-box-3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "esp-box-3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/esp-sparkbot/config.json b/main/boards/esp-sparkbot/config.json new file mode 100644 index 00000000..71ac4176 --- /dev/null +++ b/main/boards/esp-sparkbot/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "esp-sparkbot", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/esp32-s3-touch-amoled-1.8/config.json b/main/boards/esp32-s3-touch-amoled-1.8/config.json new file mode 100644 index 00000000..54df6d48 --- /dev/null +++ b/main/boards/esp32-s3-touch-amoled-1.8/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "esp32-s3-touch-amoled-1.8", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/esp32-s3-touch-lcd-1.46/config.json b/main/boards/esp32-s3-touch-lcd-1.46/config.json new file mode 100644 index 00000000..e7e58528 --- /dev/null +++ b/main/boards/esp32-s3-touch-lcd-1.46/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "esp32-s3-touch-lcd-1.46", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/esp32-s3-touch-lcd-1.85/config.json b/main/boards/esp32-s3-touch-lcd-1.85/config.json new file mode 100644 index 00000000..63207b55 --- /dev/null +++ b/main/boards/esp32-s3-touch-lcd-1.85/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "esp32-s3-touch-lcd-1.85", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/esp32-s3-touch-lcd-1.85c/config.json b/main/boards/esp32-s3-touch-lcd-1.85c/config.json new file mode 100644 index 00000000..18327997 --- /dev/null +++ b/main/boards/esp32-s3-touch-lcd-1.85c/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "esp32-s3-touch-lcd-1.85c", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/esp32s3-korvo2-v3/config.json b/main/boards/esp32s3-korvo2-v3/config.json new file mode 100644 index 00000000..36110a15 --- /dev/null +++ b/main/boards/esp32s3-korvo2-v3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "esp32s3-korvo2-v3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/kevin-box-1/config.json b/main/boards/kevin-box-1/config.json new file mode 100644 index 00000000..82d8a1f7 --- /dev/null +++ b/main/boards/kevin-box-1/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "kevin-box-1", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/kevin-box-2/config.json b/main/boards/kevin-box-2/config.json new file mode 100644 index 00000000..d9a581de --- /dev/null +++ b/main/boards/kevin-box-2/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "kevin-box-2", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/kevin-c3/config.json b/main/boards/kevin-c3/config.json new file mode 100644 index 00000000..76b4f511 --- /dev/null +++ b/main/boards/kevin-c3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32c3", + "builds": [ + { + "name": "kevin-c3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/lichuang-c3-dev/config.json b/main/boards/lichuang-c3-dev/config.json new file mode 100644 index 00000000..cdc508f1 --- /dev/null +++ b/main/boards/lichuang-c3-dev/config.json @@ -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\"" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/lichuang-dev/config.json b/main/boards/lichuang-dev/config.json new file mode 100644 index 00000000..0b2c646b --- /dev/null +++ b/main/boards/lichuang-dev/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "lichuang-dev", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/lilygo-t-circle-s3/config.json b/main/boards/lilygo-t-circle-s3/config.json new file mode 100644 index 00000000..378ddeda --- /dev/null +++ b/main/boards/lilygo-t-circle-s3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "lilygo-t-circle-s3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/m5stack-core-s3/config.json b/main/boards/m5stack-core-s3/config.json new file mode 100644 index 00000000..bec9ad07 --- /dev/null +++ b/main/boards/m5stack-core-s3/config.json @@ -0,0 +1,11 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "m5stack-core-s3", + "sdkconfig_append": [ + "CONFIG_SPIRAM_MODE_QUAD=y" + ] + } + ] +} \ No newline at end of file diff --git a/main/boards/magiclick-2p4/config.json b/main/boards/magiclick-2p4/config.json new file mode 100644 index 00000000..f416c2a8 --- /dev/null +++ b/main/boards/magiclick-2p4/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "magiclick-2p4", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/magiclick-c3/config.json b/main/boards/magiclick-c3/config.json new file mode 100644 index 00000000..f4dc4f3c --- /dev/null +++ b/main/boards/magiclick-c3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32c3", + "builds": [ + { + "name": "magiclick-c3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/movecall-moji-esp32s3/config.json b/main/boards/movecall-moji-esp32s3/config.json new file mode 100644 index 00000000..c62a8fd8 --- /dev/null +++ b/main/boards/movecall-moji-esp32s3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "movecall-moji-esp32s3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/taiji-pi-s3/config.json b/main/boards/taiji-pi-s3/config.json new file mode 100644 index 00000000..d66def5d --- /dev/null +++ b/main/boards/taiji-pi-s3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "taiji-pi-s3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/xingzhi-cube-oled/config.json b/main/boards/xingzhi-cube-oled/config.json new file mode 100644 index 00000000..93a28ecb --- /dev/null +++ b/main/boards/xingzhi-cube-oled/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "xingzhi-cube-oled", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/xingzhi-cube-tft/config.json b/main/boards/xingzhi-cube-tft/config.json new file mode 100644 index 00000000..83a6d36f --- /dev/null +++ b/main/boards/xingzhi-cube-tft/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32s3", + "builds": [ + { + "name": "xingzhi-cube-tft", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/main/boards/xmini-c3/config.json b/main/boards/xmini-c3/config.json new file mode 100644 index 00000000..49dfb37d --- /dev/null +++ b/main/boards/xmini-c3/config.json @@ -0,0 +1,9 @@ +{ + "target": "esp32c3", + "builds": [ + { + "name": "xmini-c3", + "sdkconfig_append": [] + } + ] +} \ No newline at end of file diff --git a/scripts/release.py b/scripts/release.py index 075c06f0..cefcd4d5 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -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()