From 195113db90613c391c304002597eeb4370e72d13 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 21 Jul 2020 12:47:25 +1000 Subject: [PATCH] Pioneer: Update timings based on user collected data. * Adjust protocol timings based on the average seen across ten different captures. * Update unit tests accordingly. * Updated supported devices. Fixes #1220 --- src/ir_Pioneer.cpp | 28 +++++++--------- test/ir_Pioneer_test.cpp | 72 ++++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 52 deletions(-) diff --git a/src/ir_Pioneer.cpp b/src/ir_Pioneer.cpp index d5ac89765..90f58c6ed 100644 --- a/src/ir_Pioneer.cpp +++ b/src/ir_Pioneer.cpp @@ -8,9 +8,12 @@ /// @see http://www.adrian-kingston.com/IRFormatPioneer.htm /// @see https://github.com/crankyoldgit/IRremoteESP8266/pull/547 /// @see https://www.pioneerelectronics.com/PUSA/Support/Home-Entertainment-Custom-Install/IR+Codes/A+V+Receivers +/// @see https://github.com/crankyoldgit/IRremoteESP8266/issues/1220 // Supports: // Brand: Pioneer, Model: AV Receivers +// Brand: Pioneer, Model: VSX-324 AV Receiver +// Brand: Pioneer, Model: AXD7690 Remote #define __STDC_LIMIT_MACROS #include @@ -20,22 +23,15 @@ #include "IRutils.h" // Constants -const uint16_t kPioneerTick = 534; -const uint16_t kPioneerHdrMarkTicks = 16; -const uint16_t kPioneerHdrMark = kPioneerHdrMarkTicks * kPioneerTick; -const uint16_t kPioneerHdrSpaceTicks = 8; -const uint16_t kPioneerHdrSpace = kPioneerHdrSpaceTicks * kPioneerTick; -const uint16_t kPioneerBitMarkTicks = 1; -const uint16_t kPioneerBitMark = kPioneerBitMarkTicks * kPioneerTick; -const uint16_t kPioneerOneSpaceTicks = 3; -const uint16_t kPioneerOneSpace = kPioneerOneSpaceTicks * kPioneerTick; -const uint16_t kPioneerZeroSpaceTicks = 1; -const uint16_t kPioneerZeroSpace = kPioneerZeroSpaceTicks * kPioneerTick; -const uint16_t kPioneerMinCommandLengthTicks = 159; -const uint32_t kPioneerMinCommandLength = kPioneerMinCommandLengthTicks * - kPioneerTick; -const uint16_t kPioneerMinGapTicks = 47; -const uint32_t kPioneerMinGap = kPioneerMinGapTicks * kPioneerTick; +// Ref: https://github.com/crankyoldgit/IRremoteESP8266/issues/1220 +const uint16_t kPioneerTick = 534; ///< uSeconds. +const uint16_t kPioneerHdrMark = 8506; ///< uSeconds. +const uint16_t kPioneerHdrSpace = 4191; ///< uSeconds. +const uint16_t kPioneerBitMark = 568; ///< uSeconds. +const uint16_t kPioneerOneSpace = 1542; ///< uSeconds. +const uint16_t kPioneerZeroSpace = 487; ///< uSeconds. +const uint32_t kPioneerMinCommandLength = 84906; ///< uSeconds. +const uint32_t kPioneerMinGap = 25181; ///< uSeconds. #if SEND_PIONEER /// Send a raw Pioneer formatted message. diff --git a/test/ir_Pioneer_test.cpp b/test/ir_Pioneer_test.cpp index 37cb56fa2..a95169eaa 100644 --- a/test/ir_Pioneer_test.cpp +++ b/test/ir_Pioneer_test.cpp @@ -14,34 +14,34 @@ TEST(TestSendPioneer, SendDataOnly) { irsend.sendPioneer(0); EXPECT_EQ( "f40000d33" - "m8544s4272" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s37380" - "m8544s4272" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s37380", + "m8506s4191" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s37881" + "m8506s4191" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s37881", irsend.outputStr()); irsend.sendPioneer(0x55FF00AAAA00FF55); EXPECT_EQ( "f40000d33" - "m8544s4272" - "m534s534m534s1602m534s534m534s1602m534s534m534s1602m534s534m534s1602" - "m534s1602m534s1602m534s1602m534s1602m534s1602m534s1602m534s1602m534s1602" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s1602m534s534m534s1602m534s534m534s1602m534s534m534s1602m534s534" - "m534s25098" - "m8544s4272" - "m534s1602m534s534m534s1602m534s534m534s1602m534s534m534s1602m534s534" - "m534s534m534s534m534s534m534s534m534s534m534s534m534s534m534s534" - "m534s1602m534s1602m534s1602m534s1602m534s1602m534s1602m534s1602m534s1602" - "m534s534m534s1602m534s534m534s1602m534s534m534s1602m534s534m534s1602" - "m534s25098", + "m8506s4191" + "m568s487m568s1542m568s487m568s1542m568s487m568s1542m568s487m568s1542" + "m568s1542m568s1542m568s1542m568s1542m568s1542m568s1542m568s1542m568s1542" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s1542m568s487m568s1542m568s487m568s1542m568s487m568s1542m568s487" + "m568s25181" + "m8506s4191" + "m568s1542m568s487m568s1542m568s487m568s1542m568s487m568s1542m568s487" + "m568s487m568s487m568s487m568s487m568s487m568s487m568s487m568s487" + "m568s1542m568s1542m568s1542m568s1542m568s1542m568s1542m568s1542m568s1542" + "m568s487m568s1542m568s487m568s1542m568s487m568s1542m568s487m568s1542" + "m568s25181", irsend.outputStr()); } @@ -139,17 +139,17 @@ TEST(TestDecodePioneer, SyntheticPioneerMessage) { irsend.sendPioneer(0x659A857AF50A3DC2, 64, 0); EXPECT_EQ( "f40000d33" - "m8544s4272" - "m534s534m534s1602m534s1602m534s534m534s534m534s1602m534s534m534s1602" - "m534s1602m534s534m534s534m534s1602m534s1602m534s534m534s1602m534s534" - "m534s1602m534s534m534s534m534s534m534s534m534s1602m534s534m534s1602" - "m534s534m534s1602m534s1602m534s1602m534s1602m534s534m534s1602m534s534" - "m534s25098" - "m8544s4272" - "m534s1602m534s1602m534s1602m534s1602m534s534m534s1602m534s534m534s1602" - "m534s534m534s534m534s534m534s534m534s1602m534s534m534s1602m534s534" - "m534s534m534s534m534s1602m534s1602m534s1602m534s1602m534s534m534s1602" - "m534s1602m534s1602m534s534m534s534m534s534m534s534m534s1602m534s534" - "m534s25098", + "m8506s4191" + "m568s487m568s1542m568s1542m568s487m568s487m568s1542m568s487m568s1542" + "m568s1542m568s487m568s487m568s1542m568s1542m568s487m568s1542m568s487" + "m568s1542m568s487m568s487m568s487m568s487m568s1542m568s487m568s1542" + "m568s487m568s1542m568s1542m568s1542m568s1542m568s487m568s1542m568s487" + "m568s25181" + "m8506s4191" + "m568s1542m568s1542m568s1542m568s1542m568s487m568s1542m568s487m568s1542" + "m568s487m568s487m568s487m568s487m568s1542m568s487m568s1542m568s487" + "m568s487m568s487m568s1542m568s1542m568s1542m568s1542m568s487m568s1542" + "m568s1542m568s1542m568s487m568s487m568s487m568s487m568s1542m568s487" + "m568s25181", irsend.outputStr()); }