Skip to content

Commit

Permalink
Pioneer: Update timings based on user collected data.
Browse files Browse the repository at this point in the history
* Adjust protocol timings based on the average seen across ten different captures.
* Update unit tests accordingly.
* Updated supported devices.

Fixes #1220
  • Loading branch information
crankyoldgit committed Jul 21, 2020
1 parent ad436f7 commit 195113d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 52 deletions.
28 changes: 12 additions & 16 deletions src/ir_Pioneer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
Expand All @@ -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.
Expand Down
72 changes: 36 additions & 36 deletions test/ir_Pioneer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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());
}

0 comments on commit 195113d

Please sign in to comment.