ARM: get dda_maths.c, dda_kinematics.c and dda.c in.
All in one chunk, because it's all hardware-independent and doing them one by one would end up on not more than some typing exercises. Compiles fine. For testing, remove if (DEBUG... for M114 in gcode_process.c. Then one can see how the queue fills up when sending movements and M114 repeatedly. This time with actual coordinates. No stepper movements, yet, because set_timer() is still empty.
This commit is contained in:
parent
692a6daeb2
commit
5a8d51cb19
|
|
@ -99,7 +99,7 @@ TARGET = $(PROGRAM).hex
|
||||||
# in #ifdef __AVR__. To avoid this, build only a selection for now:
|
# in #ifdef __AVR__. To avoid this, build only a selection for now:
|
||||||
SOURCES = mendel.c cpu.c serial.c sermsg.c sersendf.c delay.c
|
SOURCES = mendel.c cpu.c serial.c sermsg.c sersendf.c delay.c
|
||||||
SOURCES += gcode_parse.c gcode_process.c pinio.c timer.c clock.c
|
SOURCES += gcode_parse.c gcode_process.c pinio.c timer.c clock.c
|
||||||
SOURCES += dda_queue.c
|
SOURCES += dda_queue.c dda_maths.c dda_kinematics.c dda.c
|
||||||
ifeq ($(MCU), lpc1114)
|
ifeq ($(MCU), lpc1114)
|
||||||
SOURCES += cmsis-system_lpc11xx.c
|
SOURCES += cmsis-system_lpc11xx.c
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -42,3 +42,7 @@
|
||||||
Lookahead disabled.
|
Lookahead disabled.
|
||||||
#undef LOOKAHEAD
|
#undef LOOKAHEAD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __ARMEL_NOTYET__
|
||||||
|
#undef LOOKAHEAD
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ static const axes_uint32_t PROGMEM maximum_jerk_P = {
|
||||||
* exceeding the expected jerk. Worst case this speed is zero, which means a
|
* exceeding the expected jerk. Worst case this speed is zero, which means a
|
||||||
* full stop between both moves. Best case it's the lower of the maximum speeds.
|
* full stop between both moves. Best case it's the lower of the maximum speeds.
|
||||||
*
|
*
|
||||||
* This function is expected to be called from within dda_start().
|
* This function is expected to be called from within dda_create().
|
||||||
*
|
*
|
||||||
* \param [in] prev is the DDA structure of the move previous to the current one.
|
* \param [in] prev is the DDA structure of the move previous to the current one.
|
||||||
* \param [in] current is the DDA structure of the move currently created.
|
* \param [in] current is the DDA structure of the move currently created.
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,7 @@ void queue_step() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
dda_step(current_movebuffer);
|
dda_step(current_movebuffer);
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,9 +124,7 @@ void enqueue_home(TARGET *t, uint8_t endstop_check, uint8_t endstop_stop_cond) {
|
||||||
// it's a wait for temp
|
// it's a wait for temp
|
||||||
new_movebuffer->waitfor_temp = 1;
|
new_movebuffer->waitfor_temp = 1;
|
||||||
}
|
}
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
dda_create(new_movebuffer, t);
|
dda_create(new_movebuffer, t);
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
// make certain all writes to global memory
|
// make certain all writes to global memory
|
||||||
// are flushed before modifying mb_head.
|
// are flushed before modifying mb_head.
|
||||||
|
|
@ -173,9 +169,7 @@ void next_move() {
|
||||||
timer_set(HEATER_WAIT_TIMEOUT, 0);
|
timer_set(HEATER_WAIT_TIMEOUT, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
dda_start(current_movebuffer);
|
dda_start(current_movebuffer);
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,14 +46,12 @@ uint8_t next_tool;
|
||||||
void process_gcode_command() {
|
void process_gcode_command() {
|
||||||
uint32_t backup_f;
|
uint32_t backup_f;
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
// convert relative to absolute
|
// convert relative to absolute
|
||||||
if (next_target.option_all_relative) {
|
if (next_target.option_all_relative) {
|
||||||
next_target.target.axis[X] += startpoint.axis[X];
|
next_target.target.axis[X] += startpoint.axis[X];
|
||||||
next_target.target.axis[Y] += startpoint.axis[Y];
|
next_target.target.axis[Y] += startpoint.axis[Y];
|
||||||
next_target.target.axis[Z] += startpoint.axis[Z];
|
next_target.target.axis[Z] += startpoint.axis[Z];
|
||||||
}
|
}
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
// E relative movement.
|
// E relative movement.
|
||||||
// Matches Sprinter's behaviour as of March 2012.
|
// Matches Sprinter's behaviour as of March 2012.
|
||||||
|
|
@ -101,9 +99,8 @@ void process_gcode_command() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next_target.seen_G) {
|
if (next_target.seen_G) {
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
uint8_t axisSelected = 0;
|
uint8_t axisSelected = 0;
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
switch (next_target.G) {
|
switch (next_target.G) {
|
||||||
case 0:
|
case 0:
|
||||||
//? G0: Rapid Linear Motion
|
//? G0: Rapid Linear Motion
|
||||||
|
|
@ -272,7 +269,6 @@ void process_gcode_command() {
|
||||||
|
|
||||||
queue_wait();
|
queue_wait();
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
if (next_target.seen_X) {
|
if (next_target.seen_X) {
|
||||||
startpoint.axis[X] = next_target.target.axis[X];
|
startpoint.axis[X] = next_target.target.axis[X];
|
||||||
axisSelected = 1;
|
axisSelected = 1;
|
||||||
|
|
@ -298,7 +294,6 @@ void process_gcode_command() {
|
||||||
}
|
}
|
||||||
|
|
||||||
dda_new_startpoint();
|
dda_new_startpoint();
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 161:
|
case 161:
|
||||||
|
|
@ -641,13 +636,11 @@ void process_gcode_command() {
|
||||||
// wait for all moves to complete
|
// wait for all moves to complete
|
||||||
queue_wait();
|
queue_wait();
|
||||||
#endif
|
#endif
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
update_current_position();
|
update_current_position();
|
||||||
sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%lu\n"),
|
sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%lu\n"),
|
||||||
current_position.axis[X], current_position.axis[Y],
|
current_position.axis[X], current_position.axis[Y],
|
||||||
current_position.axis[Z], current_position.axis[E],
|
current_position.axis[Z], current_position.axis[E],
|
||||||
current_position.F);
|
current_position.F);
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
if (DEBUG_POSITION && (debug_flags & DEBUG_POSITION)) {
|
if (DEBUG_POSITION && (debug_flags & DEBUG_POSITION)) {
|
||||||
sersendf_P(PSTR("Endpoint: X:%ld,Y:%ld,Z:%ld,E:%ld,F:%lu,c:%lu}\n"),
|
sersendf_P(PSTR("Endpoint: X:%ld,Y:%ld,Z:%ld,E:%ld,F:%lu,c:%lu}\n"),
|
||||||
|
|
|
||||||
2
mendel.c
2
mendel.c
|
|
@ -100,10 +100,12 @@ void init(void) {
|
||||||
#ifndef __ARMEL_NOTYET__
|
#ifndef __ARMEL_NOTYET__
|
||||||
// read PID settings from EEPROM
|
// read PID settings from EEPROM
|
||||||
heater_init();
|
heater_init();
|
||||||
|
#endif /* __ARMEL_NOTYET__ */
|
||||||
|
|
||||||
// set up dda
|
// set up dda
|
||||||
dda_init();
|
dda_init();
|
||||||
|
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
// start up analog read interrupt loop,
|
// start up analog read interrupt loop,
|
||||||
// if any of the temp sensors in your config.h use analog interface
|
// if any of the temp sensors in your config.h use analog interface
|
||||||
analog_init();
|
analog_init();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue