Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified klippy/chelper/c_helper.so
Binary file not shown.
Binary file modified klippy/chelper/itersolve.o
Binary file not shown.
Binary file modified klippy/chelper/kin_cartesian.o
Binary file not shown.
Binary file modified klippy/chelper/kin_corexy.o
Binary file not shown.
Binary file modified klippy/chelper/kin_corexz.o
Binary file not shown.
Binary file modified klippy/chelper/kin_delta.o
Binary file not shown.
Binary file modified klippy/chelper/kin_deltesian.o
Binary file not shown.
Binary file modified klippy/chelper/kin_extruder.o
Binary file not shown.
Binary file modified klippy/chelper/kin_idex.o
Binary file not shown.
Binary file modified klippy/chelper/kin_polar.o
Binary file not shown.
Binary file modified klippy/chelper/kin_rotary_delta.o
Binary file not shown.
Binary file modified klippy/chelper/kin_shaper.o
Binary file not shown.
Binary file modified klippy/chelper/kin_winch.o
Binary file not shown.
Binary file modified klippy/chelper/msgblock.o
Binary file not shown.
Binary file modified klippy/chelper/pollreactor.o
Binary file not shown.
Binary file modified klippy/chelper/pyhelper.o
Binary file not shown.
1 change: 1 addition & 0 deletions klippy/chelper/serialqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ static void *
background_thread(void *data)
{
struct serialqueue *sq = data;
nice(-20);
pollreactor_run(sq->pr);

pthread_mutex_lock(&sq->lock);
Expand Down
Binary file modified klippy/chelper/serialqueue.o
Binary file not shown.
11 changes: 11 additions & 0 deletions klippy/chelper/stepcompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ check_line(struct stepcompress *sc, struct step_move move)
|| move.interval >= 0x80000000) {
errorf("stepcompress o=%d i=%d c=%d a=%d: Invalid sequence"
, sc->oid, move.interval, move.count, move.add);
errorf("stepcompress queue[%p]=%u queue_end[%p]=%u queue_pos[%p]=%u queue_next[%p]=%u last_step_clock=%llu max_error=%u : lxc check_line"
, sc->queue, *(sc->queue), sc->queue_end, *(sc->queue_end), sc->queue_pos, *(sc->queue_pos),
sc->queue_next, *(sc->queue_next), sc->last_step_clock, sc->max_error);
uint16_t i;
uint32_t intervals = move.interval, ps = 0;
for (i=0; i<move.count; i++) {
ps += intervals;
struct points points = minmax_point(sc, sc->queue_pos + i);
errorf("stepcompress queue_pos+i=%u ps=%u minp=%u maxp=%u : lxc Invalid sequence 2"
, *(sc->queue_pos + i), ps, points.minp, points.maxp);
}
return ERROR_RET;
}
uint32_t interval = move.interval, p = 0;
Expand Down
Binary file modified klippy/chelper/stepcompress.o
Binary file not shown.
Binary file modified klippy/chelper/trapq.o
Binary file not shown.
Binary file modified klippy/chelper/trdispatch.o
Binary file not shown.
5 changes: 4 additions & 1 deletion klippy/clocksync.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ def connect(self, serial):
self.mcu_freq = serial.msgparser.get_constant_float('CLOCK_FREQ')
# Load initial clock and frequency
params = serial.send_with_response('get_uptime', 'uptime')
self.time_avg = params['#sent_time']
if not self.time_avg:
params = serial.send_with_response('get_uptime', 'uptime')
self.time_avg = params['#sent_time']
self.last_clock = (params['high'] << 32) | params['clock']
self.clock_avg = self.last_clock
self.time_avg = params['#sent_time']
self.clock_est = (self.time_avg, self.clock_avg, self.mcu_freq)
self.prediction_variance = (.001 * self.mcu_freq)**2
# Enable periodic get_clock timer
Expand Down
2 changes: 1 addition & 1 deletion klippy/extras/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def generate_stats(self, eventtime):
if max([s[0] for s in stats]):
logging.info("Stats %.1f: %s", eventtime,
' '.join([s[1] for s in stats]))
return eventtime + 1.
return eventtime + 3.

def load_config(config):
config.get_printer().add_object('system_stats', PrinterSysStats(config))
Expand Down
6 changes: 6 additions & 0 deletions klippy/reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ def _dispatch_loop(self):
self._g_dispatch = g_dispatch = greenlet.getcurrent()
busy = True
eventtime = self.monotonic()
try:
logging.info("_dispatch_loop current nice = %d", os.nice(0))
val = os.nice(-10)
logging.info("_dispatch_loop new nice = %d", val)
except:
pass
while self._process:
timeout = self._check_timers(eventtime, busy)
busy = False
Expand Down
8 changes: 7 additions & 1 deletion klippy/serialhdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ def __init__(self, reactor, warn_prefix="", mcu=None):
self.pending_notifications = {}
def _bg_thread(self):
response = self.ffi_main.new('struct pull_queue_message *')
try:
val = os.nice(-20)
logging.info("%scurrent nice = %d" ,self.warn_prefix, val)
except:
logging.info("%snice process failed", self.warn_prefix)
pass
while 1:
self.ffi_lib.serialqueue_pull(self.serialqueue, response)
count = response.len
Expand Down Expand Up @@ -130,7 +136,7 @@ def connect_canbus(self, canbus_uuid, canbus_nodeid, canbus_iface="can0"):
logging.info("%sStarting CAN connect", self.warn_prefix)
start_time = self.reactor.monotonic()
while 1:
if self.reactor.monotonic() > start_time + 90.:
if self.reactor.monotonic() > start_time + 50.:
self._error("Unable to connect")
try:
bus = can.interface.Bus(channel=canbus_iface,
Expand Down
Loading