From 6be00a6dd5032d7330d761a33f5b027658bab140 Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Fri, 23 Mar 2018 12:50:30 +0100 Subject: style and -wall fixes Signed-off-by: Dominik Sliwa --- drivers/fsl_dspi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/fsl_dspi.c') diff --git a/drivers/fsl_dspi.c b/drivers/fsl_dspi.c index cacb52a..66f8974 100644 --- a/drivers/fsl_dspi.c +++ b/drivers/fsl_dspi.c @@ -1482,11 +1482,8 @@ void DSPI_SlaveTransferHandleIRQ(SPI_Type *base, dspi_slave_handle_t *handle) /* Receive buffer is not null, store data into it */ *handle->rxData = dataReceived; ++handle->rxData; - } - /* Decrease remaining receive byte count */ - --handle->remainingReceiveByteCount; - if (handle->remainingSendByteCount == 0 && handle->rxData){ + if (handle->remainingSendByteCount == 0){ if ( *(handle->rxData - 2) == APALIS_TK1_K20_READ_INST) { base->PUSHR_SLAVE = registers[dataReceived]; @@ -1509,6 +1506,11 @@ void DSPI_SlaveTransferHandleIRQ(SPI_Type *base, dspi_slave_handle_t *handle) base->PUSHR_SLAVE = 0x55; } } + } + + /* Decrease remaining receive byte count */ + --handle->remainingReceiveByteCount; + if (handle->remainingSendByteCount > 0) { if (handle->txData) -- cgit v1.2.3