Log: better way to check for -1 long portably

This commit is contained in:
Andrew Tridgell 2011-11-08 07:53:06 +11:00
parent 6d0a32cc65
commit a045e4ec7e
2 changed files with 2 additions and 2 deletions

View File

@ -347,7 +347,7 @@ static int find_last_log_page(int bottom_page)
//Serial.printf("look page:%d, check:%d\n", look_page, check);
if(check == (int32_t)~0)
if(check == -1L)
top_page = look_page;
else
bottom_page = look_page;

View File

@ -319,7 +319,7 @@ static int find_last_log_page(int bottom_page)
look_page = (top_page + bottom_page) / 2;
DataFlash.StartRead(look_page);
check = DataFlash.ReadLong();
if(check == (int32_t)~0)
if(check == -1L)
top_page = look_page;
else
bottom_page = look_page;