Skip to content
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

Usermod TetrisAI compile error #3888

Open
1 task done
robertvb83 opened this issue Apr 6, 2024 · 14 comments · May be fixed by #3897
Open
1 task done

Usermod TetrisAI compile error #3888

robertvb83 opened this issue Apr 6, 2024 · 14 comments · May be fixed by #3897
Labels
bug usermod usermod related

Comments

@robertvb83
Copy link

robertvb83 commented Apr 6, 2024

What happened?

@muebau

I am not able to compile WLED 0.15 with -D Usermod_TetrisAI

To Reproduce Bug

compile latest 0.15 branch with VS PlatformIO

with override -D USERMOD_TETRISAI

Expected Behavior

TetrisAI should compile :-)

Install Method

Self-Compiled

What version of WLED?

WLED 0.15.0-b2

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

In file included from wled00/../usermods/TetrisAI_v2/tetrisaigame.h:22:0,
                 from wled00/../usermods/TetrisAI_v2/usermod_v2_tetrisai.h:7,
                 from wled00/usermods_list.cpp:217:  
wled00/../usermods/TetrisAI_v2/tetrisai.h: At global scope:
wled00/../usermods/TetrisAI_v2/tetrisai.h:221:10: error: 'bool TetrisAI::findBestMoveNonBlocking(GridBW, std::vector<Piece>::iterator, std::vector<Piece>::iterator, Rating*)' cannot be overloaded
     bool findBestMoveNonBlocking(GridBW grid, std::vector<Piece>::iterator start, std::vector<Piece>::iterator end, Rating* bestRating)
          ^
wled00/../usermods/TetrisAI_v2/tetrisai.h:206:10: error: with 'bool TetrisAI::findBestMoveNonBlocking(GridBW, std::vector<Piece>::iterator, std::vector<Piece>::iterator, Rating*)'
     bool findBestMoveNonBlocking(GridBW grid, std::vector<Piece>::iterator start, std::vector<Piece>::iterator end, Rating* bestRating)
          ^
wled00/../usermods/TetrisAI_v2/tetrisai.h: In member function 'bool TetrisAI::findBestMoveNonBlocking(GridBW, std::vector<Piece>::iterator, std::vector<Piece>::iterator, Rating*)':
wled00/../usermods/TetrisAI_v2/tetrisai.h:211:17: error: 'expression' was not declared in this scope      
         switch (expression)
                 ^
wled00/../usermods/TetrisAI_v2/tetrisai.h:213:18: error: 'INIT' was not declared in this scope
             case INIT:
                  ^
wled00/../usermods/TetrisAI_v2/tetrisai.h:219:5: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
In file included from wled00/usermods_list.cpp:217:0:
wled00/../usermods/TetrisAI_v2/usermod_v2_tetrisai.h: In function 'uint16_t mode_2DTetrisAI()':
wled00/../usermods/TetrisAI_v2/usermod_v2_tetrisai.h:119:7: error: no match for 'operator!' (operand type is 'TetrisAIGame')
   if (!tetrisai_data->tetris || (tetrisai_data->tetris.nLookAhead != nLookAhead
       ^
wled00/../usermods/TetrisAI_v2/usermod_v2_tetrisai.h:119:7: note: candidate: operator!(bool) <built-in>   
wled00/../usermods/TetrisAI_v2/usermod_v2_tetrisai.h:119:7: note:   no known conversion for argument 1 from 'TetrisAIGame' to 'bool'
*** [.pio\build\custom_build\src\usermods_list.cpp.o] Error 1
============ [FAILED] Took 8.00 seconds ============

Environment    Status    Duration
-------------  --------  ------------
custom_build   FAILED    00:00:08.000
======= 1 failed, 0 succeeded in 00:00:08.000 =======
PS D:\WLED\WLED-0_15> pio run -e custom_buildpio run -e custom_build

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@robertvb83 robertvb83 added the bug label Apr 6, 2024
@blazoncek
Copy link
Collaborator

Please contact (tag) original author of the usermod.

@blazoncek blazoncek added the usermod usermod related label Apr 7, 2024
@robertvb83
Copy link
Author

Hallo @muebau please have a look

@muebau
Copy link

muebau commented Apr 7, 2024

thank you. I will have a look in that but I think some of the newer code sneaked in there and it should be enough to simply remove it.

@muebau
Copy link

muebau commented Apr 12, 2024

I found the original commit (first working version). I remember there was some problem if the effect was changed often but it is the version I created the PR for.
There is a problem to compile it with 0.15b2 at the moment.

How would I fix the code? Should I create another PR?

@blazoncek
Copy link
Collaborator

How would I fix the code? Should I create another PR?

Yes.

@muebau
Copy link

muebau commented Apr 12, 2024

@robertvb83
I created a version that compiles on a branch:
https://github.com/muebau/WLED/tree/fix_usermod_tetisai

Please use this and I will create a pull request later.

@robertvb83
Copy link
Author

robertvb83 commented Apr 12, 2024

Edit: I posted nonsense... I used a wrong fork, will test later today

@muebau
Copy link

muebau commented Apr 12, 2024

Thank you

@blazoncek
Copy link
Collaborator

FYI

git remote add muebau https://github.com/muebau/WLED.git
git checkout -b --no-track muebau/fix_usermod_tetisai
git pull

and then compile.

@robertvb83
Copy link
Author

robertvb83 commented Apr 12, 2024

It works and is super cool! Unfortunately i cannot get AR, Animartrix and Tetris on one build due to file size exceed error

@muebau Thanks for providing such a cool usermod and thanks for the quick fix!

@robertvb83
Copy link
Author

ezgif-3-b8ef2e2e0f

@blazoncek
Copy link
Collaborator

It works and is super cool! Unfortunately i cannot get AR, Animartrix and Tetris on one build due to file size exceed error

Get ESP with 8MB flash or modify partitions,

@muebau muebau linked a pull request Apr 12, 2024 that will close this issue
@muebau
Copy link

muebau commented Apr 12, 2024

I created a new PR #3897

@blazoncek blazoncek linked a pull request Apr 13, 2024 that will close this issue
@robertvb83
Copy link
Author

It works and is super cool! Unfortunately i cannot get AR, Animartrix and Tetris on one build due to file size exceed error

Get ESP with 8MB flash or modify partitions,

Thanks for the hint. I found a partition file at MoonModules that works. Animartrix, AR, TetrisAI on one 4MP dev board! (Still deactivate IR and mqtt).

WLED_ESP32_4MB_256KB_FS.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug usermod usermod related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants