(empty log message)
@@ -74,7 +74,7 @@ | ||
74 | 74 | /** |
75 | 75 | * @brief Lookup table for CRC-7 ( based on polynomial x^7 + x^3 + 1). |
76 | 76 | */ |
77 | -static const uint8_t crc7_lookup_table[256] = { | |
77 | +static const uint8_t mmc_crc7_lookup_table[256] = { | |
78 | 78 | 0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53, |
79 | 79 | 0x6c, 0x65, 0x7e, 0x77, 0x19, 0x10, 0x0b, 0x02, 0x3d, 0x34, 0x2f, 0x26, |
80 | 80 | 0x51, 0x58, 0x43, 0x4a, 0x75, 0x7c, 0x67, 0x6e, 0x32, 0x3b, 0x20, 0x29, |
@@ -277,10 +277,10 @@ | ||
277 | 277 | * @param[in] len length of data |
278 | 278 | * @return Calculated CRC |
279 | 279 | */ |
280 | -static uint8_t crc7(uint8_t crc, const uint8_t *buffer, size_t len) { | |
280 | +static uint8_t mmc_crc7(uint8_t crc, const uint8_t *buffer, size_t len) { | |
281 | 281 | |
282 | 282 | while (len > 0U) { |
283 | - crc = crc7_lookup_table[(crc << 1) ^ (*buffer++)]; | |
283 | + crc = mmc_crc7_lookup_table[(crc << 1) ^ (*buffer++)]; | |
284 | 284 | len--; |
285 | 285 | } |
286 | 286 | return crc; |
@@ -290,10 +290,13 @@ | ||
290 | 290 | * @brief Waits an idle condition. |
291 | 291 | * |
292 | 292 | * @param[in] mmcp pointer to the @p MMCDriver object |
293 | + * @return The operation status. | |
294 | + * @retval HAL_SUCCESS if the operation succeeded. | |
295 | + * @retval HAL_FAILED if the operation failed. | |
293 | 296 | * |
294 | 297 | * @notapi |
295 | 298 | */ |
296 | -static void wait(MMCDriver *mmcp) { | |
299 | +static bool mmc_wait_idle(MMCDriver *mmcp) { | |
297 | 300 | int i; |
298 | 301 | uint8_t buf[4]; |
299 | 302 |
@@ -300,14 +303,14 @@ | ||
300 | 303 | for (i = 0; i < 16; i++) { |
301 | 304 | spiReceive(mmcp->config->spip, 1, buf); |
302 | 305 | if (buf[0] == 0xFFU) { |
303 | - return; | |
306 | + return HAL_SUCCESS; | |
304 | 307 | } |
305 | 308 | } |
306 | 309 | /* Looks like it is a long wait.*/ |
307 | - while (true) { | |
310 | + while (true) { /* todo timeout */ | |
308 | 311 | spiReceive(mmcp->config->spip, 1, buf); |
309 | 312 | if (buf[0] == 0xFFU) { |
310 | - break; | |
313 | + return HAL_SUCCESS; | |
311 | 314 | } |
312 | 315 | #if MMC_NICE_WAITING == TRUE |
313 | 316 | /* Trying to be nice with the other threads.*/ |
@@ -314,6 +317,8 @@ | ||
314 | 317 | osalThreadSleepMilliseconds(1); |
315 | 318 | #endif |
316 | 319 | } |
320 | + | |
321 | + return HAL_FAILED; | |
317 | 322 | } |
318 | 323 | |
319 | 324 | /** |
@@ -322,14 +327,19 @@ | ||
322 | 327 | * @param[in] mmcp pointer to the @p MMCDriver object |
323 | 328 | * @param[in] cmd the command id |
324 | 329 | * @param[in] arg the command argument |
330 | + * @return The operation status. | |
331 | + * @retval HAL_SUCCESS if the operation succeeded. | |
332 | + * @retval HAL_FAILED if the operation failed. | |
325 | 333 | * |
326 | 334 | * @notapi |
327 | 335 | */ |
328 | -static void send_hdr(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) { | |
336 | +static bool mmc_send_hdr(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) { | |
329 | 337 | uint8_t buf[6]; |
330 | 338 | |
331 | 339 | /* Wait for the bus to become idle if a write operation was in progress.*/ |
332 | - wait(mmcp); | |
340 | + if (mmc_wait_idle(mmcp) == HAL_FAILED) { | |
341 | + return HAL_FAILED; | |
342 | + } | |
333 | 343 | |
334 | 344 | buf[0] = (uint8_t)0x40U | cmd; |
335 | 345 | buf[1] = (uint8_t)(arg >> 24U); |
@@ -337,9 +347,11 @@ | ||
337 | 347 | buf[3] = (uint8_t)(arg >> 8U); |
338 | 348 | buf[4] = (uint8_t)arg; |
339 | 349 | /* Calculate CRC for command header, shift to right position, add stop bit.*/ |
340 | - buf[5] = ((crc7(0, buf, 5U) & 0x7FU) << 1U) | 0x01U; | |
350 | + buf[5] = ((mmc_crc7(0, buf, 5U) & 0x7FU) << 1U) | 0x01U; | |
341 | 351 | |
342 | 352 | spiSend(mmcp->config->spip, 6, buf); |
353 | + | |
354 | + return HAL_SUCCESS; | |
343 | 355 | } |
344 | 356 | |
345 | 357 | /** |
@@ -351,7 +363,7 @@ | ||
351 | 363 | * |
352 | 364 | * @notapi |
353 | 365 | */ |
354 | -static uint8_t recvr1(MMCDriver *mmcp) { | |
366 | +static uint8_t mmc_recvr1(MMCDriver *mmcp) { | |
355 | 367 | int i; |
356 | 368 | uint8_t r1[1]; |
357 | 369 |
@@ -374,10 +386,10 @@ | ||
374 | 386 | * |
375 | 387 | * @notapi |
376 | 388 | */ |
377 | -static uint8_t recvr3(MMCDriver *mmcp, uint8_t* buffer) { | |
389 | +static uint8_t mmc_recvr3(MMCDriver *mmcp, uint8_t* buffer) { | |
378 | 390 | uint8_t r1; |
379 | 391 | |
380 | - r1 = recvr1(mmcp); | |
392 | + r1 = mmc_recvr1(mmcp); | |
381 | 393 | spiReceive(mmcp->config->spip, 4, buffer); |
382 | 394 | |
383 | 395 | return r1; |
@@ -394,12 +406,12 @@ | ||
394 | 406 | * |
395 | 407 | * @notapi |
396 | 408 | */ |
397 | -static uint8_t send_command_R1(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) { | |
409 | +static uint8_t mmc_send_command_R1(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) { | |
398 | 410 | uint8_t r1; |
399 | 411 | |
400 | 412 | spiSelect(mmcp->config->spip); |
401 | - send_hdr(mmcp, cmd, arg); | |
402 | - r1 = recvr1(mmcp); | |
413 | + (void) mmc_send_hdr(mmcp, cmd, arg); /* todo */ | |
414 | + r1 = mmc_recvr1(mmcp); | |
403 | 415 | spiUnselect(mmcp->config->spip); |
404 | 416 | return r1; |
405 | 417 | } |
@@ -417,13 +429,13 @@ | ||
417 | 429 | * |
418 | 430 | * @notapi |
419 | 431 | */ |
420 | -static uint8_t send_command_R3(MMCDriver *mmcp, uint8_t cmd, uint32_t arg, | |
421 | - uint8_t *response) { | |
432 | +static uint8_t mmc_send_command_R3(MMCDriver *mmcp, uint8_t cmd, uint32_t arg, | |
433 | + uint8_t *response) { | |
422 | 434 | uint8_t r1; |
423 | 435 | |
424 | 436 | spiSelect(mmcp->config->spip); |
425 | - send_hdr(mmcp, cmd, arg); | |
426 | - r1 = recvr3(mmcp, response); | |
437 | + (void) mmc_send_hdr(mmcp, cmd, arg); /* todo */ | |
438 | + r1 = mmc_recvr3(mmcp, response); | |
427 | 439 | spiUnselect(mmcp->config->spip); |
428 | 440 | return r1; |
429 | 441 | } |
@@ -436,18 +448,18 @@ | ||
436 | 448 | * @param[out] cxd pointer to the CSD/CID buffer |
437 | 449 | * |
438 | 450 | * @return The operation status. |
439 | - * @retval HAL_SUCCESS the operation succeeded. | |
440 | - * @retval HAL_FAILED the operation failed. | |
451 | + * @retval HAL_SUCCESS if the operation succeeded. | |
452 | + * @retval HAL_FAILED if the operation failed. | |
441 | 453 | * |
442 | 454 | * @notapi |
443 | 455 | */ |
444 | -static bool read_CxD(MMCDriver *mmcp, uint8_t cmd, uint32_t cxd[4]) { | |
456 | +static bool mmc_read_CxD(MMCDriver *mmcp, uint8_t cmd, uint32_t cxd[4]) { | |
445 | 457 | unsigned i; |
446 | 458 | uint8_t *bp, buf[16]; |
447 | 459 | |
448 | 460 | spiSelect(mmcp->config->spip); |
449 | - send_hdr(mmcp, cmd, 0); | |
450 | - if (recvr1(mmcp) != 0x00U) { | |
461 | + (void) mmc_send_hdr(mmcp, cmd, 0); /* todo */ | |
462 | + if (mmc_recvr1(mmcp) != 0x00U) { | |
451 | 463 | spiUnselect(mmcp->config->spip); |
452 | 464 | return HAL_FAILED; |
453 | 465 | } |
@@ -483,7 +495,7 @@ | ||
483 | 495 | * |
484 | 496 | * @notapi |
485 | 497 | */ |
486 | -static void sync(MMCDriver *mmcp) { | |
498 | +static void mmc_wait_sync(MMCDriver *mmcp) { | |
487 | 499 | uint8_t buf[1]; |
488 | 500 | |
489 | 501 | spiSelect(mmcp->config->spip); |
@@ -580,9 +592,8 @@ | ||
580 | 592 | * @param[in] mmcp pointer to the @p MMCDriver object |
581 | 593 | * |
582 | 594 | * @return The operation status. |
583 | - * @retval HAL_SUCCESS the operation succeeded and the driver is now | |
584 | - * in the @p MMC_READY state. | |
585 | - * @retval HAL_FAILED the operation failed. | |
595 | + * @retval HAL_SUCCESS if the operation succeeded. | |
596 | + * @retval HAL_FAILED if the operation failed. | |
586 | 597 | * |
587 | 598 | * @api |
588 | 599 | */ |
@@ -606,7 +617,7 @@ | ||
606 | 617 | /* SPI mode selection.*/ |
607 | 618 | i = 0; |
608 | 619 | while (true) { |
609 | - if (send_command_R1(mmcp, MMCSD_CMD_GO_IDLE_STATE, 0) == 0x01U) { | |
620 | + if (mmc_send_command_R1(mmcp, MMCSD_CMD_GO_IDLE_STATE, 0) == 0x01U) { | |
610 | 621 | break; |
611 | 622 | } |
612 | 623 | if (++i >= MMC_CMD0_RETRY) { |
@@ -619,15 +630,15 @@ | ||
619 | 630 | addresses if possible. |
620 | 631 | This method is based on "How to support SDC Ver2 and high capacity cards" |
621 | 632 | by ElmChan.*/ |
622 | - if (send_command_R3(mmcp, MMCSD_CMD_SEND_IF_COND, | |
623 | - MMCSD_CMD8_PATTERN, r3) != 0x05U) { | |
633 | + if (mmc_send_command_R3(mmcp, MMCSD_CMD_SEND_IF_COND, | |
634 | + MMCSD_CMD8_PATTERN, r3) != 0x05U) { | |
624 | 635 | |
625 | 636 | /* Switch to SDHC mode.*/ |
626 | 637 | i = 0; |
627 | 638 | while (true) { |
628 | 639 | /*lint -save -e9007 [13.5] Side effect unimportant.*/ |
629 | - if ((send_command_R1(mmcp, MMCSD_CMD_APP_CMD, 0) <= 0x01U) && | |
630 | - (send_command_R3(mmcp, MMCSD_CMD_APP_OP_COND, 0x400001AAU, r3) == 0x00U)) { | |
640 | + if ((mmc_send_command_R1(mmcp, MMCSD_CMD_APP_CMD, 0) <= 0x01U) && | |
641 | + (mmc_send_command_R3(mmcp, MMCSD_CMD_APP_OP_COND, 0x400001AAU, r3) == 0x00U)) { | |
631 | 642 | /*lint -restore*/ |
632 | 643 | break; |
633 | 644 | } |
@@ -639,7 +650,7 @@ | ||
639 | 650 | } |
640 | 651 | |
641 | 652 | /* Execute dedicated read on OCR register */ |
642 | - (void) send_command_R3(mmcp, MMCSD_CMD_READ_OCR, 0, r3); | |
653 | + (void) mmc_send_command_R3(mmcp, MMCSD_CMD_READ_OCR, 0, r3); | |
643 | 654 | |
644 | 655 | /* Check if CCS is set in response. Card operates in block mode if set.*/ |
645 | 656 | if ((r3[0] & 0x40U) != 0U) { |
@@ -650,7 +661,7 @@ | ||
650 | 661 | /* Initialization.*/ |
651 | 662 | i = 0; |
652 | 663 | while (true) { |
653 | - uint8_t b = send_command_R1(mmcp, MMCSD_CMD_INIT, 0); | |
664 | + uint8_t b = mmc_send_command_R1(mmcp, MMCSD_CMD_INIT, 0); | |
654 | 665 | if (b == 0x00U) { |
655 | 666 | break; |
656 | 667 | } |
@@ -667,13 +678,13 @@ | ||
667 | 678 | spiStart(mmcp->config->spip, mmcp->config->hscfg); |
668 | 679 | |
669 | 680 | /* Setting block size.*/ |
670 | - if (send_command_R1(mmcp, MMCSD_CMD_SET_BLOCKLEN, | |
671 | - MMCSD_BLOCK_SIZE) != 0x00U) { | |
681 | + if (mmc_send_command_R1(mmcp, MMCSD_CMD_SET_BLOCKLEN, | |
682 | + MMCSD_BLOCK_SIZE) != 0x00U) { | |
672 | 683 | goto failed; |
673 | 684 | } |
674 | 685 | |
675 | 686 | /* Determine capacity.*/ |
676 | - if (read_CxD(mmcp, MMCSD_CMD_SEND_CSD, mmcp->csd)) { | |
687 | + if (mmc_read_CxD(mmcp, MMCSD_CMD_SEND_CSD, mmcp->csd)) { | |
677 | 688 | goto failed; |
678 | 689 | } |
679 | 690 |
@@ -682,7 +693,7 @@ | ||
682 | 693 | goto failed; |
683 | 694 | } |
684 | 695 | |
685 | - if (read_CxD(mmcp, MMCSD_CMD_SEND_CID, mmcp->cid)) { | |
696 | + if (mmc_read_CxD(mmcp, MMCSD_CMD_SEND_CID, mmcp->cid)) { | |
686 | 697 | goto failed; |
687 | 698 | } |
688 | 699 |
@@ -702,9 +713,8 @@ | ||
702 | 713 | * @param[in] mmcp pointer to the @p MMCDriver object |
703 | 714 | * @return The operation status. |
704 | 715 | * |
705 | - * @retval HAL_SUCCESS the operation succeeded and the driver is now | |
706 | - * in the @p MMC_INSERTED state. | |
707 | - * @retval HAL_FAILED the operation failed. | |
716 | + * @retval HAL_SUCCESS if the operation succeeded. | |
717 | + * @retval HAL_FAILED if the operation failed. | |
708 | 718 | * |
709 | 719 | * @api |
710 | 720 | */ |
@@ -724,7 +734,7 @@ | ||
724 | 734 | |
725 | 735 | /* Wait for the pending write operations to complete.*/ |
726 | 736 | spiStart(mmcp->config->spip, mmcp->config->hscfg); |
727 | - sync(mmcp); | |
737 | + mmc_wait_sync(mmcp); | |
728 | 738 | |
729 | 739 | spiStop(mmcp->config->spip); |
730 | 740 | mmcp->state = BLK_ACTIVE; |
@@ -738,8 +748,8 @@ | ||
738 | 748 | * @param[in] startblk first block to read |
739 | 749 | * |
740 | 750 | * @return The operation status. |
741 | - * @retval HAL_SUCCESS the operation succeeded. | |
742 | - * @retval HAL_FAILED the operation failed. | |
751 | + * @retval HAL_SUCCESS if the operation succeeded. | |
752 | + * @retval HAL_FAILED if the operation failed. | |
743 | 753 | * |
744 | 754 | * @api |
745 | 755 | */ |
@@ -757,13 +767,13 @@ | ||
757 | 767 | spiSelect(mmcp->config->spip); |
758 | 768 | |
759 | 769 | if (mmcp->block_addresses) { |
760 | - send_hdr(mmcp, MMCSD_CMD_READ_MULTIPLE_BLOCK, startblk); | |
770 | + (void) mmc_send_hdr(mmcp, MMCSD_CMD_READ_MULTIPLE_BLOCK, startblk); /* todo */ | |
761 | 771 | } |
762 | 772 | else { |
763 | - send_hdr(mmcp, MMCSD_CMD_READ_MULTIPLE_BLOCK, startblk * MMCSD_BLOCK_SIZE); | |
773 | + (void) mmc_send_hdr(mmcp, MMCSD_CMD_READ_MULTIPLE_BLOCK, startblk * MMCSD_BLOCK_SIZE); /* todo */ | |
764 | 774 | } |
765 | 775 | |
766 | - if (recvr1(mmcp) != 0x00U) { | |
776 | + if (mmc_recvr1(mmcp) != 0x00U) { | |
767 | 777 | spiStop(mmcp->config->spip); |
768 | 778 | mmcp->state = BLK_READY; |
769 | 779 | return HAL_FAILED; |
@@ -778,8 +788,8 @@ | ||
778 | 788 | * @param[out] buffer pointer to the read buffer |
779 | 789 | * |
780 | 790 | * @return The operation status. |
781 | - * @retval HAL_SUCCESS the operation succeeded. | |
782 | - * @retval HAL_FAILED the operation failed. | |
791 | + * @retval HAL_SUCCESS if the operation succeeded. | |
792 | + * @retval HAL_FAILED if the operation failed. | |
783 | 793 | * |
784 | 794 | * @api |
785 | 795 | */ |
@@ -814,8 +824,8 @@ | ||
814 | 824 | * @param[in] mmcp pointer to the @p MMCDriver object |
815 | 825 | * |
816 | 826 | * @return The operation status. |
817 | - * @retval HAL_SUCCESS the operation succeeded. | |
818 | - * @retval HAL_FAILED the operation failed. | |
827 | + * @retval HAL_SUCCESS if the operation succeeded. | |
828 | + * @retval HAL_FAILED if the operation failed. | |
819 | 829 | * |
820 | 830 | * @api |
821 | 831 | */ |
@@ -831,9 +841,9 @@ | ||
831 | 841 | } |
832 | 842 | |
833 | 843 | spiSend(mmcp->config->spip, sizeof(stopcmd), stopcmd); |
834 | -/* result = recvr1(mmcp) != 0x00U;*/ | |
844 | +/* result = mmc_recvr1(mmcp) != 0x00U;*/ | |
835 | 845 | /* Note, ignored r1 response, it can be not zero, unknown issue.*/ |
836 | - (void) recvr1(mmcp); | |
846 | + (void) mmc_recvr1(mmcp); | |
837 | 847 | |
838 | 848 | /* Read operation finished.*/ |
839 | 849 | spiUnselect(mmcp->config->spip); |
@@ -848,8 +858,8 @@ | ||
848 | 858 | * @param[in] startblk first block to write |
849 | 859 | * |
850 | 860 | * @return The operation status. |
851 | - * @retval HAL_SUCCESS the operation succeeded. | |
852 | - * @retval HAL_FAILED the operation failed. | |
861 | + * @retval HAL_SUCCESS if the operation succeeded. | |
862 | + * @retval HAL_FAILED if the operation failed. | |
853 | 863 | * |
854 | 864 | * @api |
855 | 865 | */ |
@@ -864,14 +874,14 @@ | ||
864 | 874 | spiStart(mmcp->config->spip, mmcp->config->hscfg); |
865 | 875 | spiSelect(mmcp->config->spip); |
866 | 876 | if (mmcp->block_addresses) { |
867 | - send_hdr(mmcp, MMCSD_CMD_WRITE_MULTIPLE_BLOCK, startblk); | |
877 | + (void) mmc_send_hdr(mmcp, MMCSD_CMD_WRITE_MULTIPLE_BLOCK, startblk); /* todo */ | |
868 | 878 | } |
869 | 879 | else { |
870 | - send_hdr(mmcp, MMCSD_CMD_WRITE_MULTIPLE_BLOCK, | |
871 | - startblk * MMCSD_BLOCK_SIZE); | |
880 | + (void) mmc_send_hdr(mmcp, MMCSD_CMD_WRITE_MULTIPLE_BLOCK, | |
881 | + startblk * MMCSD_BLOCK_SIZE); /* todo */ | |
872 | 882 | } |
873 | 883 | |
874 | - if (recvr1(mmcp) != 0x00U) { | |
884 | + if (mmc_recvr1(mmcp) != 0x00U) { | |
875 | 885 | spiStop(mmcp->config->spip); |
876 | 886 | mmcp->state = BLK_READY; |
877 | 887 | return HAL_FAILED; |
@@ -886,8 +896,8 @@ | ||
886 | 896 | * @param[out] buffer pointer to the write buffer |
887 | 897 | * |
888 | 898 | * @return The operation status. |
889 | - * @retval HAL_SUCCESS the operation succeeded. | |
890 | - * @retval HAL_FAILED the operation failed. | |
899 | + * @retval HAL_SUCCESS if the operation succeeded. | |
900 | + * @retval HAL_FAILED if the operation failed. | |
891 | 901 | * |
892 | 902 | * @api |
893 | 903 | */ |
@@ -906,8 +916,7 @@ | ||
906 | 916 | spiIgnore(mmcp->config->spip, 2); /* CRC ignored. */ |
907 | 917 | spiReceive(mmcp->config->spip, 1, b); |
908 | 918 | if ((b[0] & 0x1FU) == 0x05U) { |
909 | - wait(mmcp); | |
910 | - return HAL_SUCCESS; | |
919 | + return mmc_wait_idle(mmcp); | |
911 | 920 | } |
912 | 921 | |
913 | 922 | /* Error.*/ |
@@ -923,8 +932,8 @@ | ||
923 | 932 | * @param[in] mmcp pointer to the @p MMCDriver object |
924 | 933 | * |
925 | 934 | * @return The operation status. |
926 | - * @retval HAL_SUCCESS the operation succeeded. | |
927 | - * @retval HAL_FAILED the operation failed. | |
935 | + * @retval HAL_SUCCESS if the operation succeeded. | |
936 | + * @retval HAL_FAILED if the operation failed. | |
928 | 937 | * |
929 | 938 | * @api |
930 | 939 | */ |
@@ -951,8 +960,8 @@ | ||
951 | 960 | * @param[in] mmcp pointer to the @p MMCDriver object |
952 | 961 | * |
953 | 962 | * @return The operation status. |
954 | - * @retval HAL_SUCCESS the operation succeeded. | |
955 | - * @retval HAL_FAILED the operation failed. | |
963 | + * @retval HAL_SUCCESS if the operation succeeded. | |
964 | + * @retval HAL_FAILED if the operation failed. | |
956 | 965 | * |
957 | 966 | * @api |
958 | 967 | */ |
@@ -968,7 +977,7 @@ | ||
968 | 977 | mmcp->state = BLK_SYNCING; |
969 | 978 | |
970 | 979 | spiStart(mmcp->config->spip, mmcp->config->hscfg); |
971 | - sync(mmcp); | |
980 | + mmc_wait_sync(mmcp); | |
972 | 981 | |
973 | 982 | /* Synchronization operation finished.*/ |
974 | 983 | mmcp->state = BLK_READY; |
@@ -982,8 +991,8 @@ | ||
982 | 991 | * @param[out] bdip pointer to a @p BlockDeviceInfo structure |
983 | 992 | * |
984 | 993 | * @return The operation status. |
985 | - * @retval HAL_SUCCESS the operation succeeded. | |
986 | - * @retval HAL_FAILED the operation failed. | |
994 | + * @retval HAL_SUCCESS if the operation succeeded. | |
995 | + * @retval HAL_FAILED if the operation failed. | |
987 | 996 | * |
988 | 997 | * @api |
989 | 998 | */ |
@@ -1009,8 +1018,8 @@ | ||
1009 | 1018 | * @param[in] endblk ending block number |
1010 | 1019 | * |
1011 | 1020 | * @return The operation status. |
1012 | - * @retval HAL_SUCCESS the operation succeeded. | |
1013 | - * @retval HAL_FAILED the operation failed. | |
1021 | + * @retval HAL_SUCCESS if the operation succeeded. | |
1022 | + * @retval HAL_FAILED if the operation failed. | |
1014 | 1023 | * |
1015 | 1024 | * @api |
1016 | 1025 | */ |
@@ -1027,15 +1036,15 @@ | ||
1027 | 1036 | endblk *= MMCSD_BLOCK_SIZE; |
1028 | 1037 | } |
1029 | 1038 | |
1030 | - if (send_command_R1(mmcp, MMCSD_CMD_ERASE_RW_BLK_START, startblk) != 0x00U) { | |
1039 | + if (mmc_send_command_R1(mmcp, MMCSD_CMD_ERASE_RW_BLK_START, startblk) != 0x00U) { | |
1031 | 1040 | goto failed; |
1032 | 1041 | } |
1033 | 1042 | |
1034 | - if (send_command_R1(mmcp, MMCSD_CMD_ERASE_RW_BLK_END, endblk) != 0x00U) { | |
1043 | + if (mmc_send_command_R1(mmcp, MMCSD_CMD_ERASE_RW_BLK_END, endblk) != 0x00U) { | |
1035 | 1044 | goto failed; |
1036 | 1045 | } |
1037 | 1046 | |
1038 | - if (send_command_R1(mmcp, MMCSD_CMD_ERASE, 0) != 0x00U) { | |
1047 | + if (mmc_send_command_R1(mmcp, MMCSD_CMD_ERASE, 0) != 0x00U) { | |
1039 | 1048 | goto failed; |
1040 | 1049 | } |
1041 | 1050 |