diff --git a/sdk/commands/enabled-sensors.test.ts b/sdk/commands/enabled-sensors.test.ts index deb4f5b..82552d8 100644 --- a/sdk/commands/enabled-sensors.test.ts +++ b/sdk/commands/enabled-sensors.test.ts @@ -4,7 +4,7 @@ import { twoEnabledSensors_t, EnabledSensors } from "./enabled-sensors"; describe("twoEnabledSensors_t", () => { test("encode", () => { - expect(twoEnabledSensors_t.decode(sbytes("0F"))).toEqual({ + expect(twoEnabledSensors_t.decode(sbytes("F0"), false)).toEqual({ up0: true, right0: true, down0: true, @@ -14,7 +14,7 @@ describe("twoEnabledSensors_t", () => { down1: false, left1: false, }); - expect(twoEnabledSensors_t.decode(sbytes("F0"))).toEqual({ + expect(twoEnabledSensors_t.decode(sbytes("0F"))).toEqual({ up0: false, right0: false, down0: false, @@ -30,12 +30,6 @@ describe("twoEnabledSensors_t", () => { const enabledSensors = new EnabledSensors(); const decodedData = [ - { - down: true, - left: true, - right: true, - up: true, - }, { down: false, left: false, @@ -78,6 +72,12 @@ const decodedData = [ right: false, up: false, }, + { + down: true, + left: true, + right: true, + up: true, + }, { down: false, left: false, diff --git a/sdk/commands/enabled-sensors.ts b/sdk/commands/enabled-sensors.ts index 74aa650..faac4f6 100644 --- a/sdk/commands/enabled-sensors.ts +++ b/sdk/commands/enabled-sensors.ts @@ -11,14 +11,14 @@ interface EnabeledSensorSet { /** sensors enabled, with two panels packed into a single byte */ export const twoEnabledSensors_t = bits(uint8_t, { - up0: 0, - right0: 1, - down0: 2, - left0: 3, - up1: 4, - right1: 5, - down1: 6, - left1: 7, + up0: 7, + right0: 6, + down0: 5, + left0: 4, + up1: 3, + right1: 2, + down1: 1, + left1: 0, }); /** splits packed */