Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Marlin/src/feature/Max7219_Debug_LEDs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,19 @@ void Max7219::register_setup() {
#ifdef MAX7219_INIT_TEST
#if MAX7219_INIT_TEST == 2

#define MAX7219_LEDS (MAX7219_X_LEDS * MAX7219_Y_LEDS)

void Max7219::spiral(const bool on, const uint16_t del) {
constexpr int8_t way[] = { 1, 0, 0, 1, -1, 0, 0, -1 };
constexpr int8_t way[][2] = { { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, -1 } };
int8_t px = 0, py = 0, dir = 0;
for (uint8_t i = MAX7219_X_LEDS * MAX7219_Y_LEDS; i--;) {
for (IF<(MAX7219_LEDS > 255), uint16_t, uint8_t>::type i = MAX7219_LEDS; i--;) {
led_set(px, py, on);
delay(del);
const int8_t x = px + way[dir], y = py + way[dir + 1];
if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on) dir = (dir + 2) & 0x7;
px += way[dir]; py += way[dir + 1];
const int8_t x = px + way[dir][0], y = py + way[dir][1];
if (!WITHIN(x, 0, MAX7219_X_LEDS - 1) || !WITHIN(y, 0, MAX7219_Y_LEDS - 1) || BIT_7219(x, y) == on)
dir = (dir + 1) & 0x3;
px += way[dir][0];
py += way[dir][1];
}
}

Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/lcd/menu/menu_game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@

void menu_game() {
START_MENU();
BACK_ITEM(MSG_MAIN);
BACK_ITEM(
#if ENABLED(LCD_INFO_MENU)
MSG_INFO_MENU
#else
MSG_MAIN
#endif
);
#if ENABLED(MARLIN_BRICKOUT)
SUBMENU(MSG_BRICKOUT, brickout.enter_game);
#endif
Expand Down
29 changes: 16 additions & 13 deletions Marlin/src/lcd/menu/menu_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,22 @@ void menu_info() {
SKIP_ITEM();
SKIP_ITEM();
#endif
SUBMENU(MSG_GAMES, (
#if HAS_GAME_MENU
menu_game
#elif ENABLED(MARLIN_BRICKOUT)
brickout.enter_game
#elif ENABLED(MARLIN_INVADERS)
invaders.enter_game
#elif ENABLED(MARLIN_SNAKE)
snake.enter_game
#elif ENABLED(MARLIN_MAZE)
maze.enter_game
#endif
));
// Game sub-menu or the individual game
{
SUBMENU(
#if HAS_GAME_MENU
MSG_GAMES, menu_game
#elif ENABLED(MARLIN_BRICKOUT)
MSG_BRICKOUT, brickout.enter_game
#elif ENABLED(MARLIN_INVADERS)
MSG_INVADERS, invaders.enter_game
#elif ENABLED(MARLIN_SNAKE)
MSG_SNAKE, snake.enter_game
#elif ENABLED(MARLIN_MAZE)
MSG_MAZE, maze.enter_game
#endif
);
}
#endif

END_MENU();
Expand Down
30 changes: 17 additions & 13 deletions Marlin/src/lcd/menu/menu_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,24 @@ void menu_main() {
#if ENABLED(GAMES_EASTER_EGG)
SKIP_ITEM();
SKIP_ITEM();
SKIP_ITEM();
#endif
SUBMENU(MSG_GAMES, (
#if HAS_GAME_MENU
menu_game
#elif ENABLED(MARLIN_BRICKOUT)
brickout.enter_game
#elif ENABLED(MARLIN_INVADERS)
invaders.enter_game
#elif ENABLED(MARLIN_SNAKE)
snake.enter_game
#elif ENABLED(MARLIN_MAZE)
maze.enter_game
#endif
));
// Game sub-menu or the individual game
{
SUBMENU(
#if HAS_GAME_MENU
MSG_GAMES, menu_game
#elif ENABLED(MARLIN_BRICKOUT)
MSG_BRICKOUT, brickout.enter_game
#elif ENABLED(MARLIN_INVADERS)
MSG_INVADERS, invaders.enter_game
#elif ENABLED(MARLIN_SNAKE)
MSG_SNAKE, snake.enter_game
#elif ENABLED(MARLIN_MAZE)
MSG_MAZE, maze.enter_game
#endif
);
}
#endif

END_MENU();
Expand Down