Skip to content

Commit

Permalink
Added Event LED + Portrait Mode for TFT24/TFT35 variants,TFT43/50/70 …
Browse files Browse the repository at this point in the history
…still Not available because of menu layout (bigtreetech#2286)
  • Loading branch information
Antonino Di Guardo authored Dec 24, 2021
1 parent e069f7a commit 99e230a
Show file tree
Hide file tree
Showing 143 changed files with 1,257 additions and 657 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/buildBinary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ jobs:
run: platformio run --environment BIGTREE_TFT28_V3_0
- name: Build TFT24 V1.1
run: platformio run --environment BIGTREE_TFT24_V1_1
- name: Build TFT24 V1.1 P
run: platformio run --environment BIGTREE_TFT24_V1_1_P
- name: Build GD_TFT24 V1.1
run: platformio run --environment BIGTREE_GD_TFT24_V1_1
- name: Build MKS TFT32 V1.3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/buildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ jobs:
run: platformio run --environment BIGTREE_TFT28_V3_0
- name: Build TFT24 V1.1
run: platformio run --environment BIGTREE_TFT24_V1_1
- name: Build TFT24 V1.1 P
run: platformio run --environment BIGTREE_TFT24_V1_1_P
- name: Build MKS TFT32 V1.3
run: platformio run --environment MKS_TFT32_V1_3
- name: Build MKS TFT32 V1.4
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Rotate UI
label_language:Հայերեն
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Rotar
label_language:Català
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:模拟M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:旋转界面
label_language:简体中文
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulace M600
label_emulated_m109_m190:Emulace M109 / M190
label_event_led:Event LED
label_file_comment_parsing:Analýzovat komentáře
label_rotated_ui:Otočit UI
label_language:Čeština
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emuliere M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:UI drehen
label_language:Deutsch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Rotate UI
label_language:English
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Rotar
label_language:Español
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emuler M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Rotation
label_language:Français
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Περιστροφή UI
label_language:Ελληνικά
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulált M600
label_emulated_m109_m190:Emulált M109 / M190
label_event_led:Event LED
label_file_comment_parsing:Fájl megjegyzés elemzése
label_rotated_ui:Forgatás
label_language:Magyar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:M600 emulato
label_emulated_m109_m190:M109 / M190 emulati
label_event_led:LED evento
label_file_comment_parsing:Analisi commenti su file
label_rotated_ui:Ruota
label_language:Italiano
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:回転UI
label_language:日本語
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Draai UI
label_language:Dutch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulowane M600
label_emulated_m109_m190:Emulowane M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Obrót
label_language:Polski
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Rodar
label_language:Portugues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Эмуляция M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Переворот
label_language:Русский
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Otočiť
label_language:Slovensky
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Obrni UI
label_language:Slovenski
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:顯示方向
label_language:正體中文
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Döndür
label_language:Türkçe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

label_emulated_m600:Emulated M600
label_emulated_m109_m190:Emulated M109 / M190
label_event_led:Event LED
label_file_comment_parsing:File comment parsing
label_rotated_ui:Повернути інтерфейс
label_language:Українська
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions Copy to SD Card root directory to update/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ emulated_m600:1
# Options: [disable: 0, enable: 1]
emulated_m109_m190:1

#### Event LED
# When printing from TFT SD / TFT U Disk, the TFT periodically sets the printer's (neopixel) LED color
# and TFT's knob LED color, if any, according to the current nozzle and bed temperatures.
#
# NOTE: If "emulated_m109_m190" is disabled (heating controlled by printer), the TFT cannot control the
# printer's (neopixel) LED during heating. It will control only the TFT's knob LED, if any.
#
# Options: [disable: 0, enable: 1]
event_led:1

#### G-code File Comment Parsing
# The TFT parses and processes extra information provided by the slicer as comments in the G-code file.
# If enabled, the current implementation parses and processes print time and print layer information
Expand Down
10 changes: 10 additions & 0 deletions Copy to SD Card root directory to update/config_rrf.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ emulated_m600:0
# Options: [disable: 0, enable: 1]
emulated_m109_m190:0

#### Event LED
# When printing from TFT SD / TFT U Disk, the TFT periodically sets the printer's (neopixel) LED color
# and TFT's knob LED color, if any, according to the current nozzle and bed temperatures.
#
# NOTE: If "emulated_m109_m190" is disabled (heating controlled by printer), the TFT cannot control the
# printer's (neopixel) LED during heating. It will control only the TFT's knob LED, if any.
#
# Options: [disable: 0, enable: 1]
event_led:1

#### G-code File Comment Parsing
# The TFT parses and processes extra information provided by the slicer as comments in the G-code file.
# If enabled, the current implementation parses and processes print time and print layer information
Expand Down
4 changes: 2 additions & 2 deletions TFT/src/User/API/FlashStore.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <string.h>

#define TSC_SIGN 0x20200512 // DO NOT MODIFY
#define PARA_SIGN 0x20211210 // (YYYYMMDD) If a new setting parameter is added,
#define PARA_SIGN 0x20211213 // (YYYYMMDD) If a new setting parameter is added,
// modify here and initialize the initial value
// in the "initSettings()" function
enum
Expand Down Expand Up @@ -68,7 +68,7 @@ void readStoredPara(void)
else
{
memcpy(&infoSettings, data + (index += 4), sizeof(SETTINGS));
// if ((paraStatus & PARA_TSC_EXIST) == 0) infoSettings.rotated_ui = DISABLED; // Unecessarily rotates UI to Default??
//if ((paraStatus & PARA_TSC_EXIST) == 0) infoSettings.rotated_ui = DISABLED; // unecessarily rotates UI to Default?
}
}

Expand Down
29 changes: 29 additions & 0 deletions TFT/src/User/API/LCD_Dimming.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,33 @@ void LCD_CheckDimming(void)
}
}

#ifdef LED_COLOR_PIN

bool knob_led_idle = false;

void LCD_SetKnobLedIdle(bool enabled)
{
if (!enabled)
{ // set infoSettings.knob_led_idle temporary to OFF
if (infoSettings.knob_led_idle && !knob_led_idle)
{
knob_led_idle = true;
infoSettings.knob_led_idle = 0; // turn knob_led_idle off
}
}
else
{ // make sure that infoSettings.knob_led_idle is back in business
if (knob_led_idle)
{
knob_led_idle = false;
infoSettings.knob_led_idle = 1; // turn knob_led_idle on
}

// always restore default knob LED color
Knob_LED_SetColor(led_colors[infoSettings.knob_led_color], infoSettings.neopixel_pixels);
}
}

#endif // LED_COLOR_PIN

#endif // LCD_LED_PWM_CHANNEL
8 changes: 8 additions & 0 deletions TFT/src/User/API/LCD_Dimming.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ extern "C" {

#endif // LCD_LED_PWM_CHANNEL

#if defined(LCD_LED_PWM_CHANNEL) && defined(LED_COLOR_PIN)
void LCD_SetKnobLedIdle(bool enabled);

#define LCD_SET_KNOB_LED_IDLE(enabled) LCD_SetKnobLedIdle(enabled)
#else
#define LCD_SET_KNOB_LED_IDLE(enabled)
#endif // LCD_LED_PWM_CHANNEL && LED_COLOR_PIN

#ifdef __cplusplus
}
#endif
Expand Down
21 changes: 21 additions & 0 deletions TFT/src/User/API/LED_Colors.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,24 @@ const LABEL led_color_names[LED_COLOR_COUNT] = {
};

#endif // LED_COLOR_PIN

void LED_SetColor(uint8_t r, uint8_t g, uint8_t b, bool skipPrinterLed)
{
if (!skipPrinterLed)
{
if (infoMachineSettings.firmwareType != FW_REPRAPFW)
storeCmd("M150 R%i U%i B%i P255\n", r, g, b);
else
storeCmd("M150 X2 R%i U%i B%i P255\n", r, g, b);
}

#ifdef LED_COLOR_PIN
uint32_t knobLedColor = 0; // GRB format

knobLedColor |= (uint32_t)(g) << 16;
knobLedColor |= (uint32_t)(r) << 8;
knobLedColor |= (uint32_t)(b);

KNOB_LED_SET_COLOR(knobLedColor, infoSettings.neopixel_pixels);
#endif
}
2 changes: 2 additions & 0 deletions TFT/src/User/API/LED_Colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ extern "C" {

#endif // LED_COLOR_PIN

void LED_SetColor(uint8_t r, uint8_t g, uint8_t b, bool skipPrinterLed);

#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit 99e230a

Please sign in to comment.