jandelgado / fastled-wasm

FastLED for the Web
MIT License
12 stars 1 forks source link

error: unknown type name 'RwReg' #4

Open guff-se opened 2 years ago

guff-se commented 2 years ago

Hi, I fail to run this on MacOS

Error message:

gustaf@namnam fastled-wasm % make
em++ --std=c++11 -Os --closure 1 --bind -Isrc -I./FastLED/src \
        -D FASTLED_NO_MCU -D ARDUINO\
        -s ASSERTIONS=2 \
        -s WASM=1\
        -s EXPORTED_RUNTIME_METHODS='["ccall","cwrap"]'\
        -s ALLOW_MEMORY_GROWTH=1 \
        --closure 1 \
        -o web/fastled.js \
        -x c++ \
        src/Arduino.cpp src/demo_reel100.cpp src/demo_pride.cpp src/demo_twinklefox.cpp src/demo_fire.cpp src/demo_pacifica.cpp ./FastLED/src/FastLED.cpp ./FastLED/src/colorutils.cpp ./FastLED/src/colorpalettes.cpp ./FastLED/src/hsv2rgb.cpp ./FastLED/src/lib8tion.cpp 
In file included from src/demo_reel100.cpp:3:
./FastLED/src/FastLED.h:16:6: warning: FastLED version 3.004.000  (Not really a warning, just telling you here.) [-W#warnings]
\#    warning FastLED version 3.004.000  (Not really a warning, just telling you here.)
     ^
In file included from src/demo_reel100.cpp:3:
In file included from ./FastLED/src/FastLED.h:41:
./FastLED/src/led_sysdefs.h:55:2: error: "This platform isn't recognized by FastLED... yet.  See comments in FastLED/led_sysdefs.h for options."
#error "This platform isn't recognized by FastLED... yet.  See comments in FastLED/led_sysdefs.h for options."
 ^
In file included from src/demo_reel100.cpp:3:
In file included from ./FastLED/src/FastLED.h:48:
./FastLED/src/fastpin.h:35:11: error: unknown type name 'RwReg'
        volatile RwReg *mPort;
                 ^
./FastLED/src/fastpin.h:36:11: error: unknown type name 'RoReg'
        volatile RoReg *mInPort;
                 ^
./FastLED/src/fastpin.h:37:2: error: unknown type name 'RwReg'
        RwReg mPinMask;
        ^
./FastLED/src/fastpin.h:49:19: error: unknown type name 'RwReg'
        typedef volatile RwReg * port_ptr_t;
                         ^
./FastLED/src/fastpin.h:50:10: error: unknown type name 'RwReg'
        typedef RwReg port_t;
                ^
./FastLED/src/fastpin.h:42:21: error: unknown type name 'RwReg'
                mPort = (volatile RwReg*)portOutputRegister(digitalPinToPort(mPin));
                                  ^
./FastLED/src/fastpin.h:43:23: error: unknown type name 'RoReg'
                mInPort = (volatile RoReg*)portInputRegister(digitalPinToPort(mPin));
                                    ^
./FastLED/src/fastpin.h:79:34: error: cannot initialize object parameter of type 'Pin' with an expression of type 'OutputPin'
        OutputPin(int pin) : Pin(pin) { setOutput(); }
                                        ^~~~~~~~~
./FastLED/src/fastpin.h:84:33: error: cannot initialize object parameter of type 'Pin' with an expression of type 'InputPin'
        InputPin(int pin) : Pin(pin) { setInput(); }
                                       ^~~~~~~~
./FastLED/src/fastpin.h:215:19: error: unknown type name 'RwReg'
        typedef volatile RwReg * port_ptr_t;
                         ^
./FastLED/src/fastpin.h:216:10: error: unknown type name 'RwReg'
        typedef RwReg port_t;
                ^
In file included from src/demo_reel100.cpp:3:
In file included from ./FastLED/src/FastLED.h:52:
In file included from ./FastLED/src/platforms.h:41:
In file included from ./FastLED/src/platforms/avr/fastled_avr.h:6:
./FastLED/src/platforms/avr/clockless_trinket.h:6:10: fatal error: 'avr/interrupt.h' file not found
#include <avr/interrupt.h> // for cli/se definitions
         ^~~~~~~~~~~~~~~~~
1 warning and 13 errors generated.
em++: error: '/Users/gustaf/Dropbox/Code/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -fignore-exceptions -fno-inline-functions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=34 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/Users/gustaf/Dropbox/Code/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat --std=c++11 -Os -Isrc -I./FastLED/src -D FASTLED_NO_MCU -D ARDUINO -x c++ src/demo_reel100.cpp -c -o /var/folders/j6/kgglz9dj2659875367rgwb6w0000gp/T/emscripten_temp_ezczhwyi/demo_reel100_1.o' failed (returned 1)
make: *** [web/fastled.js] Error 1

Thankful for any assistance.

jandelgado commented 2 years ago

You have to use my patched version of FastLed: https://github.com/jandelgado/FastLED/tree/82ec8ba5046ae36bff3b82e9c2efdf4caa4559d8 since my PR is not yet merged: https://github.com/FastLED/FastLED/pull/1158

jandelgado commented 2 years ago

@guff-se did it work?