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.
Fork of mbed-dev by
Revision 108:af734d017ad0, committed 2016-04-26
- Comitter:
- dkato
- Date:
- Tue Apr 26 02:02:58 2016 +0000
- Parent:
- 107:52cd7fbf6629
- Commit message:
- bugfixs
Changed in this revision
--- a/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/objects.h Mon Apr 25 07:50:52 2016 +0000 +++ b/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/objects.h Tue Apr 26 02:02:58 2016 +0000 @@ -41,6 +41,7 @@ struct spi_s { struct st_rspi *spi; uint32_t bits; + int index; }; struct gpio_irq_s {
--- a/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/spi_api.c Mon Apr 25 07:50:52 2016 +0000 +++ b/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/spi_api.c Tue Apr 26 02:02:58 2016 +0000 @@ -321,7 +321,10 @@ spi_async_read(obj); } else { if (obj->rx_buff.buffer && obj->tx_buff.buffer && obj->tx_buff.pos < obj->tx_buff.length) { - spi_data[obj->spi.index].event = SPI_EVENT_COMPLETE; + spi_data[obj->spi.index].event = SPI_EVENT_INTERNAL_TRANSFER_COMPLETE; + if (spi_data[obj->spi.index].wanted_events & SPI_EVENT_COMPLETE) { + spi_data[obj->spi.index].event |= SPI_EVENT_COMPLETE; + } spi_irqs_set(obj, 0); spi_data[obj->spi.index].async_obj = NULL; ((void (*)())spi_data[obj->spi.index].async_callback)(); @@ -331,7 +334,10 @@ } if (obj->tx_buff.buffer) { if (obj->tx_buff.pos == obj->tx_buff.length) { - spi_data[obj->spi.index].event = SPI_EVENT_COMPLETE; + spi_data[obj->spi.index].event = SPI_EVENT_INTERNAL_TRANSFER_COMPLETE; + if (spi_data[obj->spi.index].wanted_events & SPI_EVENT_COMPLETE) { + spi_data[obj->spi.index].event |= SPI_EVENT_COMPLETE; + } spi_irqs_set(obj, 0); spi_data[obj->spi.index].async_obj = NULL; ((void (*)())spi_data[obj->spi.index].async_callback)(); @@ -340,7 +346,10 @@ } } else { if (obj->rx_buff.pos == obj->rx_buff.length) { - spi_data[obj->spi.index].event = SPI_EVENT_COMPLETE; + spi_data[obj->spi.index].event = SPI_EVENT_INTERNAL_TRANSFER_COMPLETE; + if (spi_data[obj->spi.index].wanted_events & SPI_EVENT_COMPLETE) { + spi_data[obj->spi.index].event |= SPI_EVENT_COMPLETE; + } spi_irqs_set(obj, 0); spi_data[obj->spi.index].async_obj = NULL; ((void (*)())spi_data[obj->spi.index].async_callback)();