summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Sommer <soja-lists@aries.uberspace.de>2015-12-03 21:56:31 +0100
committerGedare Bloom <gedare@rtems.org>2015-12-12 20:22:03 -0500
commit687463d7f3b0abb1d98e6e630fb6d47541594bd4 (patch)
treed6764671647b359859b71c327087b7f8d72f35f7
parentarm/gba: Remove (diff)
downloadrtems-687463d7f3b0abb1d98e6e630fb6d47541594bd4.tar.bz2
Store task_id of the current thread for the ISR before waiting for the transient event
The ISR will send a transient event to the task specified in bus->taskid. Make sure that the correct task_id is written to this field before waiting for the transient event to arrive. Fixes #2483
-rw-r--r--c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c b/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c
index 14a2467001..6d9a2cdac6 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c
+++ b/c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c
@@ -92,6 +92,7 @@ static int rpi_i2c_bus_transfer(rpi_i2c_bus *bus)
/* Sleep until the TX FIFO has free space for a new write. */
if (
+ bus->task_id = rtems_task_self();
rtems_event_transient_receive(RTEMS_WAIT, bus->base.timeout) !=
RTEMS_SUCCESSFUL
) {