add check for restoring almanac, and clear like suggested in the datasheet (#23153)

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: bb7208f4c34fe70682f24a3e637b03aeaa4f719c
This commit is contained in:
Robbe Derks
2021-12-08 14:13:56 +01:00
committed by GitHub
parent 37985cb592
commit c9ef5b176e
4 changed files with 56 additions and 5 deletions
+7
View File
@@ -61,6 +61,13 @@ def configure_ublox(dev):
dev.configure_message_rate(ublox.CLASS_MON, ublox.MSG_MON_HW, 1)
dev.configure_message_rate(ublox.CLASS_MON, ublox.MSG_MON_HW2, 1)
# Query the backup restore status
print("backup restore polling message (implement custom response handler!):")
dev.configure_poll(0x09, 0x14)
print("if succesfull, send this to clear the flash:")
dev.send_message(0x09, 0x14, b"\x01\x00\x00\x00")
print("send on stop:")
# Save on shutdown
+2 -2
View File
@@ -37,11 +37,11 @@ inline bool UbloxMsgParser::valid_cheksum() {
ck_b = (ck_b + ck_a) & 0xFF;
}
if(ck_a != msg_parse_buf[bytes_in_parse_buf - 2]) {
LOGD("Checksum a mismtach: %02X, %02X", ck_a, msg_parse_buf[6]);
LOGD("Checksum a mismatch: %02X, %02X", ck_a, msg_parse_buf[6]);
return false;
}
if(ck_b != msg_parse_buf[bytes_in_parse_buf - 1]) {
LOGD("Checksum b mismtach: %02X, %02X", ck_b, msg_parse_buf[7]);
LOGD("Checksum b mismatch: %02X, %02X", ck_b, msg_parse_buf[7]);
return false;
}
return true;