]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/stm25p/Stm25pSectorP.nc
Add SharedSplitControlC, for N clients needing shared access to something.
[tinyos-2.x.git] / tos / chips / stm25p / Stm25pSectorP.nc
index 383a71ed7a47041075bed2af03c879e6084f6379..2d9260ed30e8e4f443becdb80b3cfc5af688b4e1 100644 (file)
@@ -107,13 +107,15 @@ implementation {
     return FAIL;
   }
   
-  async command void ClientResource.release[ uint8_t id ]() {
+  async command error_t ClientResource.release[ uint8_t id ]() {
     if ( m_client == id ) {
       m_state = S_IDLE;
       m_client = NO_CLIENT;
       call SpiResource.release();
       call Stm25pResource.release[ id ]();
+      return SUCCESS;
     }
+    return FAIL;
   }
   
   event void Stm25pResource.granted[ uint8_t id ]() {
@@ -237,7 +239,7 @@ implementation {
     m_addr = addr;
     m_len = len;
     
-    return call Spi.computeCrc( crc, m_addr, m_len );
+    return call Spi.computeCrc( crc, physicalAddr( id, addr ), m_len );
     
   }