Skip to content

Commit c64d571

Browse files
committed
Fix odd error message with V1 encoder
1 parent 9560f81 commit c64d571

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/hal/drivers/mesa-hostmot2/encoder.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,15 @@ int hm2_encoder_parse_md(hostmot2_t *hm2, int md_index) {
328328
//
329329

330330
if (hm2->md[md_index].gtag == HM2_GTAG_ENCODER) {
331-
if (hm2_md_is_consistent(hm2, md_index, 2, 5, 4, 0x0003)) {
331+
if (hm2_md_is_consistent(hm2, md_index, 1, 5, 4, 0x0003)) {
332+
HM2_PRINT("WARNING: this firmware has Encoder v1!\n");
333+
HM2_PRINT("WARNING: Index logic is buggy\n");
334+
HM2_PRINT("WARNING: upgrade your firmware!\n");
335+
} else if (hm2_md_is_consistent(hm2, md_index, 2, 5, 4, 0x0003)) {
332336
// ok
333337
} else if (hm2_md_is_consistent(hm2, md_index, 3, 5, 4, 0x0003)) {
334338
// ok
335-
} else if (hm2_md_is_consistent_or_complain(hm2, md_index, 0x83, 5, 4, 0x0003)) {
339+
} else if (hm2_md_is_consistent(hm2, md_index, 0x83, 5, 4, 0x0003)) {
336340
// ok
337341
hm2->encoder.firmware_supports_probe = 1;
338342
} else {
@@ -348,7 +352,7 @@ int hm2_encoder_parse_md(hostmot2_t *hm2, int md_index) {
348352
// ok
349353
} else if (hm2_md_is_consistent(hm2, md_index, 4, 5, 4, 0x0003)) {
350354
// ok
351-
} else if (hm2_md_is_consistent_or_complain(hm2, md_index, 0x84, 5, 4, 0x0003)) {
355+
} else if (hm2_md_is_consistent(hm2, md_index, 0x84, 5, 4, 0x0003)) {
352356
// ok
353357
hm2->encoder.firmware_supports_probe = 1;
354358
} else {

0 commit comments

Comments
 (0)