Skip to content

Commit

Permalink
add idf_component manifest and gate IDF build options behind ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjmux committed May 4, 2024
1 parent 399887c commit e0d3978
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# ESP-IDF component line
#idf_component_register(SRCS "tetris/tetris.c"
# INCLUDE_DIRS "tetris")
#
#return()
#message(FATAL_ERROR "should not reach during idf build!!!")
if(ESP_PLATFORM)
idf_component_register(SRCS "tetris/tetris.c"
INCLUDE_DIRS "tetris")

return()
message(FATAL_ERROR "should not reach during idf build!!!")
endif()



Expand Down
4 changes: 4 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: "1.0.0"
description: "Tetris game implementation designed for use on embedded platforms"
url: "https://github.com/0xjmux/tetris"
license: "MIT"
6 changes: 5 additions & 1 deletion tetris/tetris.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ extern FILE *gamelog;
// max allowed is 128,128 since I want all locations to
// fit in a single byte
#define TETRIS_ROWS 32

#ifdef ESP_PLATFORM // if compiling for ESP (32x8 matrix)
#define TETRIS_COLS 8
#else
#define TETRIS_COLS 16
//#define TETRIS_COLS 8
#endif


// how many different piece types and orientations
Expand Down

0 comments on commit e0d3978

Please sign in to comment.