Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

If HAVE_POWEROFF_WHILE_CHARGING is not defined and the charging configuration specifies CHARGING_MONITOR or greater, allow poweroff while plugged but not actually charging the battery.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26055 a1c6a512-1295-4272-9138-f99709370657

+17 -1
+9 -1
apps/misc.c
··· 264 264 scrobbler_poweroff(); 265 265 266 266 #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) 267 + #if CONFIG_CHARGING >= CHARGING_MONITOR 268 + if(!charging_state()) 269 + #else 267 270 if(!charger_inserted()) 271 + #endif 268 272 #endif 269 273 { 270 274 bool batt_safe = battery_level_safe(); ··· 406 410 407 411 if (TIME_BEFORE(current_tick, last_off + HZ/2)) 408 412 { 409 - if (charger_inserted()) 413 + #if CONFIG_CHARGING >= CHARGING_MONITOR 414 + if (charging_state()) 415 + #else 416 + if (charger_inserted()) 417 + #endif 410 418 { 411 419 charging_splash(); 412 420 ret = true; /* screen is dirty, caller needs to refresh */
+4
firmware/drivers/button.c
··· 205 205 #endif 206 206 ) && 207 207 #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) 208 + #if CONFIG_CHARGING >= CHARGING_MONITOR 209 + !charging_state() && 210 + #else 208 211 !charger_inserted() && 212 + #endif 209 213 #endif 210 214 repeat_count > POWEROFF_COUNT) 211 215 {
+4
firmware/powermgmt.c
··· 358 358 359 359 if (usb_inserted() 360 360 #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) 361 + #if CONFIG_CHARGING >= CHARGING_MONITOR 362 + || charging_state() 363 + #else 361 364 || charger_input_state != NO_CHARGER 365 + #endif 362 366 #endif 363 367 ) { 364 368 DEBUGF("Sleep timer timeout. Stopping...\n");