Skip to content

Commit

Permalink
Add control from ESP400/ESP401 on tft polling
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-github committed Jun 11, 2024
1 parent ed0a325 commit b86c781
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
11 changes: 11 additions & 0 deletions main/core/commands/esp400.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,17 @@ void ESP3DCommands::ESP400(int cmd_params_pos, ESP3DMessage* msg) {
false, target, requestId)) {
esp3d_log_e("Error sending response to clients");
}
#if ESP3D_DISPLAY_FEATURE
//Polling on
if (!dispatchSetting(json, "service/gcodehost",
ESP3DSettingIndex::esp3d_polling_on, "polling_on",
YesNoValues, YesNoLabels,
sizeof(YesNoValues) / sizeof(char*), -1, -1, -1, nullptr,
false, target, requestId)) {
esp3d_log_e("Error sending response to clients");
}
#endif // ESP3D_DISPLAY_FEATURE

#if ESP3D_SD_CARD_FEATURE
#if ESP3D_SD_IS_SPI
// SPI Divider factor
Expand Down
8 changes: 8 additions & 0 deletions main/core/commands/esp401.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#if ESP3D_TIMESTAMP_FEATURE
#include "time/esp3d_time_service.h"
#endif // ESP3D_TIMESTAMP_FEATURE
#if ESP3D_DISPLAY_FEATURE
#include "rendering/esp3d_rendering_client.h"
#endif // ESP3D_DISPLAY_FEATURE
#if ESP3D_WEBDAV_SERVICES_FEATURE
#include "http/esp3d_http_service.h"
#endif // ESP3D_WEBDAV_SERVICES_FEATURE
Expand Down Expand Up @@ -251,6 +254,11 @@ void ESP3DCommands::ESP401(int cmd_params_pos, ESP3DMessage* msg) {
case ESP3DSettingIndex::esp3d_resume_script:
gcodeHostService.updateScripts();
break;
#if ESP3D_DISPLAY_FEATURE
case ESP3DSettingIndex::esp3d_polling_on:
renderingClient.setPolling(valueb);
break;
#endif
case ESP3DSettingIndex::esp3d_target_firmware:
esp3dTftstream.getTargetFirmware(true);

Expand Down
2 changes: 1 addition & 1 deletion main/core/includes/esp3d_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#define ESP3D_TFT_VERSION "1.0.0.a23"
#define ESP3D_TFT_VERSION "1.0.0.a24"
#define ESP3D_TFT_FW_URL "https://github.com/luc-github/ESP3D-TFT"

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions main/display/cnc/grbl/screens/informations_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ void addInformationToList(lv_obj_t *list, ESP3DLabel label, const char *info) {
lv_list_add_btn(list, "", infoStr.c_str());
}

void addInformationToList(lv_obj_t *list, ESP3DLabel label, ESP3DLabel info) {
/*void addInformationToList(lv_obj_t *list, ESP3DLabel label, ESP3DLabel info) {
std::string infoStr = esp3dTranslationService.translate(label);
infoStr += ": ";
infoStr += esp3dTranslationService.translate(info);
lv_list_add_btn(list, "", infoStr.c_str());
}
}*/

void create() {
esp3dTftui.set_current_screen(ESP3DScreenType::none);
Expand Down
1 change: 1 addition & 0 deletions main/modules/rendering/esp3d_rendering_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ESP3DRenderingClient : public ESP3DClient {
void flush();
bool started() { return _started; }
void setPolling(bool polling_on) { _polling_on = polling_on; }
bool isPolling() { return _polling_on; }

private:
TaskHandle_t _xHandle;
Expand Down

0 comments on commit b86c781

Please sign in to comment.