fix upgrade icon

This commit is contained in:
Terrence
2025-01-25 12:44:31 +08:00
parent e4d80060a2
commit 046ca3e0c9
3 changed files with 12 additions and 2 deletions

View File

@@ -377,3 +377,11 @@ void LcdDisplay::SetEmotion(const std::string &emotion) {
} }
} }
void LcdDisplay::SetIcon(const char* icon) {
if (emotion_label_ == nullptr) {
return;
}
DisplayLockGuard lock(this);
lv_obj_set_style_text_font(emotion_label_, &font_awesome_30_4, 0);
lv_label_set_text(emotion_label_, icon);
}

View File

@@ -50,6 +50,7 @@ public:
void SetChatMessage(const std::string &role, const std::string &content) override; void SetChatMessage(const std::string &role, const std::string &content) override;
void SetEmotion(const std::string &emotion) override; void SetEmotion(const std::string &emotion) override;
void SetIcon(const char* icon) override;
}; };
#endif // LCD_DISPLAY_H #endif // LCD_DISPLAY_H

View File

@@ -67,13 +67,13 @@ def get_board_name(folder):
return "bread-compact-wifi" return "bread-compact-wifi"
elif "KevinBox1" in basename: elif "KevinBox1" in basename:
return "kevin-box-1" return "kevin-box-1"
if basename.startswith("v0.7") or basename.startswith("v0.8") or basename.startswith("v0.9"): if basename.startswith("v0.7") or basename.startswith("v0.8") or basename.startswith("v0.9") or basename.startswith("v1."):
return basename.split("_")[1] return basename.split("_")[1]
raise Exception(f"Unknown board name: {basename}") raise Exception(f"Unknown board name: {basename}")
def read_binary(dir_path): def read_binary(dir_path):
merged_bin_path = os.path.join(dir_path, "merged-binary.bin") merged_bin_path = os.path.join(dir_path, "merged-binary.bin")
data = open(merged_bin_path, "rb").read()[0x200000:] data = open(merged_bin_path, "rb").read()[0x100000:]
if data[0] != 0xE9: if data[0] != 0xE9:
print(dir_path, "is not a valid image") print(dir_path, "is not a valid image")
return return
@@ -105,6 +105,7 @@ def read_binary(dir_path):
"flash_size": flash_size, "flash_size": flash_size,
"board": get_board_name(dir_path), "board": get_board_name(dir_path),
"application": desc, "application": desc,
"firmware_size": len(data),
} }
def extract_zip(zip_path, extract_path): def extract_zip(zip_path, extract_path):