Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust LG timings based on observations. #291

Merged
merged 1 commit into from
Jul 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions src/ir_LG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@
// LG send originally added by https://github.com/chaeplin

// Constants
#define LG_TICK 560U
#define LG_HDR_MARK_TICKS 14U
#define LG_HDR_MARK (LG_HDR_MARK_TICKS * LG_TICK)
#define LG_HDR_SPACE_TICKS 7U
#define LG_HDR_SPACE (LG_HDR_SPACE_TICKS * LG_TICK)
#define LG_BIT_MARK_TICKS 1U
#define LG_BIT_MARK (LG_BIT_MARK_TICKS * LG_TICK)
#define LG_ONE_SPACE_TICKS 3U
#define LG_ONE_SPACE (LG_ONE_SPACE_TICKS * LG_TICK)
#define LG_ZERO_SPACE_TICKS 1U
#define LG_ZERO_SPACE (LG_ZERO_SPACE_TICKS * LG_TICK)
#define LG_RPT_SPACE_TICKS 4U
#define LG_RPT_SPACE (LG_RPT_SPACE_TICKS * LG_TICK)
#define LG_MIN_GAP_TICKS 71U
#define LG_MIN_GAP (LG_MIN_GAP_TICKS * LG_TICK)
#define LG_MIN_MESSAGE_LENGTH_TICKS 193U
#define LG_MIN_MESSAGE_LENGTH (LG_MIN_MESSAGE_LENGTH_TICKS * LG_TICK)
#define LG32_HDR_MARK_TICKS 8U
#define LG32_HDR_MARK (LG32_HDR_MARK_TICKS * LG_TICK)
#define LG32_HDR_SPACE_TICKS 8U
#define LG32_HDR_SPACE (LG32_HDR_SPACE_TICKS * LG_TICK)
#define LG32_RPT_HDR_MARK_TICKS 16U
#define LG32_RPT_HDR_MARK (LG32_RPT_HDR_MARK_TICKS * LG_TICK)
#define LG_TICK 50U
#define LG_HDR_MARK_TICKS 160U
#define LG_HDR_MARK (LG_HDR_MARK_TICKS * LG_TICK)
#define LG_HDR_SPACE_TICKS 80U
#define LG_HDR_SPACE (LG_HDR_SPACE_TICKS * LG_TICK)
#define LG_BIT_MARK_TICKS 11U
#define LG_BIT_MARK (LG_BIT_MARK_TICKS * LG_TICK)
#define LG_ONE_SPACE_TICKS 32U
#define LG_ONE_SPACE (LG_ONE_SPACE_TICKS * LG_TICK)
#define LG_ZERO_SPACE_TICKS 11U
#define LG_ZERO_SPACE (LG_ZERO_SPACE_TICKS * LG_TICK)
#define LG_RPT_SPACE_TICKS 45U
#define LG_RPT_SPACE (LG_RPT_SPACE_TICKS * LG_TICK)
#define LG_MIN_GAP_TICKS 795U
#define LG_MIN_GAP (LG_MIN_GAP_TICKS * LG_TICK)
#define LG_MIN_MESSAGE_LENGTH_TICKS 2161U
#define LG_MIN_MESSAGE_LENGTH (LG_MIN_MESSAGE_LENGTH_TICKS * LG_TICK)
#define LG32_HDR_MARK_TICKS 90U
#define LG32_HDR_MARK (LG32_HDR_MARK_TICKS * LG_TICK)
#define LG32_HDR_SPACE_TICKS 89U
#define LG32_HDR_SPACE (LG32_HDR_SPACE_TICKS * LG_TICK)
#define LG32_RPT_HDR_MARK_TICKS 179U
#define LG32_RPT_HDR_MARK (LG32_RPT_HDR_MARK_TICKS * LG_TICK)

#if (SEND_LG || DECODE_LG)
// Calculate the rolling 4-bit wide checksum over all of the data.
Expand Down
46 changes: 23 additions & 23 deletions test/ir_LG_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ TEST(TestSendLG, SendDataOnly) {
irsend.reset();
irsend.sendLG(0x4B4AE51);
EXPECT_EQ(
"m7840s3920"
"m560s560m560s1680m560s560m560s560"
"m560s1680m560s560m560s1680m560s1680m560s560m560s1680m560s560m560s560"
"m560s1680m560s560m560s1680m560s560m560s1680m560s1680m560s1680m560s560"
"m560s560m560s1680m560s560m560s1680m560s560m560s560m560s560m560s1680"
"m560s108080", irsend.outputStr());
"m8000s4000"
"m550s550m550s1600m550s550m550s550"
"m550s1600m550s550m550s1600m550s1600m550s550m550s1600m550s550m550s550"
"m550s1600m550s550m550s1600m550s550m550s1600m550s1600m550s1600m550s550"
"m550s550m550s1600m550s550m550s1600m550s550m550s550m550s550m550s1600"
"m550s108050", irsend.outputStr());

