@@ -318,7 +318,7 @@ static uint32_t spi_master_transfer_handler(spi_t *obj)
318
318
req -> head_rem -= bytes_read ;
319
319
}
320
320
321
- // Figure out how many byte we have left to read
321
+ // Figure out how many bytes we have left to read
322
322
if (req -> head_rem > 0 ) {
323
323
remain = req -> head_rem ;
324
324
} else {
@@ -358,7 +358,7 @@ static uint32_t spi_master_transfer_handler(spi_t *obj)
358
358
// Send a 32 byte header
359
359
if (remain == SPI_MAX_BYTE_LEN ) {
360
360
361
- header |= (MXC_S_SPI_FIFO_UNIT_BYTES | ( req -> deass << MXC_F_SPI_FIFO_DASS_POS ) );
361
+ header |= (MXC_S_SPI_FIFO_UNIT_BYTES | MXC_F_SPI_FIFO_DASS );
362
362
363
363
// Save the number of bytes we need to write to the FIFO
364
364
bytes = SPI_MAX_BYTE_LEN ;
@@ -377,8 +377,8 @@ static uint32_t spi_master_transfer_handler(spi_t *obj)
377
377
}
378
378
379
379
// Check if this is the last header we will send
380
- if ((remain - bytes ) == 0 ) {
381
- header |= ( req -> deass << MXC_F_SPI_FIFO_DASS_POS ) ;
380
+ if ((remain - bytes ) == 0 ) {
381
+ header |= MXC_F_SPI_FIFO_DASS ;
382
382
}
383
383
}
384
384
@@ -388,9 +388,8 @@ static uint32_t spi_master_transfer_handler(spi_t *obj)
388
388
req -> head_rem = bytes ;
389
389
390
390
} else {
391
- // Send final header with the number of bytes remaining and if
392
- // we want to de-assert the SS at the end of the transaction
393
- header |= (MXC_S_SPI_FIFO_UNIT_BYTES | (remain << MXC_F_SPI_FIFO_SIZE_POS ) | (req -> deass << MXC_F_SPI_FIFO_DASS_POS ));
391
+ // Send final header with the number of bytes remaining and de-assert the SS at the end of the transaction
392
+ header |= (MXC_S_SPI_FIFO_UNIT_BYTES | (remain << MXC_F_SPI_FIFO_SIZE_POS ) | MXC_F_SPI_FIFO_DASS );
394
393
fifo -> trans_16 [0 ] = header ;
395
394
req -> head_rem = remain ;
396
395
}
@@ -472,7 +471,6 @@ void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx,
472
471
state [obj -> spi .index ] = & obj -> spi ;
473
472
474
473
// Initialize request info
475
- obj -> spi .deass = 1 ;
476
474
obj -> spi .tx_data = tx ;
477
475
obj -> spi .rx_data = rx ;
478
476
obj -> spi .len = tx_length ;
@@ -517,7 +515,7 @@ uint8_t spi_active(spi_t *obj)
517
515
mxc_spi_regs_t * spim = obj -> spi .spi ;
518
516
519
517
// Check to see if there are any ongoing transactions
520
- if ((state [obj -> spi .index ] == NULL ) &&
518
+ if ((state [obj -> spi .index ] == NULL ) &&
521
519
!(spim -> fifo_ctrl & MXC_F_SPI_FIFO_CTRL_TX_FIFO_USED )) {
522
520
return 0 ;
523
521
}
0 commit comments