From 3f45a4f789f76352b0cd75995af763c4213c03ed Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Thu, 26 Sep 2024 16:48:39 -0700 Subject: [PATCH] Moved magic numbers into header --- inc/board_config.h | 5 +++++ src/main.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/inc/board_config.h b/inc/board_config.h index b9d3968..dc8e834 100644 --- a/inc/board_config.h +++ b/inc/board_config.h @@ -7,10 +7,15 @@ //Only applied if defined #ifdef FEATHER_RFM9X + //Define Serial params for debuging + #define SERIAL_BUADRATE 115200 + // DISPLAY CONFIGURATION (ST7789) #define TFT_CS 5 // Chip select pin for the display #define TFT_RST 9 // Reset pin for the display #define TFT_DC 6 // Data/Command pin for the display + #define TFT_X 240 // Number of pixes in X axis. + #define TFT_Y 280 // Number of pixes in Y axis. // LED RING CONFIGURATION (WS2812) #define NUM_LEDS 24 // Number of LEDs in the ring diff --git a/src/main.cpp b/src/main.cpp index 79a159a..1437d68 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -117,10 +117,10 @@ int Radio_ReceiveData() { void setup(void) { // Initialize Serial Communication for debugging - Serial.begin(115200); + Serial.begin(SERIAL_BUADRATE); // Display Setup - tft.init(240, 280); // Initialize the display with a resolution of 240x280 pixels + tft.init(TFT_X, TFT_Y); // Initialize the display with a resolution of 240x280 pixels tft.fillScreen(ST77XX_BLACK); // Set the screen background to black // Magnetometer Setup