irsend.reset();
irsend.sendLG(0xB4B4AE51, LG32_BITS);
Expand All @@ -46,7 +46,7 @@ TEST(TestSendLG, SendDataOnly) {
"m560s1680m560s560m560s1680m560s560m560s1680m560s1680m560s1680m560s560"
"m560s560m560s1680m560s560m560s1680m560s560m560s560m560s560m560s1680"
"m560s108080"
"m8960s2240m560s108080", irsend.outputStr());
"m8950s2250m550s108050", irsend.outputStr());
}

// Test sending with different repeats.
Expand All @@ -57,13 +57,13 @@ TEST(TestSendLG, SendWithRepeats) {
irsend.reset();
irsend.sendLG(0x4B4AE51, LG_BITS, 1);
EXPECT_EQ(
"m7840s3920"
"m560s560m560s1680m560s560m560s560"
"m560s1680m560s560m560s1680m560s1680m560s560m560s1680m560s560m560s560"
"m560s1680m560s560m560s1680m560s560m560s1680m560s1680m560s1680m560s560"
"m560s560m560s1680m560s560m560s1680m560s560m560s560m560s560m560s1680"
"m560s108080"
"m7840s2240m560s108080", irsend.outputStr());
"m8000s4000"
"m550s550m550s1600m550s550m550s550"
"m550s1600m550s550m550s1600m550s1600m550s550m550s1600m550s550m550s550"
"m550s1600m550s550m550s1600m550s550m550s1600m550s1600m550s1600m550s550"
"m550s550m550s1600m550s550m550s1600m550s550m550s550m550s550m550s1600"
"m550s108050"
"m8000s2250m550s108050", irsend.outputStr());

irsend.reset();
irsend.sendLG(0xB4B4AE51, LG32_BITS, 1);
Expand All @@ -74,8 +74,8 @@ TEST(TestSendLG, SendWithRepeats) {
"m560s1680m560s560m560s1680m560s560m560s1680m560s1680m560s1680m560s560"
"m560s560m560s1680m560s560m560s1680m560s560m560s560m560s560m560s1680"
"m560s108080"
"m8960s2240m560s108080"
"m8960s2240m560s108080", irsend.outputStr());
"m8950s2250m550s108050"
"m8950s2250m550s108050", irsend.outputStr());
}

// Test sending an atypical data size.
Expand All @@ -86,12 +86,12 @@ TEST(TestSendLG, SendUsualSize) {
irsend.reset();
irsend.sendLG(0x0, 31);
EXPECT_EQ(
"m7840s3920"
"m560s560m560s560m560s560m560s560m560s560m560s560m560s560m560s560"
"m560s560m560s560m560s560m560s560m560s560m560s560m560s560m560s560"
"m560s560m560s560m560s560m560s560m560s560m560s560m560s560m560s560"
"m560s560m560s560m560s560m560s560m560s560m560s560m560s560"
"m560s108080", irsend.outputStr());
"m8000s4000"
"m550s550m550s550m550s550m550s550m550s550m550s550m550s550m550s550"
"m550s550m550s550m550s550m550s550m550s550m550s550m550s550m550s550"
"m550s550m550s550m550s550m550s550m550s550m550s550m550s550m550s550"
"m550s550m550s550m550s550m550s550m550s550m550s550m550s550"
"m550s108050", irsend.outputStr());

irsend.reset();
irsend.sendLG(0x0, 64);
Expand All @@ -106,7 +106,7 @@ TEST(TestSendLG, SendUsualSize) {
"m560s560m560s560m560s560m560s560m560s560m560s560m560s560m560s560"
"m560s560m560s560m560s560m560s560m560s560m560s560m560s560m560s560"
"m560s108080"
"m8960s2240m560s108080", irsend.outputStr());
"m8950s2250m550s108050", irsend.outputStr());
}

// Tests for encodeLG().
Expand Down