From 50b8dc4dce3fea8115e73be4ca6cf4861776dc92 Mon Sep 17 00:00:00 2001 From: netmindz Date: Mon, 27 May 2024 12:16:46 +0100 Subject: [PATCH 1/7] Fix compile issues when part of WLED --- src/I2SClocklessLedDriver.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/I2SClocklessLedDriver.h b/src/I2SClocklessLedDriver.h index 1ae4647..9fc1e87 100644 --- a/src/I2SClocklessLedDriver.h +++ b/src/I2SClocklessLedDriver.h @@ -28,7 +28,7 @@ #include //#include "esp32-hal-log.h" #include "esp_log.h" -#include "Math.h" +#include "math.h" #include "helper.h" @@ -46,12 +46,14 @@ #define I2S_DEVICE 0 -#define AA (0x00AA00AAL) +#define AAA (0x00AA00AAL) #define CC (0x0000CCCCL) #define FF (0xF0F0F0F0L) #define FF2 (0x0F0F0F0FL) +#ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif #ifndef HARDWARESPRITES #define HARDWARESPRITES 0 @@ -116,6 +118,11 @@ #endif #endif +#ifndef NUM_LEDS_PER_STRIP +#pragma message "NUM_LEDS_PER_STRIP not defined, using default 256" +#define NUM_LEDS_PER_STRIP 256 +#endif + #define __delay (((NUM_LEDS_PER_STRIP * 125 * 8 * _nb_components) /100000) +1 ) #ifdef USE_PIXELSLIB @@ -182,16 +189,9 @@ enum displayMode LOOP, LOOP_INTERUPT, }; - +/* int MOD(int a, int b) { - /* if (b == 1) - { - if (a < 0) - return -a; - else - return a; - }*/ if (a < 0) { if (-a % b == 0) @@ -202,6 +202,7 @@ int MOD(int a, int b) else return a % b; } +*/ struct LedTiming { @@ -1361,24 +1362,24 @@ static void IRAM_ATTR transpose16x1_noinline2(unsigned char *A, uint16_t *B) // pre-transform x #if NUMSTRIPS > 4 - t = (x ^ (x >> 7)) & AA; + t = (x ^ (x >> 7)) & AAA; x = x ^ t ^ (t << 7); t = (x ^ (x >> 14)) & CC; x = x ^ t ^ (t << 14); #endif #if NUMSTRIPS > 12 - t = (x1 ^ (x1 >> 7)) & AA; + t = (x1 ^ (x1 >> 7)) & AAA; x1 = x1 ^ t ^ (t << 7); t = (x1 ^ (x1 >> 14)) & CC; x1 = x1 ^ t ^ (t << 14); #endif // pre-transform y - t = (y ^ (y >> 7)) & AA; + t = (y ^ (y >> 7)) & AAA; y = y ^ t ^ (t << 7); t = (y ^ (y >> 14)) & CC; y = y ^ t ^ (t << 14); #if NUMSTRIPS > 8 - t = (y1 ^ (y1 >> 7)) & AA; + t = (y1 ^ (y1 >> 7)) & AAA; y1 = y1 ^ t ^ (t << 7); t = (y1 ^ (y1 >> 14)) & CC; y1 = y1 ^ t ^ (t << 14); From 1dbccdf9b019859ff2b7707c7165222bfd7f2f1c Mon Sep 17 00:00:00 2001 From: zackees Date: Mon, 2 Sep 2024 19:44:43 -0700 Subject: [PATCH 2/7] Add I2SClocklessLedDriver.h to headers in library.json --- library.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library.json b/library.json index 29d9cf4..04c7504 100755 --- a/library.json +++ b/library.json @@ -10,6 +10,7 @@ }, "version": "1.0.0", "frameworks": "arduino", - "platforms": "*" + "platforms": "*", + "headers": "I2SClocklessLedDriver.h" } From 201d866f56a9c18fc84654d5a1f552873ad02a1d Mon Sep 17 00:00:00 2001 From: hpwit Date: Fri, 4 Oct 2024 10:35:34 +0200 Subject: [PATCH 3/7] Create FUNDING.yml --- .github/FUNDING.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..96ba46a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,15 @@ +# These are supported funding model platforms + +github: hpwit # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +polar: # Replace with a single Polar username +buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +thanks_dev: # Replace with a single thanks.dev username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 1870582c2795d9d943734d2f4fe7ddcc3c322c85 Mon Sep 17 00:00:00 2001 From: ewowi Date: Sun, 7 Dec 2025 15:19:44 +0100 Subject: [PATCH 4/7] =?UTF-8?q?Add=20=F0=9F=90=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .coderabbit.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..206d0d0 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,9 @@ +language: "en-US" + +review: + enable_review: true + enable_fix_suggestions: true + enable_tests_generation: false + +context: + timeout_ms: 900000 # 15 minutes max From 083cdd94e49822944798dffa2ec0d64808d33276 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Tue, 30 Dec 2025 23:48:22 +0100 Subject: [PATCH 5/7] handle white channel at a different position than 3 --- src/I2SClocklessLedDriver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/I2SClocklessLedDriver.h b/src/I2SClocklessLedDriver.h index be6b82c..756b932 100644 --- a/src/I2SClocklessLedDriver.h +++ b/src/I2SClocklessLedDriver.h @@ -604,7 +604,7 @@ class I2SClocklessLedDriver secondPixel[p_r].bytes[i] = __red_map[*(poli + 0)]; secondPixel[p_b].bytes[i] = __blue_map[*(poli + 2)]; if (nb_components > 3) - secondPixel[3].bytes[i] = __white_map[*(poli + 3)]; + secondPixel[p_w].bytes[i] = __white_map[*(poli + 3)]; //#endif poli += num_led_per_strip * nb_components; } @@ -1520,7 +1520,7 @@ static void IRAM_ATTR loadAndTranspose(I2SClocklessLedDriver *driver)//uint8_t * secondPixel[driver->p_r].bytes[i] = driver->__red_map[*(poli + 0)]; secondPixel[driver->p_b].bytes[i] = driver->__blue_map[*(poli + 2)]; if (nbcomponents > 3) - secondPixel[3].bytes[i] = driver->__white_map[*(poli + 3)]; + secondPixel[driver->p_w].bytes[i] = driver->__white_map[*(poli + 3)]; #ifdef __HARDWARE_MAP driver->_hmapoff++; #endif From 4bef3dc92eae997448bf9ef57ec5764745c0450b Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 31 Dec 2025 12:30:44 +0100 Subject: [PATCH 6/7] Delete .github/FUNDING.yml --- .github/FUNDING.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 96ba46a..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,15 +0,0 @@ -# These are supported funding model platforms - -github: hpwit # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -polar: # Replace with a single Polar username -buy_me_a_coffee: # Replace with a single Buy Me a Coffee username -thanks_dev: # Replace with a single thanks.dev username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 5969e5e0522ffcff1b06dbd0eb81eab633507815 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 31 Dec 2025 12:31:15 +0100 Subject: [PATCH 7/7] Update I2SClocklessLedDriver.h --- src/I2SClocklessLedDriver.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/I2SClocklessLedDriver.h b/src/I2SClocklessLedDriver.h index b4d15e6..b24a113 100644 --- a/src/I2SClocklessLedDriver.h +++ b/src/I2SClocklessLedDriver.h @@ -268,7 +268,8 @@ enum displayMode { LOOP_INTERUPT, }; /* -int MOD(in +int MOD(int a, int b) +{ if (a < 0) { if (-a % b == 0)