diff options
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525v2.c')
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525v2.c | 16 |
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; | |||
342 | bool sd_enabled = false; | 342 | bool sd_enabled = false; |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | static struct wakeup transfer_completion_signal; | 345 | static struct semaphore transfer_completion_signal; |
346 | static struct wakeup command_completion_signal; | 346 | static struct semaphore command_completion_signal; |
347 | static volatile bool retry; | 347 | static volatile bool retry; |
348 | static volatile int cmd_error; | 348 | static 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 | ||