]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/atm128/spi/Atm128SpiP.nc
Merge over into the trunk.
[tinyos-2.x.git] / tos / chips / atm128 / spi / Atm128SpiP.nc
index 43b95f145ea74a9728bc2298e7bba1538c1f89cd..4187412442816726a8b9c791b2d6e4088c24066d 100644 (file)
@@ -126,10 +126,10 @@ implementation {
     call McuPowerState.update();
   }
   
-  async command void SpiByte.write( uint8_t tx, uint8_t* rx ) {
+  async command uint8_t SpiByte.write( uint8_t tx ) {
     call Spi.write( tx );
     while ( !( SPSR & 0x80 ) );
-    *rx = call Spi.read();
+    return call Spi.read();
   }
 
 
@@ -176,9 +176,9 @@ implementation {
     for (;tmpPos < (end - 1) ; tmpPos++) {
       uint8_t val;
       if (tx != NULL) 
-       call SpiByte.write( tx[tmpPos], &val );
+       val = call SpiByte.write( tx[tmpPos] );
       else
-       call SpiByte.write( 0, &val );
+       val = call SpiByte.write( 0 );
     
       if (rx != NULL) {
        rx[tmpPos] = val;
@@ -291,13 +291,14 @@ implementation {
    return call ResourceArbiter.request[ id ]();
  }
 
- async command void Resource.release[ uint8_t id ]() {
-   call ResourceArbiter.release[ id ]();
+ async command error_t Resource.release[ uint8_t id ]() {
+   error_t error = call ResourceArbiter.release[ id ]();
    atomic {
      if (!call ArbiterInfo.inUse()) {
        stopSpi();
      }
    }
+   return error;
  }
 
  async command uint8_t Resource.isOwner[uint8_t id]() {