Skip to content

Commit e0e717b

Browse files
committed
Fix abort command is ignored
1 parent bca0a15 commit e0e717b

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

cmake/dev_tools.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# 2 = Debug
1010
# 1 = Error only
1111
# 0 = Disabled
12-
set(ESP3D_TFT_LOG_LEVEL 0)
12+
set(ESP3D_TFT_LOG_LEVEL 2)
1313
add_compile_options(-DESP3D_TFT_LOG=${ESP3D_TFT_LOG_LEVEL})
1414

1515
# ANSI Color in Logs

main/modules/gcode_host/esp3d_gcode_host_service.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ void ESP3DGCodeHostService::_handle_notifications() {
12291229
}
12301230
}
12311231
if (ulTaskNotifyTakeIndexed(_xAbortNotifyIndex, pdTRUE, 0)) {
1232-
esp3d_log("Received abort notification");
1232+
esp3d_log_d("Received abort notification");
12331233
if (state != ESP3DGcodeStreamState::undefined) {
12341234
if (!_setStreamRequestState(ESP3DGcodeStreamState::abort)) {
12351235
esp3d_log_e("Failed to abort stream");
@@ -1303,7 +1303,7 @@ void ESP3DGCodeHostService::_handle_stream_states() {
13031303
// check if we have a requested command to process before reading the
13041304
// next
13051305
if (_requested_state != (ESP3DGcodeStreamState::undefined)) {
1306-
if (_requested_state == ESP3DGcodeStreamState::pause) {
1306+
if (_requested_state == ESP3DGcodeStreamState::pause || _requested_state == ESP3DGcodeStreamState::abort) {
13071307
// pause the stream
13081308
_setStreamState(_requested_state);
13091309
} else {
@@ -1592,11 +1592,15 @@ void ESP3DGCodeHostService::_handle_stream_states() {
15921592
/////////////////////////////////////////////////////////
15931593
// only valid for main stream
15941594
case ESP3DGcodeStreamState::abort:
1595+
esp3d_log_d("Received abort notification");
15951596
if (!_setMainStreamState(ESP3DGcodeStreamState::end)) {
15961597
esp3d_log_e("Abort only valid for main stream");
15971598
break;
15981599
}
1600+
esp3d_log_d("Aborting current stream");
1601+
15991602
if (_stop_script.length() > 0) {
1603+
esp3d_log_d("Adding stop script");
16001604
_add_stream(_stop_script.c_str(), _current_main_stream_ptr->auth_type,
16011605
true);
16021606
}

main/modules/gcode_host/esp3d_gcode_host_service.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ class ESP3DGCodeHostService : public ESP3DClient {
122122

123123
TaskHandle_t _xHandle = NULL;
124124
bool _started = false;
125-
const UBaseType_t _xPauseNotifyIndex = 1;
126-
const UBaseType_t _xResumeNotifyIndex = 2;
127-
const UBaseType_t _xAbortNotifyIndex = 3;
125+
const UBaseType_t _xPauseNotifyIndex = 0;
126+
const UBaseType_t _xResumeNotifyIndex = 1;
127+
const UBaseType_t _xAbortNotifyIndex = 2;
128128

129129
ESP3DClientType _outputClient = ESP3DClientType::no_client;
130130
bool _awaitingAck = false;

0 commit comments

Comments
 (0)