From d5cc9a41c40d240f0a1e57f0a8b637d026bf723c Mon Sep 17 00:00:00 2001 From: jwhui Date: Wed, 28 Nov 2007 03:15:30 +0000 Subject: [PATCH] Fix bug where seeking to the different sector did not properly skip over the address header. Thanks to Razvan ME for reporting the bug. --- tos/chips/stm25p/Stm25pLogP.nc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tos/chips/stm25p/Stm25pLogP.nc b/tos/chips/stm25p/Stm25pLogP.nc index 208c4365..12019b56 100644 --- a/tos/chips/stm25p/Stm25pLogP.nc +++ b/tos/chips/stm25p/Stm25pLogP.nc @@ -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 ); } -- 2.39.2