mirror of https://github.com/ARMmbed/mbed-os.git
Silabs - spi - style cosmetic changes for the last 2 commits
parent
f0861ccda5
commit
fc6ffc5819
|
@ -770,14 +770,12 @@ static void spi_activate_dma(spi_t *obj, void* rxdata, void* txdata, int tx_leng
|
|||
/* Split up transfers if the tx length is larger than what the DMA supports. */
|
||||
const int DMA_MAX_TRANSFER = (_DMA_CTRL_N_MINUS_1_MASK >> _DMA_CTRL_N_MINUS_1_SHIFT);
|
||||
|
||||
if (tx_length > DMA_MAX_TRANSFER)
|
||||
{
|
||||
if (tx_length > DMA_MAX_TRANSFER) {
|
||||
uint32_t max_length = DMA_MAX_TRANSFER;
|
||||
|
||||
/* Make sure only an even amount of bytes are transferred
|
||||
if the width is larger than 8 bits. */
|
||||
if (obj->spi.bits > 8)
|
||||
{
|
||||
if (obj->spi.bits > 8) {
|
||||
max_length = DMA_MAX_TRANSFER - (DMA_MAX_TRANSFER & 0x01);
|
||||
}
|
||||
|
||||
|
@ -985,8 +983,7 @@ uint32_t spi_irq_handler_asynch(spi_t* obj)
|
|||
/* DMA implementation */
|
||||
|
||||
/* If there is still data in the TX buffer, setup a new transfer. */
|
||||
if (obj->tx_buff.pos < obj->tx_buff.length)
|
||||
{
|
||||
if (obj->tx_buff.pos < obj->tx_buff.length) {
|
||||
/* Find position and remaining length without modifying tx_buff. */
|
||||
void* tx_pointer = obj->tx_buff.buffer + obj->tx_buff.pos;
|
||||
uint32_t tx_length = obj->tx_buff.length - obj->tx_buff.pos;
|
||||
|
|
Loading…
Reference in New Issue