From 45444bb8c55c9ef9dfcaa9dda027333d044df355 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Wed, 16 Dec 2020 09:36:37 +0100 Subject: [PATCH] fix st7735(s) color, fixed last count --- components/display-m5-st7735s/st7735s.h | 4 ++-- components/display-ttgo-st7735/st7735.h | 4 ++-- components/interface/interface-debug.c | 12 ++++++------ components/interface/interface-info.c | 5 ++--- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/components/display-m5-st7735s/st7735s.h b/components/display-m5-st7735s/st7735s.h index 71ec6db..5441bac 100644 --- a/components/display-m5-st7735s/st7735s.h +++ b/components/display-m5-st7735s/st7735s.h @@ -18,8 +18,8 @@ #define M5_ST7735S_INTERFACE_OFFSETX 16 #define M5_ST7735S_INTERFACE_OFFSETY 8 -#define M5_ST7735S_LANDSCAPE_FLIPPED 0x60 -#define M5_ST7735S_LANDSCAPE 0xA0 +#define M5_ST7735S_LANDSCAPE_FLIPPED 0x68 +#define M5_ST7735S_LANDSCAPE 0xA8 #define SPI_COMMAND_MODE 0 #define SPI_DATA_MODE 1 diff --git a/components/display-ttgo-st7735/st7735.h b/components/display-ttgo-st7735/st7735.h index 821798b..562a8f0 100644 --- a/components/display-ttgo-st7735/st7735.h +++ b/components/display-ttgo-st7735/st7735.h @@ -19,8 +19,8 @@ #define TTGO_T_WRISTBAND_INTERFACE_OFFSETX 16 #define TTGO_T_WRISTBAND_INTERFACE_OFFSETY 8 -#define TTGO_T_WRISTBAND_LANDSCAPE_FLIPPED 0x60 -#define TTGO_T_WRISTBAND_LANDSCAPE 0xA0 +#define TTGO_T_WRISTBAND_LANDSCAPE_FLIPPED 0x68 +#define TTGO_T_WRISTBAND_LANDSCAPE 0xA8 #define SPI_COMMAND_MODE 0 #define SPI_DATA_MODE 1 diff --git a/components/interface/interface-debug.c b/components/interface/interface-debug.c index c4d31b0..4ced522 100644 --- a/components/interface/interface-debug.c +++ b/components/interface/interface-debug.c @@ -108,17 +108,17 @@ void interface_debug_task(void *pvParameter) #if defined(CONFIG_ENA_INTERFACE_M5STICKC) || defined(CONFIG_ENA_INTERFACE_M5STICKC_PLUS) || defined(CONFIG_ENA_INTERFACE_TTGO_T_WRISTBAND) char data_chars[32]; sprintf(data_chars, "acc x:%3.2f", ax); - display_text_line(data_chars, 2, false); + display_text_line(data_chars, 1, false); sprintf(data_chars, "acc y:%3.2f", ay); - display_text_line(data_chars, 3, false); + display_text_line(data_chars, 2, false); sprintf(data_chars, "acc z:%3.2f", az); - display_text_line(data_chars, 4, false); + display_text_line(data_chars, 3, false); sprintf(data_chars, "gyr x:%3.2f", gx); - display_text_line(data_chars, 5, false); + display_text_line(data_chars, 4, false); sprintf(data_chars, "gyr y:%3.2f", gy); - display_text_line(data_chars, 6, false); + display_text_line(data_chars, 5, false); sprintf(data_chars, "gyr z:%3.2f", gz); - display_text_line(data_chars, 7, false); + display_text_line(data_chars, 6, false); #endif diff --git a/components/interface/interface-info.c b/components/interface/interface-info.c index b04e2da..31cd358 100644 --- a/components/interface/interface-info.c +++ b/components/interface/interface-info.c @@ -96,11 +96,10 @@ void interface_info_display(void) time_t current_timstamp; time(¤t_timstamp); - int max = ena_expore_check_find_min((uint32_t)current_timstamp); int min = ena_expore_check_find_min((uint32_t)current_timstamp - 60 * 30); - int last30 = max - min; + int last30 = num - min; - if (last30 > 0) + if (last30 >= 0) { sprintf(data_chars, "%d", last30); display_text_line_column(data_chars, 3, interface_info_num_offset(last30), false);