1
0
Fork 0
forked from len0rd/rockbox

Replace references to HAVE_RTC with CONFIG_RTC and remove the HAVE_RTC defines from config-*.h

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8147 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2005-12-04 15:23:47 +00:00
parent 0ea71be348
commit 8c800cf59a
27 changed files with 48 additions and 62 deletions

View file

@ -23,7 +23,7 @@ bool debug_menu(void);
#ifndef SIMULATOR
extern bool dbg_ports(void);
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
extern bool dbg_rtc(void);
#endif
#endif

View file

@ -112,9 +112,9 @@ void gui_statusbar_init(struct gui_statusbar * bar)
void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
{
struct screen * display = bar->display;
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
struct tm* tm; /* For Time */
#endif /* HAVE_RTC */
#endif /* CONFIG_RTC */
#ifdef HAVE_LCD_CHARCELLS
(void)force_redraw; /* players always "redraw" */
@ -126,11 +126,11 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
bar->info.battery_safe = battery_level_safe();
#ifdef HAVE_LCD_BITMAP
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
tm = get_time();
bar->info.hour = tm->tm_hour;
bar->info.minute = tm->tm_min;
#endif /* HAVE_RTC */
#endif /* CONFIG_RTC */
bar->info.shuffle = global_settings.playlist_shuffle;
#ifdef HAS_BUTTON_HOLD
@ -257,9 +257,9 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
if (bar->info.keylockremote)
gui_statusbar_icon_lock_remote(display);
#endif
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
gui_statusbar_time(display, bar->info.hour, bar->info.minute);
#endif /* HAVE_RTC */
#endif /* CONFIG_RTC */
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
if(!display->has_disk_led && bar->info.led)
gui_statusbar_led(display);
@ -482,7 +482,7 @@ void gui_statusbar_led(struct screen * display)
}
#endif
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
/*
* Print time to status bar
*/

View file

