static void msg_CS1(uint8_t gpschar) { checksum._.B0 = gpschar; if ((checksum._.B1 == CK_A) && (checksum._.B0 == CK_B)) { if (msg_id == 0x12) { // correct checksum for VELNED message gps_parse_common(); // parsing is complete, schedule navigation } #if (HILSIM == 1) else if (msg_id == 0xAB) { // If we got the correct checksum for bodyrates, commit that data immediately commit_bodyrate_data(); } else if (msg_id == 0xAC) { // If we got the correct checksum for keystroke, commit that data immediately commit_keystroke_data(); } #endif } else { gps_data_age = GPS_DATA_MAX_AGE+1; // if the checksum is wrong then the data from this packet is invalid. // setting this ensures the nav routine does not try to use this data. } msg_parse = &msg_B3; }
static void msg_CS1(uint8_t gpschar) { checksum._.B0 = gpschar; if ((checksum._.B1 == CK_A) && (checksum._.B0 == CK_B)) { // correct checksum for DATA message gps_parse_common(); // parsing is complete, schedule navigation } else { gps_data_age = GPS_DATA_MAX_AGE+1; // if the checksum is wrong then the data from this packet is invalid. // setting this ensures the nav routine does not try to use this data. } msg_parse = &msg_start; }