From 3e08b86e4b7c9f45845d8f621f53be7245683c24 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 27 Jun 2026 13:12:21 -0400 Subject: [PATCH] FixRed a824085 skin: add %pX tag checkwps, ATA builds ata_disk_isssd() return 0 for SIMULATOR Change-Id: If281b5ce7a98f338dfd81635c8936dd90c41b9bb --- apps/gui/skin_engine/skin_parser.c | 2 ++ apps/gui/skin_engine/skin_tokens.c | 6 +++++- firmware/export/ata.h | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 54b36ae31e..af0c83a8b2 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -1236,7 +1236,9 @@ static int parse_progressbar_tag(struct skin_element* element, token->type = SKIN_TOKEN_BATTERY_PERCENTBAR; else if (token->type == SKIN_TOKEN_PLAYLIST_ELAPSED_PERCENT) { +#ifndef __PCTOOL__ wps_playlist_percent_enable(); /* enable scanning track lengths */ +#endif token->type = SKIN_TOKEN_PLAYLIST_PROGRESSBAR; } else if (token->type == SKIN_TOKEN_TUNER_RSSI) diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 3da1a52139..43b727a321 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -73,6 +73,10 @@ #include "option_select.h" #include "wps.h" +#if (CONFIG_STORAGE & STORAGE_ATA) +#include "ata.h" /* ata_disk_isssd() */ +#endif + #define NOINLINE __attribute__ ((noinline)) static const char* get_codectype(const struct mp3entry* id3) @@ -291,7 +295,7 @@ void wps_playlist_percent_prepare(void) if (size > 0) { if (afmt != last_afmt || last_bps == 0 - || amount <= 50 || (amount <= 250 && ata_disk_isssd()) // TODO tune this for harddisk devices + || amount <= 50 || (amount <= 250 && ata_disk_isssd())) // TODO tune this for harddisk devices { if (get_metadata_ex(tmp, fd, info.filename, METADATA_EXCLUDE_ID3_PATH | METADATA_EXCLUDE_NORMALIZE)) diff --git a/firmware/export/ata.h b/firmware/export/ata.h index d049f4cef2..ff08eaf5d0 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h @@ -168,6 +168,9 @@ int ata_spinup_time(void); /* ticks */ /* Returns 1 if drive is solid-state */ static inline int ata_disk_isssd(void) { +#ifdef SIMULATOR + return 0; +#else unsigned short *identify_info = ata_get_identify(); /* Offset 217 is "Nominal Rotation rate" @@ -206,6 +209,7 @@ static inline int ata_disk_isssd(void) || ((identify_info[83] & (1<<2)) && /* CFA compliant */ ((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */ ); +#endif } /* Returns 1 if the drive supports power management commands */