@ -32,7 +32,7 @@
struct status_info {
int battlevel;
int volume;
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
int hour;
int minute;
#endif
@ -111,7 +111,7 @@ void gui_statusbar_icon_lock_remote(struct screen * display);
void gui_statusbar_led(struct screen * display);
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
void gui_statusbar_time(struct screen * display, int hour, int minute);
#endif

View file

@ -226,7 +226,7 @@ void init(void)
i2c_init();
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
rtc_init();
#endif
#ifdef HAVE_RTC_RAM

View file

@ -125,7 +125,7 @@ bool show_info(void)
output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */
#endif
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
{
struct tm* tm = get_time();
talk_id(VOICE_CURRENT_TIME, true);

View file

@ -154,7 +154,7 @@ char *create_numbered_filename(char *buffer, const char *path,
return buffer;
}
#ifdef HAVE_RTC
#ifdef 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. */
@ -175,7 +175,7 @@ char *create_datetime_filename(char *buffer, const char *path,
return buffer;
}
#endif /* HAVE_RTC */
#endif /* CONFIG_RTC */
/* Read (up to) a line of text from fd into buffer and return number of bytes
* read (which may be larger than the number of bytes stored in buffer). If
@ -300,7 +300,7 @@ void screen_dump(void)
static unsigned short line_block[BMP_LINESIZE/2];
#endif
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
create_datetime_filename(filename, "", "dump ", ".bmp");
#else
create_numbered_filename(filename, "", "dump_", ".bmp", 4);

View file

@ -30,7 +30,7 @@ void output_dyn_value(char *buf, int buf_size, int value,
char *create_numbered_filename(char *buffer, const char *path,
const char *prefix, const char *suffix,
int numberlen);
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
char *create_datetime_filename(char *buffer, const char *path,
const char *prefix, const char *suffix);
#endif

View file

@ -56,10 +56,10 @@ video.c
#endif
vu_meter.c
#ifdef HAVE_RTC /* Recorder models only */
#ifdef CONFIG_RTC /* Recorder models only */
calendar.c
clock.c
#endif /* #ifdef HAVE_RTC */
#endif /* #ifdef CONFIG_RTC */
#if CONFIG_KEYPAD != ONDIO_PAD
/* gradually bring in the ones not working yet */

View file

@ -87,7 +87,7 @@ enum plugin_status loop(void)
rb->splash(HZ, true, "Failed creating /battery.log");
break;
}
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
t = rb->get_time();
#else
{

View file

@ -230,7 +230,7 @@ struct counter values[]={
{"ydist", -6},
};
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
static unsigned char yminute[]={
53,53,52,52,51,50,49,47,46,44,42,40,38,36,34,32,29,27,25,23,21,19,17,16,14,13,12,11,11,10,10,10,11,11,12,13,14,16,17,19,21,23,25,27,29,31,34,36,38,40,42,44,46,47,49,50,51,52,52,53,
};
@ -277,7 +277,7 @@ static void addclock(void)
yminute[(i+1)%60]);
}
}
#endif /* HAVE_RTC */
#endif /* CONFIG_RTC */
#define DRAW_WIDTH (LCD_WIDTH + LETTER_WIDTH*2)
@ -330,7 +330,7 @@ static int scrollit(void)
yy += YADD;
xx+= DRAW_WIDTH/LETTERS_ON_SCREEN;
}
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
addclock();
#endif
rb->lcd_update();
@ -385,7 +385,7 @@ static int loopit(void)
x+= speed[xsanke&15] + values[NUM_XADD].num;
rb->lcd_clear_display();
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
addclock();
#endif
if(timeout) {

View file

@ -19,7 +19,7 @@
****************************************************************************/
#include "plugin.h"
#if defined(HAVE_LCD_BITMAP) && defined(HAVE_RTC)
#if defined(HAVE_LCD_BITMAP) && defined(CONFIG_RTC)
#include <timefuncs.h>
@ -69,7 +69,7 @@ static int calc_weekday( struct shown *shown )
static void calendar_init(struct today *today, struct shown *shown)
{
int w,h;
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
struct tm *tm;
#else
(void)today;
@ -81,7 +81,7 @@ static void calendar_init(struct today *today, struct shown *shown)
use_system_font = true;
}
rb->lcd_clear_display();
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
tm = rb->get_time();
today->mon = tm->tm_mon +1;
today->year = 2000+tm->tm_year%100;

View file

@ -78,7 +78,7 @@ Original release, featuring analog / digital modes and a few options.
#include "plugin.h"
#include "time.h"
#if defined(HAVE_LCD_BITMAP) && defined(HAVE_RTC)
#if defined(HAVE_LCD_BITMAP) && defined(CONFIG_RTC)
#define CLOCK_VERSION "2.60"

View file

@ -122,7 +122,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 HAVE_RTC
#ifdef CONFIG_RTC
extern void statusbar_time(int hour, int minute);
#endif
#if CONFIG_LED == LED_VIRTUAL

View file

@ -210,7 +210,7 @@ char *rec_create_filename(char *buffer)
else
strncpy(buffer, rec_base_directory, MAX_PATH);
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
create_datetime_filename(buffer, buffer, "R", REC_FILE_ENDING);
#else
create_numbered_filename(buffer, buffer, "rec_", REC_FILE_ENDING, 4);

View file

@ -624,7 +624,7 @@ void charging_splash(void)
#endif
#if defined(HAVE_LCD_BITMAP) && defined (HAVE_RTC)
#if defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC)
/* little helper function for voice output */
static void say_time(int cursorpos, const struct tm *tm)
@ -923,7 +923,7 @@ bool set_time_screen(const char* string, struct tm *tm)
lcd_set_drawmode(lastmode);
return false;
}
#endif /* defined(HAVE_LCD_BITMAP) && defined (HAVE_RTC) */
#endif /* defined(HAVE_LCD_BITMAP) && defined (CONFIG_RTC) */
#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
bool shutdown_screen(void)

View file

@ -41,7 +41,7 @@ extern bool quick_screen_f3(int button_enter);
#endif
extern bool quick_screen_quick(int button_enter);
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
bool set_time_screen(const char* string, struct tm *tm);
#endif

View file

