*
* @author David Gay
*/
-generic module ArbitratedReadC(typedef width_t) {
+generic module ArbitratedReadC(typedef width_t) @safe() {
provides interface Read<width_t>[uint8_t client];
uses {
interface Read<width_t> as Service[uint8_t client];
}
implementation {
command error_t Read.read[uint8_t client]() {
-#if 1
return call Resource.request[client]();
-#else
- signal Resource.granted[client]();
- return SUCCESS;
-#endif
}
event void Resource.granted[uint8_t client]() {
default async command error_t Resource.request[uint8_t client]() {
return FAIL;
}
- default async command void Resource.release[uint8_t client]() { }
+ default async command error_t Resource.release[uint8_t client]() { return FAIL; }
default event void Read.readDone[uint8_t client](error_t result, width_t data) { }
default command error_t Service.read[uint8_t client]() {
return SUCCESS;