drivers: Disable priority inheritance on all semaphores used for signaling

This commit is contained in:
Gregory Nutt
2016-11-03 11:00:47 -06:00
parent bdde5720ca
commit 4fcbe8e410
20 changed files with 184 additions and 19 deletions
+9
View File
@@ -65,6 +65,7 @@
#include <nuttx/i2c/i2c_master.h>
#include <nuttx/wqueue.h>
#include <nuttx/semaphore.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/mxt.h>
@@ -1884,9 +1885,17 @@ int mxt_register(FAR struct i2c_master_s *i2c,
priv->i2c = i2c; /* Save the SPI device handle */
priv->lower = lower; /* Save the board configuration */
/* Initialize semaphores */
sem_init(&priv->devsem, 0, 1); /* Initialize device semaphore */
sem_init(&priv->waitsem, 0, 0); /* Initialize event wait semaphore */
/* The event wait semaphore is used for signaling and, hence, should not
* have priority inheritance enabled.
*/
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
/* Make sure that interrupts are disabled */
MXT_CLEAR(lower);