Skip to content

Commit

Permalink
resolves bigtreetech#1974
Browse files Browse the repository at this point in the history
  • Loading branch information
digant73 committed Sep 3, 2021
1 parent 18704c4 commit 12889f7
Show file tree
Hide file tree
Showing 34 changed files with 137 additions and 61 deletions.
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 @@ -102,6 +102,16 @@ serial_port:P1:6 P2:0 P3:0 P4:0
# Options: [disable: 0, enable: 1]
emulated_m600:1

#### Emulated M109 And M190
# The TFT intercepts the blocking M109 and M190 gcodes (set target hotend and bed temperatures)
# and converts them to the non blocking M104 and M140 gcodes respectively.
#
# NOTE: Enable it to allow the TFT can continue to dialog (e.g. using menus sending gcodes to the
# mainboard) with Marlin firmware even when the target temperature is not yet reached.
#
# Options: [disable: 0, enable: 1]
emulated_m109_m190:1


#--------------------------------------------------------------------
# UI Settings
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 @@ -102,6 +102,16 @@ serial_port:P1:5 P2:0 P3:0 P4:0
# Options: [disable: 0, enable: 1]
emulated_m600:1

#### Emulated M109 And M190
# The TFT intercepts the blocking M109 and M190 gcodes (set target hotend and bed temperatures)
# and converts them to the non blocking M104 and M140 gcodes respectively.
#
# NOTE: Enable it to allow the TFT can continue to dialog (e.g. using menus sending gcodes to the
# mainboard) with Marlin firmware even when the target temperature is not yet reached.
#
# Options: [disable: 0, enable: 1]
emulated_m109_m190:1


#--------------------------------------------------------------------
# UI Settings
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/Language.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
X_WORD (EMULATED_M600)
X_WORD (EMULATED_M109_M190)
X_WORD (ROTATE_UI)
X_WORD (LANGUAGE)
X_WORD (ACK_NOTIFICATION)
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_am.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Rotate UI"
#define STRING_LANGUAGE "Հայերեն"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_ca.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Rotar"
#define STRING_LANGUAGE "Català"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_cn.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "模拟M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "旋转界面"
#define STRING_LANGUAGE "简体中文"
#define STRING_ACK_NOTIFICATION "ACK 弹窗类型"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_cz.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulace M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Otočit UI"
#define STRING_LANGUAGE "Čeština"
#define STRING_ACK_NOTIFICATION "Styl oznámení ACK"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_de.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emuliere M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "UI drehen"
#define STRING_LANGUAGE "Deutsch"
#define STRING_ACK_NOTIFICATION "ACK - Stil"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Rotate UI"
#define STRING_LANGUAGE "English"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_es.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Rotar"
#define STRING_LANGUAGE "Español"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emuler M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Rotation"
#define STRING_LANGUAGE "Français"
#define STRING_ACK_NOTIFICATION "Style de notification ACK"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_gr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Περιστροφή UI"
#define STRING_LANGUAGE "Ελληνικά"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_hu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATE_M600 "Emulált M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Forgatás"
#define STRING_LANGUAGE "Magyar"
#define STRING_ACK_NOTIFICATION "ACK Értesítési stílus"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "M600 emulato"
#define STRING_EMULATED_M109_M190 "M109 / M190 emulati"
#define STRING_ROTATE_UI "Ruota"
#define STRING_LANGUAGE "Italiano"
#define STRING_ACK_NOTIFICATION "Tipo di popup"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_jp.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "回転UI"
#define STRING_LANGUAGE "日本語"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extern "C" {

