From 4fea7a7c6c206454e8aa7b3d462c073ad5909378 Mon Sep 17 00:00:00 2001 From: Chris Borrill Date: Sun, 3 Feb 2019 11:59:01 +1300 Subject: [PATCH] Use fix value constants for array sizes --- src/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index db319a4..829147c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,13 +17,12 @@ const int TFT_CS_PIN = 10; const int TFT_DC_PIN = A0; // Labelled RS on TFT const int TFT_RST_PIN = 14; -const int LINES_VALUES[4] = {-1, 1, 2, 4}; -const int LINE_LEN_VALUES[5] = {5, 13, 26, 52, 104}; -const int RATE_VALUES[5] = {100, 200, 400, 1000, 6000}; - -const int LINES_ARRAY_LEN = sizeof(LINES_VALUES) / sizeof(LINES_VALUES[0]); -const int LINE_LEN_ARRAY_LEN = sizeof(LINE_LEN_VALUES) / sizeof(LINE_LEN_VALUES[0]); -const int RATE_ARRAY_LEN = sizeof(RATE_VALUES) / sizeof(RATE_VALUES[0]); +const int LINES_ARRAY_LEN = 4; +const int LINES_VALUES[LINES_ARRAY_LEN] = {-1, 1, 2, 4}; +const int LINE_LEN_ARRAY_LEN = 5; +const int LINE_LEN_VALUES[LINE_LEN_ARRAY_LEN] = {5, 13, 26, 52, 104}; +const int RATE_ARRAY_LEN = 5; +const int RATE_VALUES[RATE_ARRAY_LEN] = {100, 200, 400, 1000, 6000}; const int LABEL_X_OFFSET = 10; const int VALUE_X_OFFSET = 95;