Commit graph

21 commits

Author SHA1 Message Date
Thomas Martitz
470989bd70 events: Rework event subsystem (add_event, send_event) to be more versatile.
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
2014-03-14 23:36:30 +01:00
Thomas Martitz
b7937a729f fix database tool
Change-Id: I48702c3213aae7e2c64ea0e1f197e61368393759
2012-07-18 16:23:11 +02:00
Thomas Martitz
2345e0c48d hosted: disable USING_STORAGE_CALLBACK again
6b8330d was not the correct fix. In fact, it prevents settings from being
written as there's no DISK_EVENT_SPINUP event, so they were only saved on
proper shutdown.

Change-Id: Iad26366f2821ed6adf445c391d461563c5782a71
2012-06-15 20:54:42 +02:00
Frank Gevaerts
3f72ba0e3f Fix broken logic for enabling USING_STORAGE_CALLBACK.
The logic got broken by 6b8330d2.

Since the ifp700 port is basically unmaintained and unfinished and doesn't
build anyway, we can remove the special-casing for it. This simplifies the
logic to "hosted or native, except for bootloaders", which simplifies
further to "not bootloaders".

Fixes FS#12685

Change-Id: Iaaad534067da22b74bf647aa58dcbb678bbc5f70
2012-05-26 00:10:00 +02:00
Thomas Martitz
6b8330d216 Enable USING_STORAGE_CALLBACK on hosted targets. Fixes config.cfg not written properly.
Change-Id: I3c87b41baae284b818be5c272d984d937ae0e350
2012-05-13 19:14:56 +02:00
Thomas Martitz
35e8b1429a Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR).
The new define is to (de-)select code to compile on hosted platforms generally.

Should be no functional change to targets or the simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 16:53:00 +00:00
Jonathan Gordon
31a4dc9caa undo the last commit... I'm too tired to fgure out how to make batt bench work without the spin down notification (aka, fix red the really lazy way)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24284 a1c6a512-1295-4272-9138-f99709370657
2010-01-19 08:04:36 +00:00
Jonathan Gordon
5e7b4f8c7e Dont use the disk spindown notification on the mini2440, undo this if/when we have a clean way to force a shutdown/umount of the sd card
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24283 a1c6a512-1295-4272-9138-f99709370657
2010-01-19 07:49:45 +00:00
Thomas Martitz
774bacc692 Correct wrong usage of event callbacks all over the place. It's not supposed to return anything, and should take a data parameter.
Fixing it because correcting the event api prototypes causes many warnings.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23301 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 21:54:44 +00:00
Dave Chapman
82970fda2e CONFIG_NAND is not a bitfield
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22906 a1c6a512-1295-4272-9138-f99709370657
2009-10-04 02:17:54 +00:00
Frank Gevaerts
2f8a0081c6 Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-11-01 16:14:28 +00:00
Frank Gevaerts
19d1cacb1a cleanup storage defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18950 a1c6a512-1295-4272-9138-f99709370657
2008-10-31 21:25:04 +00:00
Jens Arnold
498985669b Bootloaders don't need idle callbacks.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18614 a1c6a512-1295-4272-9138-f99709370657
2008-09-23 22:12:21 +00:00
Bertrik Sikken
2e1da4d474 Comment/line length/spelling police
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18127 a1c6a512-1295-4272-9138-f99709370657
2008-07-27 12:09:33 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Miika Pekkarinen
19c6e66c13 Implement the playback event handling as a system-wide multi-purpose event system. Unified mpeg.c and playback.c audio event handling. Converted ata_idle_notify to use the new event handling system also.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16682 a1c6a512-1295-4272-9138-f99709370657
2008-03-16 13:55:16 +00:00
Jonathan Gordon
4049d44b03 dont allow the ata callbacks to be run less than once every 30s unless
explicitly forced to.
The sleep_after param is only true in the Q_SLEEP event, so its uneeded,
so removed


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11599 a1c6a512-1295-4272-9138-f99709370657
2006-11-26 09:53:42 +00:00
Jonathan Gordon
92eff9d293 fixed once again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11464 a1c6a512-1295-4272-9138-f99709370657
2006-11-08 03:19:53 +00:00
Jonathan Gordon
d9f7ac24f4 fix booboo in ata.c (SYS_POWEROFF falling into SYS_USB_CONNECTED)
enable ata_idle callbacks in ata_mmc.c (calls the callbacks after 10s of
real inactivity)
fix builds


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11462 a1c6a512-1295-4272-9138-f99709370657
2006-11-08 02:23:01 +00:00
Jonathan Gordon
f184152c05 * changes to ata.c - idle callbacks are called after 2 sec of real idle,
and shutdown and usb (it makes sense here). ata_sleep doesnt get broken
by callbacks.
* allow ata_sleep() at the end of buffering again
* config block uses ata_idle instead of delayed sector when saving
* remove delayed sector code from ata_mmc.c (idle callbacks are not yet
implemented for ata_mmc.c tho)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11461 a1c6a512-1295-4272-9138-f99709370657
2006-11-08 01:55:26 +00:00
Jonathan Gordon
0b22795e26 adds ata_idle_notify system which allows callbacks in apps/ to be called
when the hard disk is idle but spinning, and just before shutting down.
on SWCODEC targets with > 8MB RAM the playback engine will try to
refill the buffer if it is less than 75% full while the disk is spinning
(temporarily disabled on the nano)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11451 a1c6a512-1295-4272-9138-f99709370657
2006-11-06 14:24:18 +00:00