diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-11-09 19:51:32 +0100 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-11-28 11:06:57 +0100 |
commit | 3020f5caf0b09fcaf85b3b3fa84fdf688ba22cc0 (patch) | |
tree | 971e36ac2bbd28b534791ca07efeca9e762c614a /drivers/fsl_dspi.c | |
parent | 41a46914821b1ea72c6dd68b308a3740276139ee (diff) |
K20: can and spi fixesApalis-TK1_LXDE-Image_2.8b1.64-20171229Apalis-TK1_LXDE-Image_2.7b5-20171201
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'drivers/fsl_dspi.c')
-rw-r--r-- | drivers/fsl_dspi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/fsl_dspi.c b/drivers/fsl_dspi.c index e2b90ba..dcd93aa 100644 --- a/drivers/fsl_dspi.c +++ b/drivers/fsl_dspi.c @@ -29,6 +29,7 @@ */ #include "fsl_dspi.h" +#include "com_task.h" /******************************************************************************* * Definitions @@ -1465,10 +1466,18 @@ void DSPI_SlaveTransferHandleIRQ(SPI_Type *base, dspi_slave_handle_t *handle) { if (handle->rxData) { + if ((handle->totalByteCount - handle->remainingReceiveByteCount) == 1){ + if ( *(handle->rxData - 1) == APALIS_TK1_K20_BULK_WRITE_INST) { + handle->remainingReceiveByteCount += dataReceived; + handle->totalByteCount += dataReceived; + handle->remainingSendByteCount += dataReceived; + } + } /* Receive buffer is not null, store data into it */ *handle->rxData = dataReceived; ++handle->rxData; } + /* Descrease remaining receive byte count */ --handle->remainingReceiveByteCount; |