]> granicus.if.org Git - esp-idf/commitdiff
Use THRESH_DMA_TRANS define everywhere, make code match "smaller or equal" description
authorJeroen Domburg <jeroen@espressif.com>
Tue, 21 Feb 2017 10:27:56 +0000 (18:27 +0800)
committerJeroen Domburg <jeroen@espressif.com>
Tue, 21 Feb 2017 10:27:56 +0000 (18:27 +0800)
components/driver/spi_master.c

index 4f977c889eaf4ab056508b7f91c3e805de6fb6c6..17a68c32352b54938fd99ea4a6461283345c89ba 100644 (file)
@@ -600,7 +600,7 @@ static void IRAM_ATTR spi_intr(void *arg)
             } else {
                 data=trans->rx_buffer;
             }
-            if (trans->rxlength<THRESH_DMA_TRANS) {
+            if (trans->rxlength <= THRESH_DMA_TRANS) {
                 //No need for DMA; we'll copy the result out of the work registers directly later.
             } else {
                 host->hw->user.usr_miso_highpart=0;
@@ -625,7 +625,7 @@ static void IRAM_ATTR spi_intr(void *arg)
             } else {
                 data=(uint32_t *)trans->tx_buffer;
             }
-            if (trans->length < 8*32) {
+            if (trans->length <= THRESH_DMA_TRANS) {
                 //No need for DMA.
                 for (int x=0; x < trans->length; x+=32) {
                     //Use memcpy to get around alignment issues for txdata