diff --git a/dda.c b/dda.c index 3e85ca5..486907f 100644 --- a/dda.c +++ b/dda.c @@ -322,7 +322,7 @@ void dda_create(DDA *dda, TARGET *target) { // 2^32/6000 is about 715mm which should be plenty // changed * 10 to * (F_CPU / 100000) so we can work in cpu_ticks rather than microseconds. - // timer.c setTimer() routine altered for same reason + // timer.c timer_set() routine altered for same reason // changed distance * 6000 .. * F_CPU / 100000 to // distance * 2400 .. * F_CPU / 40000 so we can move a distance of up to 1800mm without overflowing @@ -527,7 +527,7 @@ void dda_start(DDA *dda) { dda->live = 1; // set timeout for first step - setTimer(dda->c); + timer_set(dda->c); } // else just a speed change, keep dda->live = 0 @@ -721,7 +721,7 @@ void dda_step(DDA *dda) { } else { psu_timeout = 0; - setTimer(dda->c); + timer_set(dda->c); } // turn off step outputs, hopefully they've been on long enough by now to register with the drivers diff --git a/dda_queue.c b/dda_queue.c index 2ea8a81..a3580bb 100644 --- a/dda_queue.c +++ b/dda_queue.c @@ -82,7 +82,7 @@ void queue_step() { DDA* current_movebuffer = &movebuffer[mb_tail]; if (current_movebuffer->live) { if (current_movebuffer->waitfor_temp) { - setTimer(HEATER_WAIT_TIMEOUT); + timer_set(HEATER_WAIT_TIMEOUT); if (temp_achieved()) { current_movebuffer->live = current_movebuffer->done = 0; serial_writestr_P(PSTR("Temp achieved\n")); @@ -139,7 +139,7 @@ void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) { if (isdead) { next_move(); - // Compensate for the cli() in setTimer(). + // Compensate for the cli() in timer_set(). sei(); } } @@ -158,14 +158,14 @@ void next_move() { uint8_t t = mb_tail + 1; t &= (MOVEBUFFER_SIZE - 1); DDA* current_movebuffer = &movebuffer[t]; - // tail must be set before setTimer call as setTimer - // reenables the timer interrupt, potentially exposing - // mb_tail to the timer interrupt routine. + // Tail must be set before calling timer_set(), as timer_set() reenables + // the timer interrupt, potentially exposing mb_tail to the timer + // interrupt routine. mb_tail = t; if (current_movebuffer->waitfor_temp) { serial_writestr_P(PSTR("Waiting for target temp\n")); current_movebuffer->live = 1; - setTimer(HEATER_WAIT_TIMEOUT); + timer_set(HEATER_WAIT_TIMEOUT); } else { dda_start(current_movebuffer); diff --git a/extruder/timer.c b/extruder/timer.c index 0c2420c..8845fa3 100644 --- a/extruder/timer.c +++ b/extruder/timer.c @@ -90,7 +90,7 @@ ISR(TIMER1_COMPA_vect) { next_step_time -= 65536; - // similar algorithm as described in setTimer below. + // Similar algorithm as described in timer_set() below. if (next_step_time < 65536) { OCR1A = (OCR1A + next_step_time) & 0xFFFF; } else if(next_step_time < 75536){ @@ -103,8 +103,7 @@ ISR(TIMER1_COMPA_vect) { /// initialise timer and enable system clock interrupt. /// step interrupt is enabled later when we start using it -void timer_init() -{ +void timer_init() { // no outputs TCCR1A = 0; // Normal Mode @@ -117,8 +116,7 @@ void timer_init() #ifdef HOST /// specify how long until the step timer should fire -void setTimer(uint32_t delay) -{ +void timer_set(uint32_t delay) { // save interrupt flag uint8_t sreg = SREG; uint16_t step_start = 0; diff --git a/extruder/timer.h b/extruder/timer.h index dd6b6be..9190420 100644 --- a/extruder/timer.h +++ b/extruder/timer.h @@ -23,7 +23,7 @@ timer stuff */ void timer_init(void) __attribute__ ((cold)); -void setTimer(uint32_t delay); +void timer_set(uint32_t delay); void timer_stop(void); diff --git a/simulator.h b/simulator.h index f9d7745..5abcf47 100644 --- a/simulator.h +++ b/simulator.h @@ -171,7 +171,7 @@ void sim_gcode(const char msg[]); void sim_timer_init(uint8_t scale); void sim_timer_stop(void); -void sim_setTimer(void); +void sim_timer_set(void); uint16_t sim_tick_counter(void); uint64_t sim_runtime_ns(void); ///< Simulated run-time in nanoseconds void sim_time_warp(void); ///< skip ahead to next timer interrupt, when time_scale==0 diff --git a/simulator/timer_ext.c b/simulator/timer_ext.c index f7f05e1..3a3a7a8 100644 --- a/simulator/timer_ext.c +++ b/simulator/timer_ext.c @@ -161,10 +161,10 @@ static void timer1_isr(void) { sei(); // Setup next timer - sim_setTimer(); + sim_timer_set(); } -void sim_setTimer() { +void sim_timer_set() { // Set callbacks for COMPA and COMPB timers uint32_t nextA = 0, nextB = 0; uint16_t now = sim_tick_counter(); diff --git a/timer.c b/timer.c index d0aa9ca..0342bad 100644 --- a/timer.c +++ b/timer.c @@ -69,7 +69,7 @@ ISR(TIMER1_COMPA_vect) { next_step_time -= 65536; - // similar algorithm as described in setTimer below. + // Similar algorithm as described in timer_set() below. if (next_step_time < 65536) { OCR1A = (OCR1A + next_step_time) & 0xFFFF; } else if(next_step_time < 75536){ @@ -82,8 +82,7 @@ ISR(TIMER1_COMPA_vect) { /// initialise timer and enable system clock interrupt. /// step interrupt is enabled later when we start using it -void timer_init() -{ +void timer_init() { // no outputs TCCR1A = 0; // Normal Mode @@ -94,7 +93,7 @@ void timer_init() TIMSK1 = MASK(OCIE1B); #ifdef SIMULATOR // Tell simulator - sim_setTimer(); + sim_timer_set(); #endif } @@ -107,8 +106,7 @@ void timer_init() as late as possible. If you use it from outside the step interrupt, do a sei() after it to make the interrupt actually fire. */ -void setTimer(uint32_t delay) -{ +void timer_set(uint32_t delay) { uint16_t step_start = 0; #ifdef ACCELERATION_TEMPORAL uint16_t current_time; @@ -177,7 +175,7 @@ void setTimer(uint32_t delay) TIMSK1 |= MASK(OCIE1A); #ifdef SIMULATOR // Tell simulator - sim_setTimer(); + sim_timer_set(); #endif } diff --git a/timer.h b/timer.h index 0154191..c185ef3 100644 --- a/timer.h +++ b/timer.h @@ -26,7 +26,7 @@ timer stuff */ void timer_init(void) __attribute__ ((cold)); -void setTimer(uint32_t delay); +void timer_set(uint32_t delay); void timer_stop(void);