MMCSD_read & MMCSD_write function are not designed simple & readable

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • SITSW-6278
    • 10.01.00
    • 12.00.00
    • Hide
      am62xx-sk
      am62xx-sk-lp
      am62x-sip-sk
      am62a-sk
      am62p-sk
      am62d-evm
      Show
      am62xx-sk am62xx-sk-lp am62x-sip-sk am62a-sk am62p-sk am62d-evm

      The current MMCSD_read & MMCSD_write function, which are designed to support reading any buffer size, are not designed for simplicity & readability.

      The implementation looks like this:

      • If #blocks are greater than max #blocks, split the transactions as:
        • Loop for multiple transactions with max #blocks.
        • Separate if condition to handle the leftover blocks (< max #blocks).
      • Else, a single transaction for #blocks < max #blocks.

      There are too many branches here which makes the code unnecessarily complicated & unreadable.

      The implementation needs refactoring for simplicity, readability, and to show quality.

      One simple implementation is to club everything into a single loop with conditionally assigning the #blocks, buf, cmd for the transaction like shown in the attached file.

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-5768 - MMCSD_read & MMCSD_write function a...
                SYNCHRONIZED
                • Last Sync Date: