]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Fix bug where seeking to the different sector did not properly skip
authorjwhui <jwhui>
Wed, 28 Nov 2007 03:15:30 +0000 (03:15 +0000)
committerjwhui <jwhui>
Wed, 28 Nov 2007 03:15:30 +0000 (03:15 +0000)
over the address header.

Thanks to Razvan ME for reporting the bug.

tos/chips/stm25p/Stm25pLogP.nc

index 208c436571609109c2b98630a831ae2f00a3c9ed..12019b56577ae8cf36c5c5a2ec71df7fbb361627 100644 (file)
@@ -243,9 +243,11 @@ implementation {
          m_log_info[ id ].read_addr = m_log_state[ id ].cookie & ~BLOCK_MASK;
          m_log_info[ id ].remaining = 0;
          m_rw_state = S_SEARCH_SEEK;
-         if ( m_log_info[ id ].read_addr != m_log_state[ id ].cookie )
+         if ( m_log_info[ id ].read_addr != m_log_state[ id ].cookie ) {
+           m_log_info[ id ].read_addr += sizeof( m_addr );
            call Sector.read[ id ]( calcAddr( id, m_log_info[ id ].read_addr ),
                                    &m_header, sizeof( m_header ) );
+         }
          else
            signalDone( id, SUCCESS );
        }