diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/tcc780x/sd-tcc780x.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/target/arm/tcc780x/sd-tcc780x.c b/firmware/target/arm/tcc780x/sd-tcc780x.c index bb426d8125..222bb88a15 100644 --- a/firmware/target/arm/tcc780x/sd-tcc780x.c +++ b/firmware/target/arm/tcc780x/sd-tcc780x.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #define EC_TRAN_WRITE_ENTRY 9 | 50 | #define EC_TRAN_WRITE_ENTRY 9 |
51 | #define EC_TRAN_WRITE_EXIT 10 | 51 | #define EC_TRAN_WRITE_EXIT 10 |
52 | #define EC_COMMAND 11 | 52 | #define EC_COMMAND 11 |
53 | #define EC_WRITE_PROTECT 12 | ||
53 | 54 | ||
54 | /* for compatibility */ | 55 | /* for compatibility */ |
55 | static long last_disk_activity = -1; | 56 | static long last_disk_activity = -1; |
@@ -536,6 +537,12 @@ int sd_write_sectors(IF_MD2(int card_no,) unsigned long start, int count, | |||
536 | const unsigned char *buf_end; | 537 | const unsigned char *buf_end; |
537 | bool aligned; | 538 | bool aligned; |
538 | 539 | ||
540 | if ((card_no == CARD_NUM_SLOT) && (GPIOA & 0x10)) | ||
541 | { | ||
542 | /* write protect tab set */ | ||
543 | return -EC_WRITE_PROTECT; | ||
544 | } | ||
545 | |||
539 | mutex_lock(&sd_mtx); | 546 | mutex_lock(&sd_mtx); |
540 | sd_enable(true); | 547 | sd_enable(true); |
541 | led(true); | 548 | led(true); |