// config.ini Parameter Settings - Screen Settings and Feature Settings
#define LANG_KEY_EMULATED_M600 "label_emulated_m600:"
#define LANG_KEY_EMULATED_M109_M190 "label_emulated_m109_m190:"
#define LANG_KEY_ROTATE_UI "label_rotate_ui:"
#define LANG_KEY_LANGUAGE "label_language:"
#define LANG_KEY_ACK_NOTIFICATION "label_ack_notification:"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_nl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Draai UI"
#define STRING_LANGUAGE "Dutch"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_pl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Obrót"
#define STRING_LANGUAGE "Polski"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_pt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Rodar"
#define STRING_LANGUAGE "Portugues"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_ru.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Эмуляция M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Переворот"
#define STRING_LANGUAGE "Русский"
#define STRING_ACK_NOTIFICATION "ACK стиль уведомления"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_sk.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Otočiť"
#define STRING_LANGUAGE "Slovensky"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_sl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Obrni UI"
#define STRING_LANGUAGE "Slovenski"
#define STRING_ACK_NOTIFICATION "ACK notification style"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "顯示方向"
#define STRING_LANGUAGE "正體中文"
#define STRING_ACK_NOTIFICATION "ACK 弹窗类型"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_tr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Döndür"
#define STRING_LANGUAGE "Türkçe"
#define STRING_ACK_NOTIFICATION "Onay mesajı stili"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_uk.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// config.ini Parameter Settings - Screen Settings and Feature Settings
#define STRING_EMULATED_M600 "Emulated M600"
#define STRING_EMULATED_M109_M190 "Emulated M109 / M190"
#define STRING_ROTATE_UI "Повернути інтерфейс"
#define STRING_LANGUAGE "Українська"
#define STRING_ACK_NOTIFICATION "ACK стиль повідомлення"
Expand Down
3 changes: 2 additions & 1 deletion TFT/src/User/API/Settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
SETTINGS infoSettings;
MACHINESETTINGS infoMachineSettings;

const uint8_t default_general_settings = 0b00000011; // emulated M600 / M109 / M190 enabled
const uint16_t default_max_temp[] = HEAT_MAX_TEMP;
const uint16_t default_max_fanPWM[] = FAN_MAX_PWM;
const uint16_t default_size_min[] = {X_MIN_POS, Y_MIN_POS, Z_MIN_POS};
Expand All @@ -24,7 +25,7 @@ void infoSettingsReset(void)
{
// General Settings
infoSettings.serial_port[0] = PRIMARY_BAUDRATE; // primary serial port
infoSettings.emulated_m600 = EMULATED_M600;
infoSettings.general_settings = default_general_settings;

// UI Settings
infoSettings.rotate_ui = DISABLED;
Expand Down
106 changes: 63 additions & 43 deletions TFT/src/User/API/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ extern "C" {
// Config version support
// change if new elements/keywords are added/removed/changed in the configuration.h Format YYYYMMDD
// this number should match CONFIG_VERSION in configuration.h
#define CONFIG_SUPPPORT 20210829
#define CONFIG_SUPPPORT 20210903

#define FONT_FLASH_SIGN 20210522 // (YYYYMMDD) change if fonts require updating
#define CONFIG_FLASH_SIGN 20210829 // (YYYYMMDD) change if any keyword(s) in config.ini is added or removed
#define LANGUAGE_FLASH_SIGN 20210829 // (YYYYMMDD) change if any keyword(s) in language pack is added or removed
#define CONFIG_FLASH_SIGN 20210903 // (YYYYMMDD) change if any keyword(s) in config.ini is added or removed
#define LANGUAGE_FLASH_SIGN 20210903 // (YYYYMMDD) change if any keyword(s) in language pack is added or removed
#define ICON_FLASH_SIGN 20210711 // (YYYYMMDD) change if any icon(s) is added or removed

#define FONT_CHECK_SIGN (FONT_FLASH_SIGN + WORD_UNICODE + FLASH_SIGN_ADDR)
Expand Down Expand Up @@ -63,6 +63,44 @@ enum
sign_count
};

// General Settings

typedef enum
{
EMULATED_M600 = 0,
EMULATED_M109_M190
} GENERAL_SETTINGS;

// UI Settings

typedef enum
{
SORT_DATE_NEW_FIRST = 0,
SORT_DATE_OLD_FIRST,
SORT_NAME_ASCENDING,
SORT_NAME_DESCENDING,
SORT_BY_COUNT
} SORT_BY;

typedef enum
{
PERCENTAGE_ELAPSED = 0,
PERCENTAGE_REMAINING,
ELAPSED_REMAINING
} PROGRESS_DISPLAY;

typedef enum
{
SHOW_LAYER_HEIGHT,
CLEAN_LAYER_HEIGHT,
SHOW_LAYER_NUMBER,
CLEAN_LAYER_NUMBER,
SHOW_LAYER_BOTH,
CLEAN_LAYER_BOTH
} LAYER_TYPE;

// Marlin Mode Settings (only for TFT24 V1.1 & TFT28/TFT35/TFT43/TFT50/TFT70 V3.0)

typedef enum
{
MODE_MARLIN = 0,
Expand All @@ -80,14 +118,27 @@ typedef enum
MODE_TYPE_COUNT
} MARLIN_MODE_TYPE;

// Printer / Machine Settings

typedef enum
{
SORT_DATE_NEW_FIRST = 0,
SORT_DATE_OLD_FIRST,
SORT_NAME_ASCENDING,
SORT_NAME_DESCENDING,
SORT_BY_COUNT
} SORT_BY;
FEEDRATE_XY = 0,
FEEDRATE_Z,
FEEDRATE_E,
FEEDRATE_COUNT
} FEEDRATE_INDEX;

