1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2012 by Michael Giacomelli
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
25 #include "gcc_extensions.h"
28 #ifdef ROCKBOX_HAS_LOGDISKF
30 void init_logdiskf(void);
32 /*large memory devices spin up the disk much less often*/
34 #define MAX_LOGDISKF_SIZE 8192
36 #define MAX_LOGDISKF_SIZE 4096
38 #define MAX_LOGDISKF_SIZE 1024
41 extern unsigned char logdiskfbuffer
[MAX_LOGDISKF_SIZE
];
42 extern int logfdiskindex
;
44 #define LOGDISK_LEVEL 1
46 #if LOGDISK_LEVEL > 0 /*serious errors or problems*/
47 #define ERRORF(...) _logdiskf(__func__,'E', __VA_ARGS__)
52 #if LOGDISK_LEVEL > 1 /*matters of concern*/
53 #define WARNF(...) _logdiskf(__func__, 'W', __VA_ARGS__)
58 #if LOGDISK_LEVEL > 2 /*useful for debug only*/
59 #define NOTEF(...) _logdiskf(__func__, 'N', __VA_ARGS__)
61 #define NOTEF(...) /*TODO: rename DEBUGF later*/
64 /*__FILE__ would be better but is difficult to make work with the build system*/
65 //#define logdiskf(...) _logdiskf(__func__, 1, __VA_ARGS__)
67 void _logdiskf(const char* file
, const char level
,
68 const char *format
, ...) ATTRIBUTE_PRINTF(3, 4);
70 #else /* !ROCKBOX_HAS_LOGDISKF */
72 /* built without logdiskf() support enabled, replace logdiskf() by DEBUGF() */
78 #endif /* LOGDISKF_H */