From 95fb000f95167fb22636b2fdcd412ac14586d07b Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Sat, 14 Dec 2024 13:19:42 +0100 Subject: [PATCH] refactor constants to own file --- organism/src/constants.h | 26 ++++++++++++++++++++++++++ organism/src/main.cpp | 27 +-------------------------- 2 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 organism/src/constants.h diff --git a/organism/src/constants.h b/organism/src/constants.h new file mode 100644 index 0000000..0561782 --- /dev/null +++ b/organism/src/constants.h @@ -0,0 +1,26 @@ +#define R1 42 +#define G1 40 +#define BL1 41 +#define R2 38 +#define G2 37 +#define BL2 39 +#define CH_A 45 +#define CH_B 36 +#define CH_C 48 +#define CH_D 35 +#define CH_E 21 +#define CLK 2 +#define LAT 47 +#define OE 14 + +#define PIN_E 21 +#define PANEL_WIDTH 64 +#define PANEL_HEIGHT 32 // Panel height of 64 will required PIN_E to be defined. + +#define PANELS_NUMBER 1 + +#define PANE_WIDTH PANEL_WIDTH * PANELS_NUMBER +#define PANE_HEIGHT PANEL_HEIGHT +#define NUM_LEDS PANE_WIDTH*PANE_HEIGHT + +#define ONBOARD_LED 13 diff --git a/organism/src/main.cpp b/organism/src/main.cpp index 691a32e..b6f6b15 100644 --- a/organism/src/main.cpp +++ b/organism/src/main.cpp @@ -3,36 +3,11 @@ #include #include "main.h" +#include "constants.h" #include "overlay.h" #include -#define R1 42 -#define G1 40 -#define BL1 41 -#define R2 38 -#define G2 37 -#define BL2 39 -#define CH_A 45 -#define CH_B 36 -#define CH_C 48 -#define CH_D 35 -#define CH_E 21 -#define CLK 2 -#define LAT 47 -#define OE 14 - -#define PIN_E 21 -#define PANEL_WIDTH 64 -#define PANEL_HEIGHT 32 // Panel height of 64 will required PIN_E to be defined. - -#define PANELS_NUMBER 1 - -#define PANE_WIDTH PANEL_WIDTH * PANELS_NUMBER -#define PANE_HEIGHT PANEL_HEIGHT -#define NUM_LEDS PANE_WIDTH*PANE_HEIGHT - -#define ONBOARD_LED 13 MatrixPanel_I2S_DMA *matrix = nullptr;