// Filament Runout Settings (only if connected to TFT controller)

typedef enum
{
RUNOUT_ENABLED = 0,
RUNOUT_SENSOR_TYPE,
RUNOUT_INVERTED,
RUNOUT_NO_NC
} RUNOUT_SETTINGS;

// Other Device-Specific Settings

typedef enum
{
Expand All @@ -98,52 +149,21 @@ typedef enum
SOUND_TYPE_COUNT
} SOUND_TYPE;

typedef enum
{
RUNOUT_ENABLED = 0,
RUNOUT_SENSOR_TYPE,
RUNOUT_INVERTED,
RUNOUT_NO_NC,
} RUNOUT_SETTINGS;
// Start, End & Cancel Gcode Commands

typedef enum
{
SEND_GCODES_START_PRINT = 0,
SEND_GCODES_END_PRINT,
SEND_GCODES_CANCEL_PRINT,
SEND_GCODES_COUNT,
SEND_GCODES_COUNT
} SEND_GCODES_TYPE;

typedef enum
{
PERCENTAGE_ELAPSED = 0,
PERCENTAGE_REMAINING,
ELAPSED_REMAINING,
} PROGRESS_DISPLAY;

typedef enum
{
SHOW_LAYER_HEIGHT,
CLEAN_LAYER_HEIGHT,
SHOW_LAYER_NUMBER,
CLEAN_LAYER_NUMBER,
SHOW_LAYER_BOTH,
CLEAN_LAYER_BOTH,
} LAYER_TYPE;

typedef enum
{
FEEDRATE_XY = 0,
FEEDRATE_Z,
FEEDRATE_E,
FEEDRATE_COUNT,
} FEEDRATE_INDEX;

typedef struct
{
// General Settings
uint8_t serial_port[MAX_SERIAL_PORT_COUNT];
uint8_t emulated_m600;
uint8_t general_settings; // emulated M600 / M109 / M190 toggles (Bit Values)

// UI Settings
uint8_t rotate_ui;
Expand Down
3 changes: 2 additions & 1 deletion TFT/src/User/API/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ void parseConfigKey(uint16_t index)
break;

case C_INDEX_EMULATED_M600:
infoSettings.emulated_m600 = getOnOff();
case C_INDEX_EMULATED_M109_M190:
SET_BIT_VALUE(infoSettings.general_settings, (index - C_INDEX_EMULATED_M600), getOnOff());
break;

//----------------------------UI Settings
Expand Down
Loading

0 comments on commit 12889f7

Please sign in to comment.