Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Nucleo_L432KC_Quadrature_Decoder_with_ADC_and_DAC
Fork of mbed-dev by
Diff: targets/TARGET_NUVOTON/TARGET_M451/spi_api.c
- Revision:
- 153:fa9ff456f731
- Parent:
- 149:156823d33999
diff -r 9a67f0b066fc -r fa9ff456f731 targets/TARGET_NUVOTON/TARGET_M451/spi_api.c --- a/targets/TARGET_NUVOTON/TARGET_M451/spi_api.c Thu Dec 15 11:48:27 2016 +0000 +++ b/targets/TARGET_NUVOTON/TARGET_M451/spi_api.c Tue Dec 20 17:27:56 2016 +0000 @@ -709,7 +709,12 @@ { SPI_T *spi_base = (SPI_T *) NU_MODBASE(obj->spi.spi); - return ((spi_base->CTL & SPI_CTL_DWIDTH_Msk) >> SPI_CTL_DWIDTH_Pos); + uint32_t data_width = ((spi_base->CTL & SPI_CTL_DWIDTH_Msk) >> SPI_CTL_DWIDTH_Pos); + if (data_width == 0) { + data_width = 32; + } + + return data_width; } static int spi_is_tx_complete(spi_t *obj)