this->on_boot_gcode_enable = THEKERNEL->config->value(on_boot_gcode_enable_checksum)->by_default(true)->as_bool();
this->elapsed_secs = 0;
this->reply_stream = NULL;
+ this->halted= false;
}
void Player::on_halt(void *)
{
- abort_command("", &(StreamOutput::NullStream));
+ halted= true;
}
void Player::on_second_tick(void *)
this->current_stream = NULL;
fclose(current_file_handler);
current_file_handler = NULL;
+ // clear out the block queue
+ THEKERNEL->conveyor->flush_queue();
stream->printf("Aborted playing or paused file\r\n");
}
}
if( this->playing_file ) {
+ if(halted) {
+ halted= false;
+ abort_command("", &(StreamOutput::NullStream));
+ return;
+ }
+
char buf[130]; // lines upto 128 characters are allowed, anything longer is discarded
bool discard = false;
string filename;
- bool on_boot_gcode_enable;
- bool booted;
string on_boot_gcode;
- bool playing_file;
StreamOutput* current_stream;
StreamOutput* reply_stream;
FILE* current_file_handler;
unsigned long file_size, played_cnt;
unsigned long elapsed_secs;
+ struct {
+ bool on_boot_gcode_enable:1;
+ bool booted:1;
+ bool playing_file:1;
+ bool halted:1;
+ };
};
#endif // PLAYER_H