Skip to content

Commit

Permalink
Option to disable runtime cancel button checking.
Browse files Browse the repository at this point in the history
Added a config variable that disables runtime checking of the i2c
display, for those of us who have trouble with our lasers freezing
up part way through a job
  • Loading branch information
thinkl33t committed Sep 19, 2015
1 parent 8eaf6a5 commit 83b0c45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions laser/LaosMenu/LaosMenu.cpp
Expand Up @@ -527,10 +527,13 @@ void LaosMenu::Handle() {
#endif
while ((!feof(runfile)) && mot->ready()) {
mot->write(readint(runfile));
if(dsp->read_nb() == K_CANCEL) {
while (mot->queue());
mot->reset();
fseek(runfile, 0, SEEK_END);
if(cfg->disablecancelcheck == false)
{
if(dsp->read_nb() == K_CANCEL) {
while (mot->queue());
mot->reset();
fseek(runfile, 0, SEEK_END);
}
}
}
#ifdef READ_FILE_DEBUG
Expand Down
1 change: 1 addition & 0 deletions laser/global.cpp
Expand Up @@ -76,6 +76,7 @@ GlobalConfig::GlobalConfig(const std::string& filename)
cfg.Value("sys.nodisplay", &nodisplay, 1);
cfg.Value("sys.i2cbaud", &i2cbaud, 9600);
cfg.Value("sys.cleandir", &cleandir, 1);
cfg.Value("sys.disablecancelcheck", &disablecancelcheck, 0);

// Laser
cfg.Value("laser.enable", &lenable, 1); // laser enable polarity [0/1]
Expand Down
1 change: 1 addition & 0 deletions laser/global.h
Expand Up @@ -46,6 +46,7 @@ class GlobalConfig
int nodisplay; // there is no display
int cleandir; // remove files from SD at startup
int i2cbaud; // i2cBaudrate
int disablecancelcheck; // if the check for cancel button should be disabled while a job is running
int xmax, ymax, zmax, emax; // max values
int xmin, ymin, zmin, emin; // min values
int xpol, ypol, zpol, epol; // polarity for the home switches
Expand Down

0 comments on commit 83b0c45

Please sign in to comment.