diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/fsl_dspi.c | 17 | ||||
-rw-r--r-- | drivers/fsl_flexcan.c | 11 |
2 files changed, 19 insertions, 9 deletions
diff --git a/drivers/fsl_dspi.c b/drivers/fsl_dspi.c index 0da640a..cacb52a 100644 --- a/drivers/fsl_dspi.c +++ b/drivers/fsl_dspi.c @@ -1486,10 +1486,23 @@ void DSPI_SlaveTransferHandleIRQ(SPI_Type *base, dspi_slave_handle_t *handle) /* Decrease remaining receive byte count */ --handle->remainingReceiveByteCount; - if (handle->remainingSendByteCount == 0){ + if (handle->remainingSendByteCount == 0 && handle->rxData){ if ( *(handle->rxData - 2) == APALIS_TK1_K20_READ_INST) { base->PUSHR_SLAVE = registers[dataReceived]; + switch (dataReceived) + { + case APALIS_TK1_K20_IRQREG: + registers[APALIS_TK1_K20_IRQREG] = 0; + break; + case APALIS_TK1_K20_CANREG: + registers[APALIS_TK1_K20_CANREG] &= ~0x10; + break; + case APALIS_TK1_K20_CANREG + APALIS_TK1_K20_CAN_OFFSET: + registers[APALIS_TK1_K20_CANREG + + APALIS_TK1_K20_CAN_OFFSET] &= ~0x10; + break; + } } else { @@ -1505,7 +1518,7 @@ void DSPI_SlaveTransferHandleIRQ(SPI_Type *base, dspi_slave_handle_t *handle) } else { - dataSend = dataReceived; + dataSend = 0x44; } --handle->remainingSendByteCount; diff --git a/drivers/fsl_flexcan.c b/drivers/fsl_flexcan.c index 6c7e0bd..09add9e 100644 --- a/drivers/fsl_flexcan.c +++ b/drivers/fsl_flexcan.c @@ -1281,6 +1281,7 @@ void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle) /* Get current State of Message Buffer. */ switch (handle->mbState[result]) { +#if 0 /* Solve Rx Data Frame. */ case kFLEXCAN_StateRxData: status = FLEXCAN_ReadRxMb(base, result, handle->mbFrameBuf[result]); @@ -1300,19 +1301,15 @@ void FLEXCAN_TransferHandleIRQ(CAN_Type *base, flexcan_handle_t *handle) } FLEXCAN_TransferAbortReceive(base, handle, result); break; - +#endif + /* Solve Tx Remote Frame. */ + case kFLEXCAN_StateTxRemote: /* fall through */ /* Solve Tx Data Frame. */ case kFLEXCAN_StateTxData: status = kStatus_FLEXCAN_TxIdle; FLEXCAN_TransferAbortSend(base, handle, result); break; - /* Solve Tx Remote Frame. */ - case kFLEXCAN_StateTxRemote: - handle->mbState[result] = kFLEXCAN_StateRxRemote; - status = kStatus_FLEXCAN_TxSwitchToRx; - break; - default: status = kStatus_FLEXCAN_UnHandled; break; |