summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-04-11 11:54:02 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-04-22 15:46:30 -0400
commit886060475e25d04b9eb1753dbbaea0db8b78a0d4 (patch)
tree472b29d2dbb994cbfa1addac945f9043796614c6 /apps/debug_menu.c
parent6cbcde13b9eb10b50724f956ba5696fc82ed7cf4 (diff)
downloadrockbox-886060475e25d04b9eb1753dbbaea0db8b78a0d4.tar.gz
rockbox-886060475e25d04b9eb1753dbbaea0db8b78a0d4.zip
ata: Heavily rework sleep and poweroff logic
* Use of ata_disk_can_poweroff() was inverted, resulting in SATA SSDs getting powered off but leaving _everything_ else on, including spinning rust! * Replace the can_poweroff() heuristic with a test for the mandatory ATA power mgmt feature flag. Notably, the CF->SD adapters don't claim to support this! * Eliminate duplicated tests in sleep code * Wrap all poweroff-related code with HAVE_ATA_POWER_OFF * Don't ever use SLEEP command, only STANDBY_IMMEDIATE * Gate call to STANDBY_IMMEDIATE behind a can_poweroff() test * Prefer FLUSH_CACHE_EXT to FLUSH_CACHE where available. * Improve SSD detection heuristics to any of these: * Explicltly identifies as SSD (covers newer CF and SATA) * TRIM support * CFA compliant AND (CF level 0 OR high speed support) * Report SSD detection in debug menu Change-Id: I7fcb83b6d6eabddc11c64326a573b08ab85412b5
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 245cd38627..07640c3937 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1074,7 +1074,7 @@ static bool view_battery(void)
1074 1074
1075 lcd_putsf(0, line++, "State: %s", chrgstate_strings[y]); 1075 lcd_putsf(0, line++, "State: %s", chrgstate_strings[y]);
1076 1076
1077 lcd_putsf(0, line++, "%s Switch: %s", "Battery", 1077 lcd_putsf(0, line++, "%s Switch: %s", "Battery",
1078 (st & POWER_INPUT_BATTERY) ? "On" : "Off"); 1078 (st & POWER_INPUT_BATTERY) ? "On" : "Off");
1079 1079
1080 y = chrgraw_adc_voltage(); 1080 y = chrgraw_adc_voltage();
@@ -1405,6 +1405,7 @@ static int disk_callback(int btn, struct gui_synclist *lists)
1405 volume_size( IF_MV(0,) NULL, &free ); 1405 volume_size( IF_MV(0,) NULL, &free );
1406 simplelist_addline( 1406 simplelist_addline(
1407 "Free: %ld MB", free / 1024); 1407 "Free: %ld MB", free / 1024);
1408 simplelist_addline("SSD detected: %s", ata_disk_isssd() ? "yes" : "no");
1408 simplelist_addline( 1409 simplelist_addline(
1409 "Spinup time: %d ms", storage_spinup_time() * (1000/HZ)); 1410 "Spinup time: %d ms", storage_spinup_time() * (1000/HZ));
1410 i = identify_info[82] & (1<<3); 1411 i = identify_info[82] & (1<<3);
@@ -1512,6 +1513,7 @@ static int disk_callback(int btn, struct gui_synclist *lists)
1512 i = identify_info[0] & (1 << 7); 1513 i = identify_info[0] & (1 << 7);
1513 simplelist_addline( 1514 simplelist_addline(
1514 "Removeable media: %s", i ? "yes" : "no"); 1515 "Removeable media: %s", i ? "yes" : "no");
1516
1515 return btn; 1517 return btn;
1516} 1518}
1517 1519