connect progress signal directly to the logger.
[Rockbox.git] / firmware / export / ata_idle_notify.h
blob1dda3e196a7a1e9d8656324b9f3d683657e69421
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 Jonathan Gordon
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #ifndef __ATACALLBACK_H__
20 #define __ATACALLBACK_H__
23 #include <stdbool.h>
24 #include "events.h"
26 #if 0
27 NOTE: ata_idle_nofity usage notes..
29 1) the callbacks are called in the ata thread, not main/your thread.
30 2) Asyncronous callbacks (like the buffer refill) should be avoided.
31 If you must use an async callback, remember to check ata_is_active() before
32 accessing the disk, and nonot call any functions between that check and the
33 disk access which may cause a yield (lcd_update() does this!)
34 3) Do not call cany yielding functions in the callback
35 4) Do not call ata_sleep in the callbacks
36 5) Dont Panic!
37 #endif
39 enum {
40 DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1),
43 #define USING_ATA_CALLBACK !defined(SIMULATOR) \
44 && !defined(HAVE_FLASH_DISK)
46 typedef bool (*ata_idle_notify)(void);
48 extern void register_ata_idle_func(ata_idle_notify function);
49 #if USING_ATA_CALLBACK
50 extern void unregister_ata_idle_func(ata_idle_notify function, bool run);
51 extern bool call_ata_idle_notifys(bool force);
52 #else
53 #define unregister_ata_idle_func(f,r)
54 #define call_ata_idle_notifys(f)
55 #define ata_idle_notify_init(s)
56 #endif
58 #endif /* __ATACALLBACK_H__ */