X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fchips%2Fstm25p%2FStm25pLogP.nc;fp=tos%2Fchips%2Fstm25p%2FStm25pLogP.nc;h=b63cf3f71f5baa507b20b7d2de2b3460337d1b89;hp=e454de79d88c27d03d5b8dafb4aca2e937632343;hb=f821ba09d2c769ef7ffe75103ed399c72b7f3c08;hpb=b4cefea4fe265ce3bead428c13f1435227016cee diff --git a/tos/chips/stm25p/Stm25pLogP.nc b/tos/chips/stm25p/Stm25pLogP.nc index e454de79..b63cf3f7 100644 --- a/tos/chips/stm25p/Stm25pLogP.nc +++ b/tos/chips/stm25p/Stm25pLogP.nc @@ -230,9 +230,9 @@ implementation { { // make sure the cookie is still within the range of valid data uint8_t numSectors = call Sector.getNumSectors[ id ](); - uint8_t readSector = + uint16_t readSector = (m_log_state[ id ].cookie >> STM25P_SECTOR_SIZE_LOG2); - uint8_t writeSector = + uint16_t writeSector = ((m_log_info[ id ].write_addr-1)>>STM25P_SECTOR_SIZE_LOG2)+1; // if cookie is overwritten, advance to beginning of log if ( (writeSector - readSector) > numSectors ) {