Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/usr/bin/tclsh
# script to ensure e:[xyz]counts are zero if machine off
package require Hal
set ::prog [file tail [info script]]
set ::periodic_delay_ms 200
proc monitor_ecounts {} {
catch {after cancel $::a_id}
if { ![hal getp halui.machine.is-on]
&& ( 0 != [hal gets e:xcounts]
|| 0 != [hal gets e:ycounts]
|| 0 != [hal gets e:zcounts]) } {
# handle deferred connection to signal
if [catch { hal sets e:xcounts 0
hal sets e:ycounts 0
hal sets e:zcounts 0
} msg] {
puts stderr msg=$msg
puts stderr "$::prog exiting"
exit 1
}
}
set ::a_id [after $::periodic_delay_ms monitor_ecounts]
}
monitor_ecounts
vwait ::forever