Skip to content

Commit d84e235

Browse files
committed
Fix lib8tion compile failure on RISCV ESP32 chips
1 parent 60fa753 commit d84e235

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/lib8tion.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -834,10 +834,7 @@ template<class T, int F, int I> class q {
834834
uint16_t operator*(uint16_t v) { return (v*i) + ((v*f)>>F); }
835835
int32_t operator*(int32_t v) { return (v*i) + ((v*f)>>F); }
836836
int16_t operator*(int16_t v) { return (v*i) + ((v*f)>>F); }
837-
#ifdef FASTLED_ARM
838-
int operator*(int v) { return (v*i) + ((v*f)>>F); }
839-
#endif
840-
#ifdef FASTLED_APOLLO3
837+
#if defined(FASTLED_ARM) | defined(FASTLED_RISCV) | defined(FASTLED_APOLLO3)
841838
int operator*(int v) { return (v*i) + ((v*f)>>F); }
842839
#endif
843840
};
@@ -846,10 +843,7 @@ template<class T, int F, int I> static uint32_t operator*(uint32_t v, q<T,F,I> &
846843
template<class T, int F, int I> static uint16_t operator*(uint16_t v, q<T,F,I> & q) { return q * v; }
847844
template<class T, int F, int I> static int32_t operator*(int32_t v, q<T,F,I> & q) { return q * v; }
848845
template<class T, int F, int I> static int16_t operator*(int16_t v, q<T,F,I> & q) { return q * v; }
849-
#ifdef FASTLED_ARM
850-
template<class T, int F, int I> static int operator*(int v, q<T,F,I> & q) { return q * v; }
851-
#endif
852-
#ifdef FASTLED_APOLLO3
846+
#if defined(FASTLED_ARM) | defined(FASTLED_RISCV) | defined(FASTLED_APOLLO3)
853847
template<class T, int F, int I> static int operator*(int v, q<T,F,I> & q) { return q * v; }
854848
#endif
855849

src/platforms/esp/32/led_sysdefs_esp32.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#pragma once
2-
2+
#include "esp32-hal.h"
33
#ifndef ESP32
44
#define ESP32
55
#endif
66

77
#define FASTLED_ESP32
88

9+
#if CONFIG_IDF_TARGET_ARCH_RISCV
10+
#define FASTLED_RISCV
11+
#endif
12+
13+
#if CONFIG_IDF_TARGET_ARCH_XTENSA || CONFIG_XTENSA_IMPL
14+
#define FASTLED_XTENSA
15+
#endif
16+
917
// Use system millis timer
1018
#define FASTLED_HAS_MILLIS
1119

0 commit comments

Comments
 (0)