add proper dummy storage implementation for sims
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18977 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
86f0c75cde
commit
8d68a567e4
3 changed files with 142 additions and 91 deletions
|
@ -122,6 +122,8 @@ drivers/fat.c
|
|||
#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
|
||||
hotswap.c
|
||||
#endif
|
||||
#else /* SIMULATOR */
|
||||
storage-sim.c
|
||||
#endif /* SIMULATOR */
|
||||
|
||||
/* EEPROM */
|
||||
|
|
|
@ -175,98 +175,29 @@ struct storage_info
|
|||
|
||||
#endif /* NOT CONFIG_STORAGE_MULTI */
|
||||
#else /*NOT SIMULATOR */
|
||||
static inline void storage_enable(bool on)
|
||||
{
|
||||
(void)on;
|
||||
}
|
||||
static inline void storage_sleep(void)
|
||||
{
|
||||
}
|
||||
static inline void storage_sleepnow(void)
|
||||
{
|
||||
}
|
||||
static inline bool storage_disk_is_active(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int storage_hard_reset(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int storage_soft_reset(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int storage_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void storage_close(void)
|
||||
{
|
||||
}
|
||||
static inline int storage_read_sectors(int drive, unsigned long start, int count, void* buf)
|
||||
{
|
||||
(void)drive;
|
||||
(void)start;
|
||||
(void)count;
|
||||
(void)buf;
|
||||
return 0;
|
||||
}
|
||||
static inline int storage_write_sectors(int drive, unsigned long start, int count, const void* buf)
|
||||
{
|
||||
(void)drive;
|
||||
(void)start;
|
||||
(void)count;
|
||||
(void)buf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void storage_spin(void)
|
||||
{
|
||||
}
|
||||
static inline void storage_spindown(int seconds)
|
||||
{
|
||||
(void)seconds;
|
||||
}
|
||||
|
||||
void storage_enable(bool on);
|
||||
void storage_sleep(void);
|
||||
void storage_sleepnow(void);
|
||||
bool storage_disk_is_active(void);
|
||||
int storage_hard_reset(void);
|
||||
int storage_soft_reset(void);
|
||||
int storage_init(void);
|
||||
void storage_close(void);
|
||||
int storage_read_sectors(int drive, unsigned long start, int count, void* buf);
|
||||
int storage_write_sectors(int drive, unsigned long start, int count, const void* buf);
|
||||
void storage_spin(void);
|
||||
void storage_spindown(int seconds);
|
||||
#if (CONFIG_LED == LED_REAL)
|
||||
static inline void storage_set_led_enabled(bool enabled)
|
||||
{
|
||||
(void)enabled;
|
||||
}
|
||||
#endif /*LED*/
|
||||
|
||||
static inline long storage_last_disk_activity(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int storage_spinup_time(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef STORAGE_GET_INFO
|
||||
static inline void storage_get_info(int drive, struct storage_info *info)
|
||||
{
|
||||
(void)drive;
|
||||
(void)info;
|
||||
}
|
||||
void storage_set_led_enabled(bool enabled);
|
||||
#endif
|
||||
long storage_last_disk_activity(void);
|
||||
int storage_spinup_time(void);
|
||||
#ifdef STORAGE_GET_INFO
|
||||
void storage_get_info(int drive, struct storage_info *info);
|
||||
#endif
|
||||
#ifdef HOTSWAP
|
||||
bool storage_removable(int drive);
|
||||
bool storage_present(int drive);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_HOTSWAP
|
||||
static inline bool storage_removable(int drive)
|
||||
{
|
||||
(void)drive;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool storage_present(int drive)
|
||||
{
|
||||
(void)drive;
|
||||
return 0;
|
||||
}
|
||||
#endif /* HOTSWAP */
|
||||
|
||||
#endif/*NOT SIMULATOR */
|
||||
#endif
|
||||
|
|
118
firmware/storage-sim.c
Normal file
118
firmware/storage-sim.c
Normal file
|
@ -0,0 +1,118 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id: $
|
||||
*
|
||||
* Copyright (C) 2008 by Frank Gevaerts
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#include "config.h" /* for HAVE_MULTIVOLUME or not */
|
||||
#include "storage.h"
|
||||
|
||||
#ifdef SIMULATOR
|
||||
void storage_enable(bool on)
|
||||
{
|
||||
(void)on;
|
||||
}
|
||||
void storage_sleep(void)
|
||||
{
|
||||
}
|
||||
void storage_sleepnow(void)
|
||||
{
|
||||
}
|
||||
bool storage_disk_is_active(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int storage_hard_reset(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int storage_soft_reset(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int storage_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void storage_close(void)
|
||||
{
|
||||
}
|
||||
int storage_read_sectors(int drive, unsigned long start, int count, void* buf)
|
||||
{
|
||||
(void)drive;
|
||||
(void)start;
|
||||
(void)count;
|
||||
(void)buf;
|
||||
return 0;
|
||||
}
|
||||
int storage_write_sectors(int drive, unsigned long start, int count, const void* buf)
|
||||
{
|
||||
(void)drive;
|
||||
(void)start;
|
||||
(void)count;
|
||||
(void)buf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void storage_spin(void)
|
||||
{
|
||||
}
|
||||
void storage_spindown(int seconds)
|
||||
{
|
||||
(void)seconds;
|
||||
}
|
||||
|
||||
#if (CONFIG_LED == LED_REAL)
|
||||
void storage_set_led_enabled(bool enabled)
|
||||
{
|
||||
(void)enabled;
|
||||
}
|
||||
#endif /*LED*/
|
||||
|
||||
long storage_last_disk_activity(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int storage_spinup_time(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef STORAGE_GET_INFO
|
||||
void storage_get_info(int drive, struct storage_info *info)
|
||||
{
|
||||
(void)drive;
|
||||
(void)info;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_HOTSWAP
|
||||
bool storage_removable(int drive)
|
||||
{
|
||||
(void)drive;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool storage_present(int drive)
|
||||
{
|
||||
(void)drive;
|
||||
return 0;
|
||||
}
|
||||
#endif /* HOTSWAP */
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue