Silabs - spi - style cosmetic changes for the last 2 commits

pull/1135/head
0xc0170 2015-05-26 08:44:28 +01:00
parent f0861ccda5
commit fc6ffc5819
1 changed files with 3 additions and 6 deletions

View File

@ -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;