Skip to content

Commit

Permalink
feat: Updated cmatrix.c
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Feb 6, 2024
1 parent dde080f commit 0c90a7c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion cmatrix.c
Expand Up @@ -63,6 +63,10 @@

#ifdef HAVE_UNISTD_H
#include <unistd.h>

#ifdef ESP32
#include "cmatrix_esp32.h"
#endif
#endif

#ifdef HAVE_TERMIOS_H
Expand Down Expand Up @@ -129,8 +133,13 @@ void c_die(char *msg, ...) {
curs_set(1);
clear();
refresh();
#ifndef ESP32
resetty();
endwin();
#endif
#ifdef ESP32
esp32_deinit_display();
#endif

if (console) {
#ifdef HAVE_CONSOLECHARS
Expand Down Expand Up @@ -457,7 +466,12 @@ int main(int argc, char *argv[]) {
exit(EXIT_FAILURE);
set_term(ttyscr);
} else
initscr();
#ifndef ESP32
initscr();
#endif
#ifdef ESP32
esp32_init_display();
#endif
savetty();
nonl();
#ifdef _WIN32
Expand Down Expand Up @@ -763,6 +777,10 @@ if (console) {
z = LINES - 1;
}
for (i = y; i <= z; i++) {
#ifdef ESP32
}
esp32_render_frame(matrix);
#else
move(i - y, j);

if (matrix[i][j].val == 0 || (matrix[i][j].is_head && !rainbow)) {
Expand Down Expand Up @@ -888,6 +906,7 @@ if (console) {
addch(' ');
}

#endif // Close loop for #ifdef ESP32 in previous section
napms(update * 10);
}
finish();
Expand Down

0 comments on commit 0c90a7c

Please sign in to comment.