@ -829,7 +829,7 @@ static bool battery_type(void)
#endif
#endif
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
static bool timedate_set(void)
{
struct tm tm;
@ -1682,7 +1682,7 @@ static bool disk_settings_menu(void)
}
#endif /* !HAVE_MMC */
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
static bool time_settings_menu(void)
{
int m;
@ -1748,7 +1748,7 @@ static bool system_settings_menu(void)
#ifndef HAVE_MMC
{ ID2P(LANG_DISK_MENU), disk_settings_menu },
#endif
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
{ ID2P(LANG_TIME_MENU), time_settings_menu },
#endif
{ ID2P(LANG_POWEROFF_IDLE), poweroff_idle_timer },

View file

@ -29,7 +29,7 @@
#include "gwps.h"
#include "abrepeat.h"
#include "statusbar.h"
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
#include "timefuncs.h"
#endif
#ifdef HAVE_LCD_BITMAP

View file

@ -97,11 +97,9 @@ drivers/mas.c
#ifdef IRIVER_H300_SERIES
drivers/pcf50606.c
#endif
#ifdef HAVE_RTC
#if CONFIG_RTC == RTC_M41ST84W
drivers/rtc.c
#endif
#endif
drivers/serial.c
#endif /* !SIMULATOR */
#ifdef HAVE_LCD_BITMAP

View file

@ -46,7 +46,7 @@ bool valid_time(const struct tm *tm)
struct tm *get_time(void)
{
#ifndef SIMULATOR
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
char rtcbuf[8];
/* We don't need the first byte, but we want the indexes in the
@ -84,7 +84,7 @@ struct tm *get_time(void)
int set_time(const struct tm *tm)
{
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
int rc;
int tmp;

View file

@ -1010,7 +1010,7 @@ static void fat_time(unsigned short* date,
unsigned short* time,
unsigned short* tenth )
{
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
struct tm* tm = get_time();
if (date)
@ -1092,7 +1092,7 @@ static void fat_time(unsigned short* date,
}
if (tenth)
*tenth = 0;
#endif /* HAVE_RTC */
#endif /* CONFIG_RTC */
}
static int write_long_name(struct fat_file* file,
@ -1529,7 +1529,7 @@ static int update_short_entry( struct fat_file* file, long size, int attr )
*sizeptr = htole32(size);
{
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
unsigned short time = 0;
unsigned short date = 0;
#else

View file

@ -17,7 +17,7 @@
*
****************************************************************************/
#include "config.h"
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
#include "i2c.h"
#include "rtc.h"
#include "kernel.h"

View file

@ -13,14 +13,11 @@
#define CONFIG_KEYPAD RECORDER_PAD
/* define this if you have a real-time clock */
#define HAVE_RTC 1
#define CONFIG_RTC RTC_M41ST84W
/* define this if you have RTC RAM available for settings */
#define HAVE_RTC_RAM 1
/* define this to the type of RTC hardware */
#define CONFIG_RTC RTC_M41ST84W
/* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF

View file

@ -8,14 +8,11 @@
#define HAVE_LCD_BITMAP 1
/* define this if you have a real-time clock */
#define HAVE_RTC 1
#define CONFIG_RTC RTC_M41ST84W
/* define this if you have RTC RAM available for settings */
#define HAVE_RTC_RAM 1
/* define this to the type of RTC hardware */
#define CONFIG_RTC RTC_M41ST84W
/* LCD dimensions */
#define LCD_WIDTH 128
#define LCD_HEIGHT 64

View file

@ -13,14 +13,11 @@
#define CONFIG_KEYPAD RECORDER_PAD
/* define this if you have a real-time clock */
#define HAVE_RTC 1
#define CONFIG_RTC RTC_M41ST84W
/* define this if you have RTC RAM available for settings */
#define HAVE_RTC_RAM 1
/* define this to the type of RTC hardware */
#define CONFIG_RTC RTC_M41ST84W
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x8000

View file

@ -13,14 +13,11 @@
#define CONFIG_KEYPAD RECORDER_PAD
/* define this if you have a real-time clock */
#define HAVE_RTC 1
#define CONFIG_RTC RTC_M41ST84W
/* define this if you have RTC RAM available for settings */
#define HAVE_RTC_RAM 1
/* define this to the type of RTC hardware */
#define CONFIG_RTC RTC_M41ST84W
/* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF

View file

@ -21,7 +21,7 @@
#include <stdbool.h>
#ifdef HAVE_RTC
#ifdef CONFIG_RTC
void rtc_init(void);
int rtc_read(unsigned char address);
int rtc_read_multiple(unsigned char address, unsigned char *buf, int numbytes);
@ -35,6 +35,6 @@ bool rtc_check_alarm_started(bool release_alarm);
bool rtc_check_alarm_flag(void);
#endif /* HAVE_ALARM_MOD */
#endif /* HAVE_RTC */
#endif /* CONFIG_RTC */
#endif