summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sd-as3525v2.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
commit12375d1d3aa41f7d277a9af584c7b810b636ec95 (patch)
treefc9ce8029a6910a8dac71b3bf60c71155a01eea4 /firmware/target/arm/as3525/sd-as3525v2.c
parent05e180a1308a095d51d51d0e047fcd44425ea88f (diff)
downloadrockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.gz
rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.zip
Merge functionality of wakeups and semaphores-- fewer APIs and object types. semaphore_wait takes a timeout now so codecs and plugins have to be made incompatible. Don't make semaphores for targets not using them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525v2.c')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 70d7c8fda1..b863337cbc 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -342,8 +342,8 @@ static struct event_queue sd_queue;
342bool sd_enabled = false; 342bool sd_enabled = false;
343#endif 343#endif
344 344
345static struct wakeup transfer_completion_signal; 345static struct semaphore transfer_completion_signal;
346static struct wakeup command_completion_signal; 346static struct semaphore command_completion_signal;
347static volatile bool retry; 347static volatile bool retry;
348static volatile int cmd_error; 348static volatile int cmd_error;
349 349
@@ -365,12 +365,12 @@ void INT_NAND(void)
365 retry = true; 365 retry = true;
366 366
367 if( status & (MCI_INT_DTO|MCI_DATA_ERROR)) 367 if( status & (MCI_INT_DTO|MCI_DATA_ERROR))
368 wakeup_signal(&transfer_completion_signal); 368 semaphore_release(&transfer_completion_signal);
369 369
370 cmd_error = status & MCI_CMD_ERROR; 370 cmd_error = status & MCI_CMD_ERROR;
371 371
372 if(status & MCI_INT_CD) 372 if(status & MCI_INT_CD)
373 wakeup_signal(&command_completion_signal); 373 semaphore_release(&command_completion_signal);
374 374
375 MCI_CTRL |= INT_ENABLE; 375 MCI_CTRL |= INT_ENABLE;
376} 376}
@@ -442,7 +442,7 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
442 _buttonlight_off(); 442 _buttonlight_off();
443 } 443 }
444#endif 444#endif
445 wakeup_wait(&command_completion_signal, TIMEOUT_BLOCK); 445 semaphore_wait(&command_completion_signal, TIMEOUT_BLOCK);
446 446
447 /* Handle command responses & errors */ 447 /* Handle command responses & errors */
448 if(flags & MCI_RESP) 448 if(flags & MCI_RESP)
@@ -769,8 +769,8 @@ int sd_init(void)
769 | (AS3525_SDSLOT_DIV << 2) 769 | (AS3525_SDSLOT_DIV << 2)
770 | 1; /* clock source = PLLA */ 770 | 1; /* clock source = PLLA */
771 771
772 wakeup_init(&transfer_completion_signal); 772 semaphore_init(&transfer_completion_signal, 1, 0);
773 wakeup_init(&command_completion_signal); 773 semaphore_init(&command_completion_signal, 1, 0);
774 774
775#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS) 775#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
776 if (amsv2_variant == 1) 776 if (amsv2_variant == 1)
@@ -932,7 +932,7 @@ sd_transfer_retry_with_reinit:
932 goto sd_transfer_error; 932 goto sd_transfer_error;
933 } 933 }
934 934
935 wakeup_wait(&transfer_completion_signal, TIMEOUT_BLOCK); 935 semaphore_wait(&transfer_completion_signal, TIMEOUT_BLOCK);
936 936
937 last_disk_activity = current_tick; 937 last_disk_activity = current_tick;
938 938