-
Notifications
You must be signed in to change notification settings - Fork 223
Implementing WS2812b signal transmission in SPI plugin. #1382
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
05e72b1
fdfdeb9
7a7b040
c17d0d0
960ee4b
8e3ccf9
c94f8f1
58f0ed4
9205b56
791c585
9c22386
585d41f
826061f
7e3f8af
9f0f5be
c511698
0c99492
c17ef87
2629090
d510fec
7d0a5f2
d90feca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1173,13 +1173,13 @@ void SPIOutputTest::testIndividualWS2812bControl() { | |
| // get fake SPI data stream | ||
| data = backend.GetData(0, &length); | ||
| // this is the expected spi data stream: | ||
| const uint8_t EXPECTED1[] = { 0x92, 0x4D, 0x34, //Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, //Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, //Pixel 1 Blue (100) | ||
| 0x92, 0x49, 0x24, //Pixel 2 Green (0) | ||
| 0x92, 0x49, 0x24, //Pixel 2 Red (0) | ||
| 0x92, 0x49, 0x24 //Pixel 2 Blue (0) | ||
| }; | ||
| const uint8_t EXPECTED1[] = { 0x92, 0x4D, 0x34, // Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, // Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, // Pixel 1 Blue (100) | ||
| 0x92, 0x49, 0x24, // Pixel 2 Green (0) | ||
| 0x92, 0x49, 0x24, // Pixel 2 Red (0) | ||
| 0x92, 0x49, 0x24 // Pixel 2 Blue (0) | ||
| }; | ||
|
||
| // check for Equality | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED1, arraysize(EXPECTED1), data, length); | ||
| // check if the output writes are 1 | ||
|
|
@@ -1189,12 +1189,12 @@ void SPIOutputTest::testIndividualWS2812bControl() { | |
| buffer.SetFromString("255,128,0,10,20,30"); | ||
| output.WriteDMX(buffer); | ||
| data = backend.GetData(0, &length); | ||
| const uint8_t EXPECTED2[] = { 0xD2, 0x49, 0x24, //Pixel 1 Green (128) | ||
| 0xDB, 0x6D, 0xB6, //Pixel 1 Red (255) | ||
| 0x92, 0x49, 0x24, //Pixel 1 Blue (0) | ||
| 0x92, 0x69, 0xA4, //Pixel 2 Green (20) | ||
| 0x92, 0x4D, 0x34, //Pixel 2 Red (10) | ||
| 0x92, 0x6D, 0xB4 //Pixel 2 Blue (30) | ||
| const uint8_t EXPECTED2[] = { 0xD2, 0x49, 0x24, // Pixel 1 Green (128) | ||
| 0xDB, 0x6D, 0xB6, // Pixel 1 Red (255) | ||
| 0x92, 0x49, 0x24, // Pixel 1 Blue (0) | ||
| 0x92, 0x69, 0xA4, // Pixel 2 Green (20) | ||
| 0x92, 0x4D, 0x34, // Pixel 2 Red (10) | ||
| 0x92, 0x6D, 0xB4 // Pixel 2 Blue (30) | ||
| }; | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED2, arraysize(EXPECTED2), data, length); | ||
| OLA_ASSERT_EQ(2u, backend.Writes(0)); | ||
|
|
@@ -1205,12 +1205,12 @@ void SPIOutputTest::testIndividualWS2812bControl() { | |
| buffer.SetFromString("34,56,78"); | ||
| output.WriteDMX(buffer); | ||
| data = backend.GetData(0, &length); | ||
| const uint8_t EXPECTED3[] = { 0x93, 0x6D, 0x24, //Pixel 1 Green (56) | ||
| 0x93, 0x49, 0x34, //Pixel 1 Red (34) | ||
| 0x9A, 0x4D, 0xB4, //Pixel 1 Blue (78) | ||
| 0x92, 0x69, 0xA4, //Pixel 2 Green (20) | ||
| 0x92, 0x4D, 0x34, //Pixel 2 Red (10) | ||
| 0x92, 0x6D, 0xB4 //Pixel 2 Blue (30) | ||
| const uint8_t EXPECTED3[] = { 0x93, 0x6D, 0x24, // Pixel 1 Green (56) | ||
| 0x93, 0x49, 0x34, // Pixel 1 Red (34) | ||
| 0x9A, 0x4D, 0xB4, // Pixel 1 Blue (78) | ||
| 0x92, 0x69, 0xA4, // Pixel 2 Green (20) | ||
| 0x92, 0x4D, 0x34, // Pixel 2 Red (10) | ||
| 0x92, 0x6D, 0xB4 // Pixel 2 Blue (30) | ||
| }; | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED3, arraysize(EXPECTED3), data, length); | ||
| OLA_ASSERT_EQ(3u, backend.Writes(0)); | ||
|
|
@@ -1232,12 +1232,12 @@ void SPIOutputTest::testIndividualWS2812bControl() { | |
| buffer.SetFromString("1,2,3,4,5,6,7,8"); | ||
| output.WriteDMX(buffer); | ||
| data = backend.GetData(0, &length); | ||
| const uint8_t EXPECTED5[] = { 0x92, 0x49, 0xA4, //Pixel 1 Green (4) | ||
| 0x92, 0x49, 0x36, //Pixel 1 Red (3) | ||
| 0x92, 0x49, 0xA6, //Pixel 1 Blue (5) | ||
| 0x92, 0x49, 0xB6, //Pixel 2 Green (7) | ||
| 0x92, 0x49, 0xB4, //Pixel 2 Red (6) | ||
| 0x92, 0x4D, 0x24 //Pixel 2 Blue (8) | ||
| const uint8_t EXPECTED5[] = { 0x92, 0x49, 0xA4, // Pixel 1 Green (4) | ||
| 0x92, 0x49, 0x36, // Pixel 1 Red (3) | ||
| 0x92, 0x49, 0xA6, // Pixel 1 Blue (5) | ||
| 0x92, 0x49, 0xB6, // Pixel 2 Green (7) | ||
| 0x92, 0x49, 0xB4, // Pixel 2 Red (6) | ||
| 0x92, 0x4D, 0x24 // Pixel 2 Blue (8) | ||
| }; | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED5, arraysize(EXPECTED5), data, length); | ||
| OLA_ASSERT_EQ(4u, backend.Writes(0)); | ||
|
|
@@ -1268,13 +1268,13 @@ void SPIOutputTest::testIndividualWS2812bControl() { | |
| data = backend.GetData(1, &length); | ||
| // this is the expected spi data stream: | ||
| // StartFrame is missing --> port is >0 ! | ||
| const uint8_t EXPECTED7[] = { 0x92, 0x4D, 0x34, //Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, //Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, //Pixel 1 Blue (100) | ||
| 0x92, 0x49, 0x24, //Pixel 2 Green (0) | ||
| 0x92, 0x49, 0x24, //Pixel 2 Red (0) | ||
| 0x92, 0x49, 0x24 //Pixel 2 Blue (0) | ||
| }; | ||
| const uint8_t EXPECTED7[] = { 0x92, 0x4D, 0x34, // Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, // Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, // Pixel 1 Blue (100) | ||
| 0x92, 0x49, 0x24, // Pixel 2 Green (0) | ||
| 0x92, 0x49, 0x24, // Pixel 2 Red (0) | ||
| 0x92, 0x49, 0x24 // Pixel 2 Blue (0) | ||
| }; | ||
| // check for Equality | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED7, arraysize(EXPECTED7), data, length); | ||
| // check if the output writes are 1 | ||
|
|
@@ -1307,13 +1307,13 @@ void SPIOutputTest::testCombinedWS2812bControl() { | |
| // get fake SPI data stream | ||
| data = backend.GetData(0, &length); | ||
| // this is the expected spi data stream: | ||
| const uint8_t EXPECTED1[] = { 0x92, 0x4D, 0x34, //Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, //Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, //Pixel 1 Blue (100) | ||
| 0x92, 0x4D, 0x34, //Pixel 2 Green (10) | ||
| 0x92, 0x49, 0x26, //Pixel 2 Red (1) | ||
| 0x9B, 0x49, 0xA4 //Pixel 2 Blue (100) | ||
| }; | ||
| const uint8_t EXPECTED1[] = { 0x92, 0x4D, 0x34, // Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, // Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, // Pixel 1 Blue (100) | ||
| 0x92, 0x4D, 0x34, // Pixel 2 Green (10) | ||
| 0x92, 0x49, 0x26, // Pixel 2 Red (1) | ||
| 0x9B, 0x49, 0xA4 // Pixel 2 Blue (100) | ||
| }; | ||
| // check for Equality | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED1, arraysize(EXPECTED1), data, length); | ||
| // check if the output writes are 1 | ||
|
|
@@ -1323,12 +1323,12 @@ void SPIOutputTest::testCombinedWS2812bControl() { | |
| buffer.SetFromString("255,128,0,10,20,30"); | ||
| output.WriteDMX(buffer); | ||
| data = backend.GetData(0, &length); | ||
| const uint8_t EXPECTED2[] = { 0xD2, 0x49, 0x24, //Pixel 1 Green (128) | ||
| 0xDB, 0x6D, 0xB6, //Pixel 1 Red (255) | ||
| 0x92, 0x49, 0x24, //Pixel 1 Blue (0) | ||
| 0xD2, 0x49, 0x24, //Pixel 2 Green (128) | ||
| 0xDB, 0x6D, 0xB6, //Pixel 2 Red (255) | ||
| 0x92, 0x49, 0x24 //Pixel 2 Blue (0) | ||
| const uint8_t EXPECTED2[] = { 0xD2, 0x49, 0x24, // Pixel 1 Green (128) | ||
| 0xDB, 0x6D, 0xB6, // Pixel 1 Red (255) | ||
| 0x92, 0x49, 0x24, // Pixel 1 Blue (0) | ||
| 0xD2, 0x49, 0x24, // Pixel 2 Green (128) | ||
| 0xDB, 0x6D, 0xB6, // Pixel 2 Red (255) | ||
| 0x92, 0x49, 0x24 // Pixel 2 Blue (0) | ||
| }; | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED2, arraysize(EXPECTED2), data, length); | ||
| OLA_ASSERT_EQ(2u, backend.Writes(0)); | ||
|
|
@@ -1339,12 +1339,12 @@ void SPIOutputTest::testCombinedWS2812bControl() { | |
| buffer.SetFromString("34,56,78"); | ||
| output.WriteDMX(buffer); | ||
| data = backend.GetData(0, &length); | ||
| const uint8_t EXPECTED3[] = { 0x93, 0x6D, 0x24, //Pixel 1 Green (56) | ||
| 0x93, 0x49, 0x34, //Pixel 1 Red (34) | ||
| 0x9A, 0x4D, 0xB4, //Pixel 1 Blue (78) | ||
| 0x93, 0x6D, 0x24, //Pixel 2 Green (56) | ||
| 0x93, 0x49, 0x34, //Pixel 2 Red (34) | ||
| 0x9A, 0x4D, 0xB4 //Pixel 2 Blue (78) | ||
| const uint8_t EXPECTED3[] = { 0x93, 0x6D, 0x24, // Pixel 1 Green (56) | ||
| 0x93, 0x49, 0x34, // Pixel 1 Red (34) | ||
| 0x9A, 0x4D, 0xB4, // Pixel 1 Blue (78) | ||
| 0x93, 0x6D, 0x24, // Pixel 2 Green (56) | ||
| 0x93, 0x49, 0x34, // Pixel 2 Red (34) | ||
| 0x9A, 0x4D, 0xB4 // Pixel 2 Blue (78) | ||
| }; | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED3, arraysize(EXPECTED3), data, length); | ||
| OLA_ASSERT_EQ(3u, backend.Writes(0)); | ||
|
Comment on lines
+1336
to
+1350
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this is relevant for the combined mode? |
||
|
|
@@ -1366,12 +1366,12 @@ void SPIOutputTest::testCombinedWS2812bControl() { | |
| buffer.SetFromString("1,2,3,4,5,6,7,8"); | ||
| output.WriteDMX(buffer); | ||
| data = backend.GetData(0, &length); | ||
| const uint8_t EXPECTED5[] = { 0x92, 0x49, 0xA4, //Pixel 1 Green (4) | ||
| 0x92, 0x49, 0x36, //Pixel 1 Red (3) | ||
| 0x92, 0x49, 0xA6, //Pixel 1 Blue (5) | ||
| 0x92, 0x49, 0xA4, //Pixel 2 Green (4) | ||
| 0x92, 0x49, 0x36, //Pixel 2 Red (3) | ||
| 0x92, 0x49, 0xA6 //Pixel 2 Blue (5) | ||
| const uint8_t EXPECTED5[] = { 0x92, 0x49, 0xA4, // Pixel 1 Green (4) | ||
| 0x92, 0x49, 0x36, // Pixel 1 Red (3) | ||
| 0x92, 0x49, 0xA6, // Pixel 1 Blue (5) | ||
| 0x92, 0x49, 0xA4, // Pixel 2 Green (4) | ||
| 0x92, 0x49, 0x36, // Pixel 2 Red (3) | ||
| 0x92, 0x49, 0xA6 // Pixel 2 Blue (5) | ||
| }; | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED5, arraysize(EXPECTED5), data, length); | ||
| OLA_ASSERT_EQ(4u, backend.Writes(0)); | ||
|
|
@@ -1402,13 +1402,13 @@ void SPIOutputTest::testCombinedWS2812bControl() { | |
| data = backend.GetData(1, &length); | ||
| // this is the expected spi data stream: | ||
| // StartFrame is missing --> port is >0 ! | ||
| const uint8_t EXPECTED7[] = { 0x92, 0x4D, 0x34, //Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, //Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, //Pixel 1 Blue (100) | ||
| 0x92, 0x4D, 0x34, //Pixel 2 Green (10) | ||
| 0x92, 0x49, 0x26, //Pixel 2 Red (1) | ||
| 0x9B, 0x49, 0xA4 //Pixel 2 Blue (100) | ||
| }; | ||
| const uint8_t EXPECTED7[] = { 0x92, 0x4D, 0x34, // Pixel 1 Green (10) | ||
| 0x92, 0x49, 0x26, // Pixel 1 Red (1) | ||
| 0x9B, 0x49, 0xA4, // Pixel 1 Blue (100) | ||
| 0x92, 0x4D, 0x34, // Pixel 2 Green (10) | ||
| 0x92, 0x49, 0x26, // Pixel 2 Red (1) | ||
| 0x9B, 0x49, 0xA4 // Pixel 2 Blue (100) | ||
| }; | ||
| // check for Equality | ||
| OLA_ASSERT_DATA_EQUALS(EXPECTED7, arraysize(EXPECTED7), data, length); | ||
| // check if the output writes are 1 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.