Skip to content

Commit 690f493

Browse files
committed
Fixed num_tools, added TFT-ER pin numbers, rearranged machine gui
1 parent 6dde4e1 commit 690f493

File tree

5 files changed

+32
-33
lines changed

5 files changed

+32
-33
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,25 @@ case you use different hardware or want a different pin connection layout
112112

113113
Check out [releases](https://github.com/seeul8er/RepPanel_ESP32/releases) for compiled binaries.
114114

115-
### Wiring ER-TFTM035-6 to the ESP32 DevKit with 36GPIOs
115+
### Wiring ER-TFTM035-6 to the ESP32 DevKit
116116

117117
**Beware:** The available development boards have different pin configurations. Some have GND & 3.3V at the bottom. Others at the top.
118-
![ESP32 Devkit wire connections](wiki/Wiring_ESP32_DevKit_38GPIOs.jpg)
119-
![ER-TFTM035-6 wiring](wiki/Wiring_ERTFT.jpg)
120118

121119
Pin configuration of ready made images:
122-
| **Pin Number** | **Function** | **Description** |
123-
|:--------------: |:------------: |:-------------------------: |
124-
| GPIO 13 | MOSI | Data line to TFT |
125-
| GPIO 14 | SCL | SPI CLK for TFT |
126-
| GPIO 15 | Slave Select | SPI |
127-
| GPIO 22 | SCL | I²C - touch |
128-
| GPIO 21 | SDA | I²C - touch |
129-
| GPIO 4 | Reset | TFT related |
130-
| GPIO 2 | Data | TFT related |
131-
| GPIO 27 | Backlight | Turn on/off TFT backlight |
132-
| GPIO 17 | UART TX | Connect to RX PanelDue port |
133-
| GPIO 16 | UART RX | Connect to TX PanelDue port |
120+
| **Pin Number ESP32 ** | **Pin Number ER-TFTM035-6** | **Function** | **Description** |
121+
|:--------------:|:--:|:------------: |:-------------------------: |
122+
| VCC 3.3V | 2 | Power supply | Match TFT voltage with ESP32 pin |
123+
| GND | 1 | GND | Ground |
124+
| GPIO 13 | 27 | MOSI | Data line to TFT |
125+
| GPIO 14 | 24 | SCL | SPI CLK for TFT |
126+
| GPIO 15 | 23 | Slave Select | SPI |
127+
| GPIO 22 | 30 | SCL | I²C - touch |
128+
| GPIO 21 | 31 | SDA | I²C - touch |
129+
| GPIO 4 | 21 | Reset | TFT related |
130+
| GPIO 2 | 25 | Data | TFT related |
131+
| GPIO 27 | 29 | Backlight | Turn on/off TFT backlight |
132+
| GPIO 17 | - | UART TX | Connect to RX PanelDue port |
133+
| GPIO 16 | - | UART RX | Connect to TX PanelDue port |
134134

135135
## Screenshots
136136
![RepPanel with case](wiki/RepPanel_with_case.png)

main/reppanel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern "C" {
4040

4141
#define VERSION_MAJOR 1
4242
#define VERSION_MINOR 0
43-
#define VERSION_HOTFIX 0
43+
#define VERSION_HOTFIX 1
4444

4545
#define NUM_TEMPS_BUFF 15
4646
#define MAX_FILA_NAME_LEN 32

main/reppanel_machine.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,17 @@ void draw_machine(lv_obj_t *parent_screen) {
220220
lv_page_set_scrl_fit2(machine_page, LV_FIT_FILL, LV_FIT_FILL);
221221
lv_page_set_scrl_layout(machine_page, LV_LAYOUT_COL_M);
222222

223+
lv_obj_t *home_cont = lv_cont_create(machine_page, NULL);
224+
lv_cont_set_layout(home_cont, LV_LAYOUT_ROW_M);
225+
lv_cont_set_fit(home_cont, LV_FIT_TIGHT);
226+
lv_obj_t *label_home = lv_label_create(home_cont, NULL);
227+
lv_label_set_text(label_home, "Home:");
228+
btn_home_all = create_button(home_cont, btn_home_all, " All Axis ", _home_all_event);
229+
btn_home_x = create_button(home_cont, btn_home_x, " X ", _home_x_event);
230+
btn_home_y = create_button(home_cont, btn_home_y, " Y ", _home_y_event);
231+
btn_home_z = create_button(home_cont, btn_home_z, " Z ", _home_z_event);
232+
lv_style_copy(&not_homed_style, lv_btn_get_style(btn_home_x, LV_BTN_STYLE_REL));
233+
223234
lv_obj_t *cont_cali = lv_cont_create(machine_page, NULL);
224235
lv_cont_set_fit(cont_cali, LV_FIT_TIGHT);
225236
lv_cont_set_layout(cont_cali, LV_LAYOUT_ROW_M);
@@ -234,16 +245,5 @@ void draw_machine(lv_obj_t *parent_screen) {
234245
static lv_obj_t *do_cali_butn;
235246
create_button(cont_cali, do_cali_butn, "Start", _start_cali_event);
236247

237-
lv_obj_t *home_cont = lv_cont_create(machine_page, NULL);
238-
lv_cont_set_layout(home_cont, LV_LAYOUT_ROW_M);
239-
lv_cont_set_fit(home_cont, LV_FIT_TIGHT);
240-
lv_obj_t *label_home = lv_label_create(home_cont, NULL);
241-
lv_label_set_text(label_home, "Home:");
242-
btn_home_all = create_button(home_cont, btn_home_all, " All Axis ", _home_all_event);
243-
btn_home_x = create_button(home_cont, btn_home_x, " X ", _home_x_event);
244-
btn_home_y = create_button(home_cont, btn_home_y, " Y ", _home_y_event);
245-
btn_home_z = create_button(home_cont, btn_home_z, " Z ", _home_z_event);
246-
lv_style_copy(&not_homed_style, lv_btn_get_style(btn_home_x, LV_BTN_STYLE_REL));
247-
248248
update_ui_machine();
249249
}

main/reppanel_process.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ lv_obj_t *popup_page;
3535
lv_obj_t *ddlist_selected_filament;
3636
static lv_obj_t *cont_filament;
3737

38-
int num_tools = 0;
38+
int num_tools = 1;
3939
reprap_tool_t reprap_tools[MAX_NUM_TOOLS];
4040
reprap_bed_t reprap_bed;
4141
reprap_tool_poss_temps_t reprap_tool_poss_temps;
@@ -177,14 +177,14 @@ static void unload_filament_event_handler(lv_obj_t *obj, lv_event_t event) {
177177

178178
static void send_deactivate_bed_heater() {
179179
char gcode_buff[64];
180-
ESP_LOGI(TAG, "\tDeactivating bed heater\n");
180+
ESP_LOGI(TAG, "\tDeactivating bed heater");
181181
sprintf(gcode_buff, "M140 P%i S-273.15", reprap_bed.heater_indx);
182182
reprap_send_gcode(gcode_buff);
183183
}
184184

185185
static void send_deactivate_tool_heater() {
186186
char gcode_buff[64];
187-
ESP_LOGI(TAG, "\tDeactivating tool %i heater\n", current_visible_tool_indx);
187+
ESP_LOGI(TAG, "\tDeactivating tool %i heater", current_visible_tool_indx);
188188
sprintf(gcode_buff, "G10 P%i S-273.15 R-273.15", reprap_tools[current_visible_tool_indx].number);
189189
reprap_send_gcode(gcode_buff);
190190
}

main/reppanel_request.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ void process_reprap_status(char *buff) {
202202
}
203203
}
204204
num_heaters = pos;
205-
num_tools = pos - 1; // best guess: (number of heaters - bed heater) = number of tools
206205

207206
cJSON *duet_seq = cJSON_GetObjectItem(root, "seq"); // Get seq number
208207
if (duet_seq && cJSON_IsNumber(duet_seq)) {
@@ -243,8 +242,8 @@ void process_reprap_status(char *buff) {
243242
pos++;
244243
}
245244
}
246-
got_extended_status = true; // TODO: Not the same for WiFi and UART autoremove
247-
num_tools = pos;
245+
got_extended_status = true;
246+
num_tools = pos; // update number of tools
248247
}
249248

250249
// Get firmware information

0 commit comments

Comments
 (0)