X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Flpc%2Fao_spi_lpc.c;h=ec48e95c386eeec40a1f90b936606aa22193fede;hb=e80a45c1565b14479e3a4cfc968d49b13cef4fe0;hp=f091c89c570963542f602c0e7f6d8957116895d4;hpb=f9f235bce84df3a6c0261e9d256aac544f87f70f;p=fw%2Faltos diff --git a/src/lpc/ao_spi_lpc.c b/src/lpc/ao_spi_lpc.c index f091c89c..ec48e95c 100644 --- a/src/lpc/ao_spi_lpc.c +++ b/src/lpc/ao_spi_lpc.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -29,7 +30,7 @@ static struct lpc_ssp * const ao_lpc_ssp[LPC_NUM_SPI] = { &lpc_ssp0, &lpc_ssp1 } while ((lpc_ssp->sr & (1 << LPC_SSP_SR_RNE)) == 0) \ ; \ /* receive a byte */ \ - get lpc_ssp->dr; \ + get (uint8_t) lpc_ssp->dr; \ } \ /* Wait for the SSP to go idle (it already should be) */ \ while (lpc_ssp->sr & (1 << LPC_SSP_SR_BSY)); \ @@ -146,7 +147,7 @@ ao_spi_init(void) lpc_scb.ssp0clkdiv = 1; /* Reset the device */ - lpc_scb.presetctrl &= ~(1 << LPC_SCB_PRESETCTRL_SSP0_RST_N); + lpc_scb.presetctrl &= ~(1UL << LPC_SCB_PRESETCTRL_SSP0_RST_N); lpc_scb.presetctrl |= (1 << LPC_SCB_PRESETCTRL_SSP0_RST_N); ao_spi_channel_init(0); #endif @@ -196,7 +197,7 @@ ao_spi_init(void) lpc_scb.ssp1clkdiv = 1; /* Reset the device */ - lpc_scb.presetctrl &= ~(1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); + lpc_scb.presetctrl &= ~(1UL << LPC_SCB_PRESETCTRL_SSP1_RST_N); lpc_scb.presetctrl |= (1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); ao_spi_channel_init(1); #endif /* HAS_SPI_1 */