Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Tranchida <jtranchida@gmail.com>2021-11-15 09:44:25 +0300
committerJason Tranchida <jtranchida@gmail.com>2021-11-17 09:47:31 +0300
commitd84e235b5f94989e704ae59505ae08b8ea2fd87e (patch)
treed97e6b1f05cc7226fe03c076487ccbb775bb5497
parent60fa753bfd6495f5163a1fedecd8240d5a723e47 (diff)
Fix lib8tion compile failure on RISCV ESP32 chips
-rw-r--r--src/lib8tion.h10
-rw-r--r--src/platforms/esp/32/led_sysdefs_esp32.h10
2 files changed, 11 insertions, 9 deletions
diff --git a/src/lib8tion.h b/src/lib8tion.h
index 0cc3baa4..80e27100 100644
--- a/src/lib8tion.h
+++ b/src/lib8tion.h
@@ -834,10 +834,7 @@ public:
uint16_t operator*(uint16_t v) { return (v*i) + ((v*f)>>F); }
int32_t operator*(int32_t v) { return (v*i) + ((v*f)>>F); }
int16_t operator*(int16_t v) { return (v*i) + ((v*f)>>F); }
-#ifdef FASTLED_ARM
- int operator*(int v) { return (v*i) + ((v*f)>>F); }
-#endif
-#ifdef FASTLED_APOLLO3
+#if defined(FASTLED_ARM) | defined(FASTLED_RISCV) | defined(FASTLED_APOLLO3)
int operator*(int v) { return (v*i) + ((v*f)>>F); }
#endif
};
@@ -846,10 +843,7 @@ template<class T, int F, int I> static uint32_t operator*(uint32_t v, q<T,F,I> &
template<class T, int F, int I> static uint16_t operator*(uint16_t v, q<T,F,I> & q) { return q * v; }
template<class T, int F, int I> static int32_t operator*(int32_t v, q<T,F,I> & q) { return q * v; }
template<class T, int F, int I> static int16_t operator*(int16_t v, q<T,F,I> & q) { return q * v; }
-#ifdef FASTLED_ARM
-template<class T, int F, int I> static int operator*(int v, q<T,F,I> & q) { return q * v; }
-#endif
-#ifdef FASTLED_APOLLO3
+#if defined(FASTLED_ARM) | defined(FASTLED_RISCV) | defined(FASTLED_APOLLO3)
template<class T, int F, int I> static int operator*(int v, q<T,F,I> & q) { return q * v; }
#endif
diff --git a/src/platforms/esp/32/led_sysdefs_esp32.h b/src/platforms/esp/32/led_sysdefs_esp32.h
index 73df21bb..f93f528b 100644
--- a/src/platforms/esp/32/led_sysdefs_esp32.h
+++ b/src/platforms/esp/32/led_sysdefs_esp32.h
@@ -1,11 +1,19 @@
#pragma once
-
+#include "esp32-hal.h"
#ifndef ESP32
#define ESP32
#endif
#define FASTLED_ESP32
+#if CONFIG_IDF_TARGET_ARCH_RISCV
+#define FASTLED_RISCV
+#endif
+
+#if CONFIG_IDF_TARGET_ARCH_XTENSA || CONFIG_XTENSA_IMPL
+#define FASTLED_XTENSA
+#endif
+
// Use system millis timer
#define FASTLED_HAS_MILLIS