AP_GPS_MTK19: small bug fix re "==" vs "="

Also saved 22 bytes of RAM by moving error message into program space.
This commit is contained in:
rmackay9 2012-12-16 16:20:33 +09:00
parent d8ea210019
commit 2da0ef4183
1 changed files with 4 additions and 4 deletions

View File

@ -230,12 +230,12 @@ AP_GPS_MTK19::_detect(uint8_t data)
case 1:
if ((mtk_type_step1 == MTK_GPS_REVISION_V16) && (PREAMBLE2_V16 == data)){
step++;
mtk_type_step2 == MTK_GPS_REVISION_V16;
mtk_type_step2 = MTK_GPS_REVISION_V16;
break;
}
if ((mtk_type_step1 == MTK_GPS_REVISION_V19) && (PREAMBLE2_V19 == data)){
step++;
mtk_type_step2 == MTK_GPS_REVISION_V19;
mtk_type_step2 = MTK_GPS_REVISION_V19;
break;
}
mtk_type_step1 = 0;
@ -257,7 +257,7 @@ AP_GPS_MTK19::_detect(uint8_t data)
case 4:
step++;
if (ck_a != data) {
Serial.printf("wrong ck_a\n");
Serial.print_P(PSTR("wrong ck_a\n"));
step = 0;
}
break;
@ -266,7 +266,7 @@ AP_GPS_MTK19::_detect(uint8_t data)
if (ck_b == data) {
return true;
}
Serial.printf("wrong ck_b\n");
Serial.print_P(PSTR("wrong ck_b\n"));
break;
}
return false;