From 96a0ff3c723efba275d33cd2d6e459a83b0a647c Mon Sep 17 00:00:00 2001 From: r-studio Date: Thu, 15 Apr 2010 12:10:54 +0000 Subject: [PATCH] Inserted a check into Resource.request() that controls if the current caller id has a granted signal pending. This will prevent the caller to be inserted into the request queue which makes sense because the caller is the next one to be granted the resource. This fixes a problem which prevented the RF230 driver from accessing the Spi bus when ActiveMessageAddress.changed() was signaled in the case of a ID change when using tosboot. This prevented the startup procedure to continue. --- tos/system/ArbiterP.nc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tos/system/ArbiterP.nc b/tos/system/ArbiterP.nc index b07f975d..bf66c2c5 100644 --- a/tos/system/ArbiterP.nc +++ b/tos/system/ArbiterP.nc @@ -81,6 +81,9 @@ implementation { state = RES_GRANTING; reqResId = id; } + else if (reqResId == id) { + return SUCCESS; + } else return call Queue.enqueue(id); } signal ResourceDefaultOwner.requested(); -- 2.39.2