Add short explanation on how to build rbutilqt.
[Rockbox.git] / firmware / export / ata_idle_notify.h
blobee825c967e76461d8f3381fd2bd6fa992f36a397
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__
22 #include <stdbool.h>
24 #if 0
25 NOTE: ata_idle_nofity usage notes..
27 1) the callbacks are called in the ata thread, not main/your thread.
28 2) Asyncronous callbacks (like the buffer refill) should be avoided.
29 If you must use an async callback, remember to check ata_is_active() before
30 accessing the disk, and nonot call any functions between that check and the
31 disk access which may cause a yield (lcd_update() does this!)
32 3) Do not call cany yielding functions in the callback
33 4) Do not call ata_sleep in the callbacks
34 5) Dont Panic!
35 #endif
37 #define USING_ATA_CALLBACK !defined(SIMULATOR) \
38 && !defined(HAVE_FLASH_DISK)
40 #define MAX_ATA_CALLBACKS 5
41 typedef bool (*ata_idle_notify)(void);
43 extern bool register_ata_idle_func(ata_idle_notify function);
44 #if USING_ATA_CALLBACK
45 extern void ata_idle_notify_init(void);
46 extern void unregister_ata_idle_func(ata_idle_notify function, bool run);
47 extern bool call_ata_idle_notifys(bool force);
48 #else
49 #define unregister_ata_idle_func(f,r)
50 #define call_ata_idle_notifys(f)
51 #define ata_idle_notify_init(s)
52 #endif
54 #endif /* __ATACALLBACK_H__ */