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.

imx233: enable charging in bootloader USB mode by including powermgmt

Change-Id: I8b91b3ab60cb9ffaa127333e9bcef8c33be742fa

+18 -3
+13
bootloader/imx233.c
··· 39 39 #include "system-target.h" 40 40 #include "fmradio_i2c.h" 41 41 #include "version.h" 42 + #include "powermgmt.h" 42 43 43 44 #include "usb.h" 44 45 ··· 81 82 { 82 83 /* Got the message - wait for disconnect */ 83 84 printf("Bootloader USB mode"); 85 + /* Enable power management to charge */ 86 + powermgmt_init(); 84 87 85 88 usb_acknowledge(SYS_USB_CONNECTED_ACK); 86 89 ··· 89 92 button = button_get_w_tmo(HZ/2); 90 93 if(button == SYS_USB_DISCONNECTED) 91 94 break; 95 + struct imx233_powermgmt_info_t info = imx233_powermgmt_get_info(); 96 + lcd_putsf(0, 7, "Charging status: %s", 97 + info.state == CHARGE_STATE_DISABLED ? "disabled" : 98 + info.state == CHARGE_STATE_ERROR ? "error" : 99 + info.state == DISCHARGING ? "discharging" : 100 + info.state == TRICKLE ? "trickle" : 101 + info.state == TOPOFF ? "topoff" : 102 + info.state == CHARGING ? "charging" : "<unknown>"); 103 + lcd_putsf(0, 8, "Battery: %d%%", battery_level()); 104 + lcd_update(); 92 105 } 93 106 } 94 107
+1 -1
firmware/SOURCES
··· 1335 1335 target/arm/imx233/sansa-fuzeplus/debug-fuzeplus.c 1336 1336 target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c 1337 1337 target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c 1338 + target/arm/imx233/sansa-fuzeplus/powermgmt-fuzeplus.c 1338 1339 #ifndef BOOTLOADER 1339 1340 target/arm/imx233/sansa-fuzeplus/audio-fuzeplus.c 1340 - target/arm/imx233/sansa-fuzeplus/powermgmt-fuzeplus.c 1341 1341 #endif 1342 1342 #endif 1343 1343
+4 -2
firmware/powermgmt.c
··· 889 889 sleeptimer_key_restarts = enable; 890 890 } 891 891 892 + #ifndef BOOTLOADER 892 893 static void handle_sleep_timer(void) 893 894 { 894 - #ifndef BOOTLOADER 895 895 if (!sleeptimer_active) 896 896 return; 897 897 ··· 912 912 sys_poweroff(); 913 913 } 914 914 } 915 - #endif /* BOOTLOADER */ 916 915 } 916 + #endif /* BOOTLOADER */ 917 917 918 918 /* 919 919 * We shut off in the following cases: ··· 929 929 */ 930 930 void handle_auto_poweroff(void) 931 931 { 932 + #ifndef BOOTLOADER 932 933 long timeout = poweroff_timeout*60*HZ; 933 934 int audio_stat = audio_status(); 934 935 long tick = current_tick; ··· 968 969 } 969 970 } else 970 971 handle_sleep_timer(); 972 + #endif 971 973 }