forked from len0rd/rockbox
Set CONFIG_RTC to 0 for non-RTC targets, and check with #if to profit from -Wundef. No code change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12811 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c0351ca633
commit
2c7b127dd7
21 changed files with 42 additions and 38 deletions
|
@ -970,7 +970,7 @@ static char* get_tag(struct wps_data* wps_data,
|
|||
#endif
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
case 'c': /* Real Time Clock display */
|
||||
*flags |= WPS_REFRESH_DYNAMIC;
|
||||
{
|
||||
|
|
|
@ -141,7 +141,7 @@ static void gui_statusbar_led(struct screen * display);
|
|||
#ifdef HAVE_RECORDING
|
||||
static void gui_statusbar_icon_recording_info(struct screen * display);
|
||||
#endif
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
static void gui_statusbar_time(struct screen * display, int hour, int minute);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -238,7 +238,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
|
|||
if(!display->has_disk_led)
|
||||
bar->info.led = led_read(HZ/2); /* delay should match polling interval */
|
||||
#endif
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
{
|
||||
struct tm* tm = get_time();
|
||||
bar->info.hour = tm->tm_hour;
|
||||
|
@ -323,7 +323,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
|
|||
if (bar->info.keylockremote)
|
||||
gui_statusbar_icon_lock_remote(display);
|
||||
#endif
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
gui_statusbar_time(display, bar->info.hour, bar->info.minute);
|
||||
#endif /* CONFIG_RTC */
|
||||
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
|
||||
|
@ -580,7 +580,7 @@ static void gui_statusbar_led(struct screen * display)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
/*
|
||||
* Print time to status bar
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ struct status_info {
|
|||
int volume;
|
||||
int playmode;
|
||||
int repeat;
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
int hour;
|
||||
int minute;
|
||||
#endif
|
||||
|
|
|
@ -341,7 +341,7 @@ static void init(void)
|
|||
|
||||
i2c_init();
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
rtc_init();
|
||||
#endif
|
||||
#ifdef HAVE_RTC_RAM
|
||||
|
|
|
@ -199,7 +199,7 @@ static bool show_info(void)
|
|||
output_dyn_value(NULL, 0, free, kbyte_units, true);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
{
|
||||
struct tm* tm = get_time();
|
||||
talk_id(VOICE_CURRENT_TIME, true);
|
||||
|
|
|
@ -185,7 +185,7 @@ MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON,
|
|||
#endif
|
||||
|
||||
/* Time & Date */
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
static int timedate_set(void)
|
||||
{
|
||||
struct tm tm;
|
||||
|
@ -317,7 +317,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
|||
#ifndef HAVE_MMC
|
||||
&disk_menu,
|
||||
#endif
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
&time_menu,
|
||||
#endif
|
||||
&poweroff,
|
||||
|
|
|
@ -207,7 +207,7 @@ void format_time(char* buf, int buf_size, long t)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
/* Create a filename with a date+time part.
|
||||
It is allowed that buffer and path point to the same memory location,
|
||||
saving a strcpy(). Path must always be given without trailing slash.
|
||||
|
@ -413,7 +413,7 @@ void screen_dump(void)
|
|||
static unsigned short line_block[BMP_LINESIZE/2];
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
create_datetime_filename(filename, "", "dump ", ".bmp", false);
|
||||
#else
|
||||
create_numbered_filename(filename, "", "dump_", ".bmp", 4
|
||||
|
|
|
@ -38,7 +38,7 @@ char *output_dyn_value(char *buf, int buf_size, int value,
|
|||
* less than zero to number automatically. The final number used will also
|
||||
* be returned in *num. If *num is >= 0 then *num will be incremented by
|
||||
* one. */
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) && !defined(CONFIG_RTC)
|
||||
#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING) && (CONFIG_RTC == 0)
|
||||
/* this feature is needed by SWCODEC recording without a RTC to prevent
|
||||
disk access when changing files */
|
||||
#define IF_CNFN_NUM_(...) __VA_ARGS__
|
||||
|
@ -58,7 +58,7 @@ char *create_numbered_filename(char *buffer, const char *path,
|
|||
*/
|
||||
void format_time(char* buf, int buf_size, long t);
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
/* Create a filename with a date+time part.
|
||||
It is allowed that buffer and path point to the same memory location,
|
||||
saving a strcpy(). Path must always be given without trailing slash.
|
||||
|
|
|
@ -76,7 +76,7 @@ video.c
|
|||
vu_meter.c
|
||||
wormlet.c
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
clock.c
|
||||
#if CONFIG_KEYPAD == RECORDER_PAD /* Recorder models only for now */
|
||||
calendar.c
|
||||
|
|
|
@ -271,7 +271,7 @@ struct counter values[]={
|
|||
{"ydist", -6},
|
||||
};
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
|
||||
#define CLOCK_STEP (0xffffffff/60)
|
||||
#define CLOCK_FRAC (0xffffffff%60)
|
||||
|
@ -382,7 +382,7 @@ static int scrollit(void)
|
|||
return -1;
|
||||
}
|
||||
rb->lcd_clear_display();
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
addclock();
|
||||
#endif
|
||||
|
||||
|
@ -451,7 +451,7 @@ static int loopit(void)
|
|||
x+= speed[xsanke&15] + values[NUM_XADD].num;
|
||||
|
||||
rb->lcd_clear_display();
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
addclock();
|
||||
#endif
|
||||
if(timeout) {
|
||||
|
@ -516,7 +516,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
rb->sleep(HZ);
|
||||
rb->lcd_set_drawmode(DRMODE_FG);
|
||||
init_tables();
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
init_clock();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
****************************************************************************/
|
||||
#include "plugin.h"
|
||||
|
||||
#if defined(HAVE_LCD_BITMAP) && defined(CONFIG_RTC)
|
||||
#if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
|
||||
|
||||
#include <timefuncs.h>
|
||||
|
||||
|
@ -71,7 +71,7 @@ static int calc_weekday( struct shown *shown )
|
|||
static void calendar_init(struct today *today, struct shown *shown)
|
||||
{
|
||||
int w,h;
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
struct tm *tm;
|
||||
#else
|
||||
(void)today;
|
||||
|
@ -83,7 +83,7 @@ static void calendar_init(struct today *today, struct shown *shown)
|
|||
use_system_font = true;
|
||||
}
|
||||
rb->lcd_clear_display();
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
tm = rb->get_time();
|
||||
today->mon = tm->tm_mon +1;
|
||||
today->year = 2000+tm->tm_year%100;
|
||||
|
|
|
@ -177,7 +177,7 @@ extern void statusbar_icon_play_state(int state);
|
|||
extern void statusbar_icon_play_mode(int mode);
|
||||
extern void statusbar_icon_shuffle(void);
|
||||
extern void statusbar_icon_lock(void);
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
extern void statusbar_time(int hour, int minute);
|
||||
#endif
|
||||
#if (CONFIG_LED == LED_VIRTUAL)
|
||||
|
|
|
@ -518,7 +518,7 @@ char *rec_create_filename(char *buffer)
|
|||
snprintf(ext, sizeof(ext), ".%s",
|
||||
REC_FILE_ENDING(global_settings.rec_format));
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
/* We'll wait at least up to the start of the next second so no duplicate
|
||||
names are created */
|
||||
return create_datetime_filename(buffer, buffer, "R", ext, true);
|
||||
|
|
|
@ -784,7 +784,7 @@ void charging_splash(void)
|
|||
#endif
|
||||
|
||||
|
||||
#if defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC)
|
||||
#if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
|
||||
|
||||
const int dayname[] = {
|
||||
LANG_WEEKDAY_SUNDAY,
|
||||
|
@ -1081,7 +1081,7 @@ bool set_time_screen(const char* string, struct tm *tm)
|
|||
lcd_set_drawmode(lastmode);
|
||||
return false;
|
||||
}
|
||||
#endif /* defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC) */
|
||||
#endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */
|
||||
|
||||
#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
|
||||
bool shutdown_screen(void)
|
||||
|
|
|
@ -42,7 +42,7 @@ extern bool quick_screen_f3(int button_enter);
|
|||
#endif
|
||||
extern bool quick_screen_quick(int button_enter);
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
bool set_time_screen(const char* string, struct tm *tm);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
|
|||
#include "settings.h"
|
||||
#include "ata_idle_notify.h"
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
#include "time.h"
|
||||
#include "timefuncs.h"
|
||||
#endif
|
||||
|
@ -41,7 +41,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
|
|||
|
||||
#define SCROBBLER_VERSION "1.0"
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
#define SCROBBLER_FILE "/.scrobbler.log"
|
||||
#else
|
||||
#define SCROBBLER_FILE "/.scrobbler-timeless.log"
|
||||
|
@ -62,7 +62,7 @@ static struct mp3entry scrobbler_entry;
|
|||
static bool pending = false;
|
||||
static bool scrobbler_initialised = false;
|
||||
static bool scrobbler_ata_callback = false;
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
static time_t timestamp;
|
||||
#else
|
||||
static unsigned long timestamp;
|
||||
|
@ -92,7 +92,7 @@ static void write_cache(void)
|
|||
{
|
||||
fdprintf(scrobbler_fd, "#AUDIOSCROBBLER/%s\n", SCROBBLER_VERSION);
|
||||
fdprintf(scrobbler_fd, "#TZ/UNKNOWN\n");
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
fdprintf(scrobbler_fd,
|
||||
"#CLIENT/Rockbox " TARGET_NAME SCROBBLER_REVISION "\n");
|
||||
#else
|
||||
|
@ -207,7 +207,7 @@ void scrobbler_change_event(struct mp3entry *id)
|
|||
{
|
||||
logf("SCROBBLER: add pending");
|
||||
copy_mp3entry(&scrobbler_entry, id);
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
timestamp = mktime(get_time());
|
||||
#else
|
||||
timestamp = 0;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "gwps.h"
|
||||
#include "abrepeat.h"
|
||||
#include "statusbar.h"
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
#include "timefuncs.h"
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
|
@ -46,7 +46,7 @@ bool valid_time(const struct tm *tm)
|
|||
struct tm *get_time(void)
|
||||
{
|
||||
#ifndef SIMULATOR
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
static long timeout = 0;
|
||||
|
||||
/* Don't read the RTC more than once per second */
|
||||
|
@ -95,7 +95,7 @@ struct tm *get_time(void)
|
|||
|
||||
int set_time(const struct tm *tm)
|
||||
{
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
int rc;
|
||||
char rtcbuf[7];
|
||||
|
||||
|
|
|
@ -943,7 +943,7 @@ static void fat_time(unsigned short* date,
|
|||
unsigned short* time,
|
||||
unsigned short* tenth )
|
||||
{
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
struct tm* tm = get_time();
|
||||
|
||||
if (date)
|
||||
|
@ -1506,7 +1506,7 @@ static int update_short_entry( struct fat_file* file, long size, int attr )
|
|||
*sizeptr = htole32(size);
|
||||
|
||||
{
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
unsigned short time = 0;
|
||||
unsigned short date = 0;
|
||||
#else
|
||||
|
|
|
@ -242,6 +242,10 @@
|
|||
#define CONFIG_CHARGING 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RTC
|
||||
#define CONFIG_RTC 0
|
||||
#endif
|
||||
|
||||
/* Enable the directory cache and tagcache in RAM if we have
|
||||
* plenty of RAM. Both features can be enabled independently. */
|
||||
#if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "system.h"
|
||||
#include "config.h"
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
#if CONFIG_RTC
|
||||
|
||||
extern const int dayname[];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue