mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-19 00:48:09 -07:00
Add support for Pioneer SR IR remotes (#3308)
* add support for Pioneer SR IR remotes * fix minor issues * fix repeat * Fix protocol enumeration order * Add unit tests for Pioneer IR protocol * Clean up raw test data * Add encoder/decoder tests, modify parser * Remove dead code * Use loops where appropriate Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com> Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
This commit is contained in:
@@ -426,53 +426,53 @@ MU_TEST(infrared_test_decoder_mixed) {
|
||||
infrared_test_run_decoder(InfraredProtocolSIRC, 3);
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolPioneer, 6);
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_nec) {
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, 2);
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, 3);
|
||||
for(uint32_t i = 1; i <= 3; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_unexpected_end_in_sequence) {
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, 2);
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, 2);
|
||||
for(uint32_t i = 1; i <= 2; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, i);
|
||||
infrared_test_run_decoder(InfraredProtocolNEC, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_necext1) {
|
||||
infrared_test_run_decoder(InfraredProtocolNECext, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolNECext, 1);
|
||||
for(uint32_t i = 0; i < 2; ++i) {
|
||||
UNUSED(i);
|
||||
infrared_test_run_decoder(InfraredProtocolNECext, 1);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_long_packets_with_nec_start) {
|
||||
infrared_test_run_decoder(InfraredProtocolNEC42ext, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolNEC42ext, 2);
|
||||
for(uint32_t i = 1; i <= 2; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolNEC42ext, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_encoder_sirc) {
|
||||
infrared_test_run_encoder(InfraredProtocolSIRC, 1);
|
||||
infrared_test_run_encoder(InfraredProtocolSIRC, 2);
|
||||
for(uint32_t i = 1; i <= 2; ++i) {
|
||||
infrared_test_run_encoder(InfraredProtocolSIRC, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_sirc) {
|
||||
infrared_test_run_decoder(InfraredProtocolSIRC, 3);
|
||||
infrared_test_run_decoder(InfraredProtocolSIRC, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolSIRC, 2);
|
||||
infrared_test_run_decoder(InfraredProtocolSIRC, 4);
|
||||
infrared_test_run_decoder(InfraredProtocolSIRC, 5);
|
||||
for(uint32_t i = 1; i <= 5; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolSIRC, 5);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_rc5) {
|
||||
infrared_test_run_decoder(InfraredProtocolRC5X, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, 2);
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, 3);
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, 4);
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, 5);
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, 6);
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, 7);
|
||||
|
||||
for(uint32_t i = 1; i <= 7; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolRC5, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_encoder_rc5x) {
|
||||
@@ -492,21 +492,21 @@ MU_TEST(infrared_test_encoder_rc6) {
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_kaseikyo) {
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, 2);
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, 3);
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, 4);
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, 5);
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, 6);
|
||||
for(uint32_t i = 1; i <= 6; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolKaseikyo, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_rca) {
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, 1);
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, 2);
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, 3);
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, 4);
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, 5);
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, 6);
|
||||
for(uint32_t i = 1; i <= 6; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolRCA, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_decoder_pioneer) {
|
||||
for(uint32_t i = 1; i <= 11; ++i) {
|
||||
infrared_test_run_decoder(InfraredProtocolPioneer, i);
|
||||
}
|
||||
}
|
||||
|
||||
MU_TEST(infrared_test_encoder_decoder_all) {
|
||||
@@ -520,6 +520,7 @@ MU_TEST(infrared_test_encoder_decoder_all) {
|
||||
infrared_test_run_encoder_decoder(InfraredProtocolSIRC, 1);
|
||||
infrared_test_run_encoder_decoder(InfraredProtocolKaseikyo, 1);
|
||||
infrared_test_run_encoder_decoder(InfraredProtocolRCA, 1);
|
||||
infrared_test_run_encoder_decoder(InfraredProtocolPioneer, 1);
|
||||
}
|
||||
|
||||
MU_TEST_SUITE(infrared_test) {
|
||||
@@ -539,6 +540,7 @@ MU_TEST_SUITE(infrared_test) {
|
||||
MU_RUN_TEST(infrared_test_decoder_necext1);
|
||||
MU_RUN_TEST(infrared_test_decoder_kaseikyo);
|
||||
MU_RUN_TEST(infrared_test_decoder_rca);
|
||||
MU_RUN_TEST(infrared_test_decoder_pioneer);
|
||||
MU_RUN_TEST(infrared_test_decoder_mixed);
|
||||
MU_RUN_TEST(infrared_test_encoder_decoder_all);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user