mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-24 15:37:38 -04:00
D2: Obey the SD card write-protect tab
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22596 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
19a5dfea28
commit
db287c0971
1 changed files with 7 additions and 0 deletions
|
|
@ -50,6 +50,7 @@
|
||||||
#define EC_TRAN_WRITE_ENTRY 9
|
#define EC_TRAN_WRITE_ENTRY 9
|
||||||
#define EC_TRAN_WRITE_EXIT 10
|
#define EC_TRAN_WRITE_EXIT 10
|
||||||
#define EC_COMMAND 11
|
#define EC_COMMAND 11
|
||||||
|
#define EC_WRITE_PROTECT 12
|
||||||
|
|
||||||
/* for compatibility */
|
/* for compatibility */
|
||||||
static long last_disk_activity = -1;
|
static long last_disk_activity = -1;
|
||||||
|
|
@ -536,6 +537,12 @@ int sd_write_sectors(IF_MD2(int card_no,) unsigned long start, int count,
|
||||||
const unsigned char *buf_end;
|
const unsigned char *buf_end;
|
||||||
bool aligned;
|
bool aligned;
|
||||||
|
|
||||||
|
if ((card_no == CARD_NUM_SLOT) && (GPIOA & 0x10))
|
||||||
|
{
|
||||||
|
/* write protect tab set */
|
||||||
|
return -EC_WRITE_PROTECT;
|
||||||
|
}
|
||||||
|
|
||||||
mutex_lock(&sd_mtx);
|
mutex_lock(&sd_mtx);
|
||||||
sd_enable(true);
|
sd_enable(true);
|
||||||
led(true);
|
led(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue