Skip to content

Commit

Permalink
Change display configuration
Browse files Browse the repository at this point in the history
And add an header to configure it
  • Loading branch information
andreock committed Jun 4, 2024
1 parent b31d975 commit b675d78
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions include/display_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* This file is part of the Capibara zero (https://github.com/CapibaraZero/fw or
* https://capibarazero.github.io/). Copyright (c) 2024 Andrea Canale.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// Set your display resolution here
#define DISPLAY_WIDTH 240
#define DISPLAY_HEIGHT 240
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "pins.h"
#include "posixsd.hpp"
#include "style.h"
#include "display_config.h"

/* TODO: To lower this, we can may switch to heap for wifi_networks */
#define TASK_STACK_SIZE 16000
Expand Down Expand Up @@ -62,7 +63,7 @@ void setup() {
init_sd();
init_english_dict();
display = new Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
screen = new GFXForms(240, 320, display);
screen = new GFXForms(DISPLAY_WIDTH, DISPLAY_HEIGHT, display);
screen->set_rotation(1);
screen->set_background_color(HOME_BACKGROUND_COLOR);

Expand Down

0 comments on commit b675d78

Please sign in to comment.