Browse Source

Log: better way to check for -1 long portably

master
Andrew Tridgell 13 years ago
parent
commit
92471aead2
  1. 2
      ArduCopter/Log.pde
  2. 2
      ArduPlane/Log.pde

2
ArduCopter/Log.pde

@ -347,7 +347,7 @@ static int find_last_log_page(int bottom_page) @@ -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;

2
ArduPlane/Log.pde

@ -319,7 +319,7 @@ static int find_last_log_page(int bottom_page) @@ -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;

Loading…
Cancel
Save