Mark some local variables with 'static'.
[kugel-rb.git] / uisimulator / common / stubs.c
bloba9011b9aa524095484980748433d4d3f02d5b50f
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Björn Stenberg <bjorn@haxx.se>
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 ****************************************************************************/
21 #include <stdio.h>
22 #include <time.h>
23 #include <stdbool.h>
24 #include "debug.h"
26 #include "screens.h"
27 #include "button.h"
29 #include "string.h"
30 #include "lcd.h"
32 #include "power.h"
34 #include "ata.h" /* for volume definitions */
36 static bool storage_spinning = false;
38 #if CONFIG_CODEC != SWCODEC
39 void audio_set_buffer_margin(int seconds)
41 (void)seconds;
43 #endif
45 int fat_startsector(void)
47 return 63;
50 bool fat_ismounted(int volume)
52 (void)volume;
53 return true;
56 int storage_spinup_time(void)
58 return 0;
61 int storage_init(void)
63 return 1;
66 int storage_write_sectors(IF_MV2(int drive,)
67 unsigned long start,
68 int count,
69 const void* buf)
71 IF_MV((void)drive;)
72 int i;
74 for (i=0; i<count; i++ ) {
75 FILE* f;
76 char name[32];
78 sprintf(name,"sector%lX.bin",start+i);
79 f=fopen(name,"wb");
80 if (f) {
81 fwrite(buf,512,1,f);
82 fclose(f);
85 return 1;
88 int storage_read_sectors(IF_MV2(int drive,)
89 unsigned long start,
90 int count,
91 void* buf)
93 IF_MV((void)drive;)
94 int i;
96 for (i=0; i<count; i++ ) {
97 FILE* f;
98 char name[32];
100 DEBUGF("Reading sector %lX\n",start+i);
101 sprintf(name,"sector%lX.bin",start+i);
102 f=fopen(name,"rb");
103 if (f) {
104 fread(buf,512,1,f);
105 fclose(f);
108 return 1;
111 void storage_spin(void)
113 storage_spinning = true;
116 void storage_sleep(void)
120 bool storage_disk_is_active(void)
122 return storage_spinning;
125 void storage_spindown(int s)
127 (void)s;
128 storage_spinning = false;
131 void rtc_init(void)
135 int rtc_read(int address)
137 return address ^ 0x55;
140 int rtc_write(int address, int value)
142 (void)address;
143 (void)value;
144 return 0;
147 int rtc_read_datetime(struct tm *tm)
149 time_t now = time(NULL);
150 *tm = *localtime(&now);
152 return 0;
155 int rtc_write_datetime(const struct tm *tm)
157 (void)tm;
158 return 0;
161 #ifdef HAVE_RTC_ALARM
162 void rtc_get_alarm(int *h, int *m)
164 *h = 11;
165 *m = 55;
168 void rtc_set_alarm(int h, int m)
170 (void)h;
171 (void)m;
174 void rtc_enable_alarm(bool enable)
176 (void)enable;
179 extern bool sim_alarm_wakeup;
180 bool rtc_check_alarm_started(bool release_alarm)
182 (void)release_alarm;
183 return sim_alarm_wakeup;
186 bool rtc_check_alarm_flag(void)
188 return true;
190 #endif
192 #ifdef HAVE_HEADPHONE_DETECTION
193 bool headphones_inserted(void)
195 return true;
197 #endif
199 #ifdef HAVE_SPDIF_POWER
200 void spdif_power_enable(bool on)
202 (void)on;
205 bool spdif_powered(void)
207 return false;
209 #endif
211 #ifdef ARCHOS_PLAYER
212 bool is_new_player(void)
214 extern char having_new_lcd;
215 return having_new_lcd;
217 #endif
219 #ifdef HAVE_USB_POWER
220 bool usb_powered(void)
222 return false;
225 bool usb_charging_enable(bool on)
227 (void)on;
228 return false;
230 #endif
232 #if CONFIG_CHARGING
233 bool charger_inserted(void)
235 return false;
238 bool power_input_present(void)
240 return false;
243 unsigned int power_input_status(void)
245 #ifdef HAVE_BATTERY_SWITCH
246 return POWER_INPUT_BATTERY;
247 #else
248 return POWER_INPUT_NONE;
249 #endif
252 bool charging_state(void)
254 return false;
256 #endif /* CONFIG_CHARGING */
258 #ifndef USB_NONE
259 bool usb_inserted(void)
261 return false;
263 #endif
265 #ifdef HAVE_REMOTE_LCD_TICKING
266 void lcd_remote_emireduce(bool state)
268 (void)state;
270 #endif
272 void lcd_set_contrast( int x )
274 (void)x;
277 void mpeg_set_pitch(int pitch)
279 (void)pitch;
282 static int sleeptime;
283 void set_sleep_timer(int seconds)
285 sleeptime = seconds;
288 int get_sleep_timer(void)
290 return sleeptime;
293 #ifdef HAVE_LCD_CHARCELLS
294 void lcd_clearrect (int x, int y, int nx, int ny)
296 /* Reprint char if you want to change anything */
297 (void)x;
298 (void)y;
299 (void)nx;
300 (void)ny;
303 void lcd_fillrect (int x, int y, int nx, int ny)
305 /* Reprint char if you want to change display anything */
306 (void)x;
307 (void)y;
308 (void)nx;
309 (void)ny;
311 #endif
313 void cpu_sleep(bool enabled)
315 (void)enabled;
318 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
319 void touchpad_set_sensitivity(int level)
321 (void)level;
323 #endif