summaryrefslogtreecommitdiffstats
path: root/apps/plugins/battery_bench.c
AgeCommit message (Collapse)AuthorFilesLines
2023-03-25[Feature] resume TSR plugins after interruption WIPWilliam Wilgus1-30/+38
save tsr plugin path for later resume tsr plugin when user stops the interrupting plugin expand return of tsr_exit function to allow continue, suspend, terminate tsr plugins check parameter at start to determine if the plugin is being resumed Change-Id: I6fc70de664c7771e7dbc9a1af7a831e7b50b1d15
2022-04-16apps: Add ability to do a clean rebootAidan MacDonald1-0/+1
Allow a clean shutdown to end in either power off or reboot. Add a new event SYS_REBOOT to signal it and sys_reboot() to trigger the event. SYS_REBOOT signals a reboot request and should be listened for alongside SYS_POWEROFF events. Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
2021-12-23battery_bench: Log battery current informationAidan MacDonald1-1/+16
Works on targets supporting CURRENT_MEASURE. Change-Id: I021b995c46fab923287ad54e72863695ef9ed58a
2021-12-05powermgmt: Small cleanups to battery capacity codeAidan MacDonald1-1/+6
- Don't include the 'battery capacity' setting unless the target allows changing it. - Clean up the preprocessor conditionals used to check for variable battery capacity support. - Don't use a variable for battery capacity unless it is actually needed. Change-Id: I3d8a338f107014f2c5098bc0a44ef0cfb4df9356
2021-07-22Fix battery_bench bug by using a static buffer for stackAidan MacDonald1-21/+4
Since battery_bench is a TSR (terminate & stay resident) plugin it cannot allocate the plugin buffer -- various parts of the Rockbox core make use of it as temporary storage space. The buffer was used for stack space so this generated false 'Stkov' panics when one of those in-core users overwrote the buffer. The default stack size of 1kb is a bit small, so use 4x the default size to be on the safe side. This also fixes a minor issue where trying to view OS stack usage while battery_bench was running would cause audio dropouts, due to scanning the possibly huge stack with IRQs disabled. Change-Id: I2e6b76f9946db9090c1af61f7aa0a0dac0698c20
2021-07-13New port: Shanling Q1 nativeAidan MacDonald1-0/+3
- Audio playback works - Touchscreen and buttons work - Bootloader works and is capable of dual boot - Plugins are working - Cabbiev2 theme has been ported - Stable for general usage Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps. There's a few minor known issues: - Bootloader must be installed manually using 'usbboot' as there is no support in jztool yet. - Keymaps may be lacking, need further testing and feedback. - Some plugins may not be fully adapted to the screen size and could benefit from further tweaking. - LCD shows abnormal effects under some circumstances: for example, after viewing a mostly black screen an afterimage appears briefly when going back to a brightly-lit screen. Sudden power-off without proper shutdown of the backlight causes a "dissolving" effect. - CW2015 battery reporting driver is buggy, and disabled for now. Battery reporting is currently voltage-based using the AXP192. Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
2021-04-26Nuke the never-functional iriver ifp-7xx portSolomon Peachy1-7/+0
It never worked, and hasn't compiled in something like a decade, Given the HW capabilities (limited onboard flash, no expandability) there's really no point in trying to fix/complete it. Change-Id: I7d175089840396f8891645bd10010d730dd5bfdc
2021-04-26Nuke all TCC77x targets: iAudio 7, Sansa C100, M200(v1-3), Logik DAXSolomon Peachy1-7/+0
They were never finished, never saw any release ever, and haven't compiled for the better part of a decade. Given their HW capabilities [1], they are not worth trying to fix. [1] 1-2MB RAM, ~256MB onboard flash, no expandability Change-Id: I7b2a5806d687114c22156bb0458d4a10a9734190
2021-03-28New port: FiiO M3K on bare metalAidan MacDonald1-0/+6
Change-Id: I7517e7d5459e129dcfc9465c6fbd708619888fbe
2021-02-27Rename symbols of FiiO M3K Linux-based portAidan MacDonald1-1/+1
Mainly a straight replacement of FIIO_M3K -> FIIO_M3K_LINUX. Change-Id: Id07c84f8150991d1b6851540c2c3f8f67e3f12c2
2020-10-11hosted: sanitize handling of HOME_DIRSolomon Peachy1-1/+1
* HOME_DIR is now either "/" or special "<HOME>" * target-specific "home dir path" is defined solely by PIVOT_ROOT * PIVOT_ROOT path is now defined in toplevel config files * Make Samsung YP-R0/R1 and SONY_NWZ use PIVOT_ROOT too * Do not prepend PIVOT_ROOT path if the path already has it! * Do not play these games for __PCTOOL__ builds Change-Id: I3d51ad902a5f9cafe45ba15ba654f30f1ec6113a
2020-10-11Fix red introduced from keymap typosSolomon Peachy1-5/+7
Change-Id: Ia2094eab6fe48b8fa1b313c7548e5e02d630327f
2020-10-11New port: AIGO EROS Q / EROS KSolomon Peachy1-71/+26
The Q and K have a slightly different case, but the hardware under the shell is completely identical. These models are rebadged versions: * Hifiwalker H2 (== Q) * AGPTek H3 (== K) * Surfans F20 (== K) Other notes: * Significant improvements in the shared Hiby-platform launcher/loader * SD card can theoretically be hot-swapped now * Support external USB mass storage! * Some consolidation of Hiby-platform targets * Some consolidation of plugin keymaps Todo/known issues: * Keymaps need to be gone over properly * Convert to HAVE_SCROLLWHEEL? Change-Id: I5a8a4f22c38a5b69392ca7c0a8ad8c4e07d9523c
2020-10-09New port: FiiO M3KSolomon Peachy1-0/+6
Most credit goes to: Roman Skylarov Additional integration and refactoring by myself. *** COMPLETELY UNTESTED *** Change-Id: Ia64c36d92e0214c6b15f7a868df286f8113ea27b
2020-08-15Battery_bench & announce_status stack fixWilliam Wilgus1-3/+1
had stack growing the wrong way Change-Id: I51bf14526f5239e77e15dc0ffd76ad3ed8bdcbc8
2020-08-02Battery_Bench use plugin buffer for thread stack, stop scrollingWilliam Wilgus1-15/+47
Increase stack by using the remaining plugin buffer Stops the scrolling message after user input Change-Id: I3497467143411e262b4de983e3daab3fbc5d08ce
2020-07-24[4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.Solomon Peachy1-16/+1
Note: I left behind lcd_bitmap in features.txt, because removing it would require considerable work in the manual and the translations. Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24[1/4] Remove SH support and all archos targetsSolomon Peachy1-32/+3
This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-04-06xDuoo X3II and X20 portMarcin Bukat1-0/+12
Provided by Roman Stolyarov Integration, Refactoring, and Upstreaming by Solomon Peachy X3II confirmed working by forum tester, X20 is nearly identical. This includes bootloader, main firmware, and the flash image patcher. Eventual Todo: * Further refactor AGPTek Rocker & xduoo hiby bootloaders * Further refactor AGPTek Rocker & xduoo hosted platform code Change-Id: I34a674051d368efcc75d1d18c725971fe46c3eee
2019-07-20FS#7705: Voice enable battery bench pluginSolomon Peachy1-0/+5
Original patch by Daniel Dalton Updated by Igor Poretsky Change-Id: I40d3bb89dbaf3582e1d7af8e8964205507cd2a8d
2019-01-02Add Xuelin iHIFI 770/770C/800 supportSolomon Peachy1-0/+12
Taken from the xvortex fork (Roman Stolyarov) Ported, rebased, and cleaned up by myself. Change-Id: I7b2bca2d29502f2e4544e42f3d122786dd4b7978
2018-07-28Add cleaned-up xDuoo X3 supportSolomon Peachy1-0/+6
Cleaned up, rebased, and forward-ported from the xvortex fork. (original credit to vsoftster@gmail.com) Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
2018-06-12Agptek Rocker: Build pluginsMarcin Bukat1-0/+6
Patch provided by Aapo Tahkola. Change-Id: I37a42a950d78d6b8aa3927ec7aeb30030f7be7a5
2018-04-03Zen XFi2: Enable PluginsSebastian Leonhardt1-0/+6
Keymaps aren't tested, there may be room for improvement. Change-Id: I6b8fe697899b241ea6e96f4fe446d88671ad7818
2016-01-25Replace SAMSUNG_YH920_PAD with YH92XSebastian Leonhardt1-1/+1
seems more logical to me, and is more consistent, since "SAMSUNG_YH92X_PAD" is already used in the tex files. Change-Id: Ie9a9d850ea86155a7dcf86c88a22a420a10a3837
2015-02-02iBasso DX50/DX90: Major code cleanup and reorganization.Udo Schläpfer1-4/+4
Reorganization - Separated iBasso devices from PLATFORM_ANDROID. These are now standlone hosted targets. Most device specific code is in the firmware/target/hosted/ibasso directory. - No dependency on Android SDK, only the Android NDK is needed. 32 bit Android NDK and Android API Level 16. - Separate implementation for each device where feasible. Code cleanup - Rewrite of existing code, from simple reformat to complete reimplementation. - New backlight interface, seperating backlight from touchscreen. - Rewrite of device button handler, removing unneeded code and fixing memory leaks. - New Debug messages interface logging to Android adb logcat (DEBUGF, panicf, logf). - Rewrite of lcd device handler, removing unneeded code and fixing memory leaks. - Rewrite of audiohw device handler/pcm interface, removing unneeded code and fixing memory leaks, enabling 44.1/48kHz pthreaded playback. - Rewrite of power and powermng, proper shutdown, using batterylog results (see http://gerrit.rockbox.org/r/#/c/1047/). - Rewrite of configure (Android NDK) and device specific config. - Rewrite of the Android NDK specific Makefile. Misc - All plugins/games/demos activated. - Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa. Includes - http://gerrit.rockbox.org/r/#/c/993/ - http://gerrit.rockbox.org/r/#/c/1010/ - http://gerrit.rockbox.org/r/#/c/1035/ Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight interface and new option for hold switch, touchscreen, physical button interaction. Rockbox needs the iBasso DX50/DX90 loader for startup, see http://gerrit.rockbox.org/r/#/c/1099/ The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If /mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit gracefully and the loader will restart Rockbox on USB disconnect. Tested on iBasso DX50. Compiled (not tested) for iBasso DX90. Compiled (not tested) for PLATFORM_ANDROID. Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
2015-01-08Clarify usb_powered() and fix some code.Amaury Pouly1-2/+3
Either by mistake or because its meaning changed, usb_powered() doesn't mean what the name suggest, so clarify its meaning by renaming it to usb_powered_only. So use of usb_powered() are replaced by usb_inserted() when it makes more sense. Change-Id: I112887e2d8560e84587bee5f55c826dde8c806d8 Reviewed-on: http://gerrit.rockbox.org/1097 Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-18Introducing Targets iBasso DX50 & iBasso DX90Simon Rothen1-0/+6
The port to for this two targets has been entirely developped by Ilia Sergachev (alias Il or xzcc). His source can be found at https://bitbucket.org/isergachev/rockbox . The few necesary modifications for the DX90 port was done by headwhacker form head-fi.org. Unfortunately i could not try out the final state of the DX90 port. The port is hosted on android (without java) as standalone app. The official Firmware is required to run this port. Ilia did modify the source files for the "android" target in the rockbox source to make the DX port work. The work I did was to separate the code for DX50 (&DX90) from the android target. On this Target Ilia used source from tinyalsa from AOSP. I did not touch that part of the code because I do not understand it. What else I changed from Ilias sources besides the separation from the target "android": * removed a dirty hack to keep backlight off * changed value battery meter to voltage battery meter * made all plugins compile (named target as "standalone") and added keymaps * i added the graphics for the manual but did not do anything else for the manual yet * minor optimizations known bugs: * timers are slowed donw when playback is active (tinyalsa related?) * some minor bugs Things to do: * The main prolem will be how to install the app correctly. A guy called DOC2008 added a CWM (by androtab.info) to the official firmware and Ilia made a CWM installation script and a dualboot selector (rbutils/ibassoboot, build with ndk-build). We will have to find a way to install rockbox in a proper way without breaking any copyrights. Maybe ADB is an option but it is not enable with OF by default. Patching the OF is probably the way to go. * All the wiki and manual to build: needed: android ndk installed, android sdk installed with additional build-tools 19.1.0 installed ./tools/configure select iBasso DX50 or iBasso DX90 make -j apk the content of rockbox.zip/.rockbox needs to be copied to /system/rockbox/app_rockbox/rockbox/ (rockbox app not needed) the content of libs/armeabi to /system/rockbox/lib/ (rockbox app needed) The boot selector is needed as /system/bin/MangoPlayer and the iBasso app as /system/bin/MangoPlayer_original. There is also the "vold" file. The one from OF does not work with DX50 rockbox (DX90 works!?), the one from Ilia is necessary. Until we have found a proper way to install it, it can only be installed following the instructions of Ilia on his bitbucket page, using the CWM-OF and his installation script package. Change-Id: Ic4faaf84824c162aabcc08e492cee6e0068719d0 Reviewed-on: http://gerrit.rockbox.org/941 Tested: Chiwen Chang <rock1104.tw@yahoo.com.tw> Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2014-07-17zen/zenxfi/zenxfistyle/zenmozaic: implement plugin keymaps and enable pluginsAmaury Pouly1-1/+2
Plugins on the ZEN/ZEN X-Fi require to increase the plugin buffer size. Change-Id: If4651c87b402060faa24530985c6e871379c8ea1
2014-05-24Separate keymaps for YH-820 and YH-920/925Sebastian Leonhardt1-1/+2
Although both players basically have the same keys, the differences in the layout is rather big, so I think both deserve their own keymaps. (On the yh820 the FFWD/PLAY/REW buttons are located above the direction keys, on the yh920 at the side of the player. Furthermore the yh920/925 has a REC switch, whereas yh820 has a push button.) Change-Id: I0e62a1b101c387646c0bdb07ea142d9d2430ca15 Reviewed-on: http://gerrit.rockbox.org/814 Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
2014-03-14events: Rework event subsystem (add_event, send_event) to be more versatile.Thomas Martitz1-4/+3
add_event_ex is added that takes an extra user_data pointer. This pointer is passed to the callback (add_event and add_event_ex have slightly different callbacks types). All callbacks also get the event id passed. Events added with add_event_ex must be removed with remove_event_ex because the user_data pointer must match in addition to the callback pointer. On the other add_event is simplified to omit the oneshort parameter which was almost always false (still there with add_event_ex). As a side effect the ata_idle_notify callbacks are changed as well, they do not take a data parameter anymore which was always NULL anyway. This commit also adds some documentation to events.h Change-Id: I13e29a0f88ef908f175b376d83550f9e0231f772
2013-11-14sonynwz: add battery_bench keymapAmaury Pouly1-0/+6
Change-Id: I7be9131356b8655f2dbb90f203b44b2225257450
2012-05-20Creative Zen x-fi: fix battery bench pluginBertrik Sikken1-0/+1
Change-Id: Iaab6353b94cc4462b5953a9fbec315d2e19f47b3
2012-05-19Initial commit for the Creative ZEN X-Fi2 and X-Fi3 portsAmaury Pouly1-0/+6
These are really similar devices so one commit for both is ok. Change-Id: I8bd1d3fef1eb6d00aaadfb7af56c771f62d0c9c3
2012-04-19hm801: Add support for plugins.Andrew Ryabinin1-1/+1
Change-Id: I81654db87d38324d8680a56bcdb7e9922ee5b619
2012-04-19hm60x: Add support for plugins.Andrew Ryabinin1-0/+6
Change-Id: I4cad0881c8249f163680a280f70d1a0b36248da8
2011-12-31Enable (and fix) battery_bench on hosted targets.Thomas Martitz1-0/+6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31471 a1c6a512-1295-4272-9138-f99709370657
2011-12-25rbpaths: Add new special dir HOME_DIR for RaaA.Thomas Martitz1-1/+1
HOME_DIR is intended for not-so-advanced files which shall be user visible, and thus not in /.rockbox. Therefore HOME_DIR is translated to $HOME on RaaA, /sdcard on android, the internal memory on ypr0 and "/" on native targets. ROCKBOX_DIR ("/.rockbox") already existed as special and is translated to whatever the real rockbox dir is on the target (e.g. /sdcard/rockbox on android), but it's not suitable for some files we generate (e.g. battery-bench.txt). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31430 a1c6a512-1295-4272-9138-f99709370657
2011-12-24Initial commit of the Samsung YP-R0 port.Thomas Martitz1-1/+2
This port is a hybrid native/RaaA port. It runs on a embedded linux system, but is the only application. It therefore can implement lots of stuff that native targets also implement, while leveraging the underlying linux kernel. The port is quite advanced. User interface, audio playback, plugins work mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page). Included in utils/ypr0tools are scripts and programs required to generate a patched firmware. The patched firmware has the rootfs modified to load Rockbox. It includes a early/safe USB mode. This port needs a new toolchain, one that includes glibc headers and libraries. rockboxdev.sh can generate it, but e.g. codesourcey and distro packages may also work. Most of the initial effort is done by Lorenzo Miori and others (on ABI), including reverse engineering and patching of the original firmware, initial drivers, and more. Big thanks to you. Flyspray: FS#12348 Author: Lorenzo Miori, myself Merry christmas to ypr0 owners! :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31415 a1c6a512-1295-4272-9138-f99709370657
2011-12-19There's no good reason for requiring the mr500 remote just to run battery_benchFrank Gevaerts1-2/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31368 a1c6a512-1295-4272-9138-f99709370657
2011-11-16Sandisk Sansa Connect port (FS #12363)Tomasz Moń1-0/+6
Included are drivers for buttons, backlight, lcd, audio and storage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31000 a1c6a512-1295-4272-9138-f99709370657
2011-10-02fuze+: add battery_bench keymapAmaury Pouly1-0/+6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30652 a1c6a512-1295-4272-9138-f99709370657
2011-07-25battery bench: fix redundant '#' in the battery bench instruction headerBertrik Sikken1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30211 a1c6a512-1295-4272-9138-f99709370657
2011-02-14All kernel objects in code shared amongs targets (core, plugins, codecs) ↵Michael Sevakis1-1/+1
should be declared SHAREDBSS_ATTR as any core could potentially touch them even though they seem only to involve threads on one core. The exception is target code for particular CPUs where proper allocation is fixed. playlist.c was a little odd too-- use one mutex for the current playlist and a separate one for created playlists (still pondering the necessity of more than one). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29305 a1c6a512-1295-4272-9138-f99709370657
2011-01-18Try to get some control over #ifdef hell in usb.c by refactoring and inline ↵Michael Sevakis1-1/+0
function use. SYS_USB_DISCONNECTED_ACK hasn't been doing anything useful for the USB thread; remove it. USB thread simply ignores that value. Observe only valid usb_state transitions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29084 a1c6a512-1295-4272-9138-f99709370657
2010-11-30HD300 - plugins keymapsMarcin Bukat1-0/+6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28712 a1c6a512-1295-4272-9138-f99709370657
2010-11-02Begin committing keymap plugins for the Philips GoGear HDD6330.Robert Menes1-0/+7
Not all keymaps are completed, but I want to get some initial work I did under version control. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28442 a1c6a512-1295-4272-9138-f99709370657
2010-09-02battery_bench: make functions/struct/variables staticRafaël Carré1-18/+7
remove useless declarations git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27979 a1c6a512-1295-4272-9138-f99709370657
2010-08-24Second try: Introduce plugin_crt0.c that every plugin links.Thomas Martitz1-1/+1
It handles exit() properly, calling the handler also when the plugin returns normally (also make exit() more standard compliant while at it). It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore. To work better together with callbacks passed to rb->default_event_handler_ex() introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it. In most cases rb->default_event_handler_ex() was passed a callback which was manually called at all other return points. This can now be done via atexit(). In future plugin_crt0.c could also handle clearing bss, initializing iram and more. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27873 a1c6a512-1295-4272-9138-f99709370657
2010-08-23Revert "Introduce plugin_crt0.c that every plugin links."Thomas Martitz1-1/+1
Too much errors and no time to fix them now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27863 a1c6a512-1295-4272-9138-f99709370657