[Tinyos-devel] Bug in Stm25pLogP.nc
Chieh-Jan (Mike) Liang
cliang4 at cs.jhu.edu
Wed Jun 6 14:32:46 PDT 2007
Sorry, when I said "return FALSE", I actually meant "return TRUE".
Mike
Chieh-Jan (Mike) Liang wrote:
> Please correct me if I am wrong, but there is a bug in
> Sector.readDone[uint8_t id](...) in tos/chips/stm25p/Stm25pLogP.nc. The
> lines in question are:
>
> 320 uint8_t block = addr >> BLOCK_SIZE_LOG2;
> ...
> 329 if (++block < (call Sector.getNumSectors[ id ]()*BLOCKS_PER_SECTOR))
>
> block is 8-bit, or 0 - 255. In the extreme case, I can have my log
> volume occupy the whole STM25P flash (16 sectors), which would make the
> right-hand side of the condition 256. Therefore, line 329 will always
> return FALSE.
>
> My proposal is to change line 320 to "uint16_t block = (addr >>
> BLOCK_SIZE_LOG2) & 0xFF;"
>
> Thank you
>
> Mike
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
More information about the Tinyos-devel
mailing list