ARM: get gcode_parse.c in.
Just did it, no code changes neccessary. Except ajusting the
boundaries to not yet ported code.
Successful tests: controller answers with "ok", just like an AVR.
Binary size raised, of course:
SIZES ARM... lpc1114
FLASH : 3064 bytes 10%
RAM : 194 bytes 5%
EEPROM : 0 bytes 0%
This commit is contained in:
parent
ab910ee1c4
commit
e5729d6743
|
|
@ -98,6 +98,7 @@ TARGET = $(PROGRAM).hex
|
||||||
# Until the generic ARM port is completed, we'd have to wrap all sources
|
# Until the generic ARM port is completed, we'd have to wrap all sources
|
||||||
# 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
|
||||||
ifeq ($(MCU), lpc1114)
|
ifeq ($(MCU), lpc1114)
|
||||||
SOURCES += cmsis-system_lpc11xx.c
|
SOURCES += cmsis-system_lpc11xx.c
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,9 @@ uint8_t gcode_parse_char(uint8_t c) {
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
// process
|
// process
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
process_gcode_command();
|
process_gcode_command();
|
||||||
|
#endif /* __ARMEL_NOTYET__ */
|
||||||
|
|
||||||
// Acknowledgement ("ok") is sent in the main loop, in mendel.c.
|
// Acknowledgement ("ok") is sent in the main loop, in mendel.c.
|
||||||
|
|
||||||
|
|
|
||||||
10
mendel.c
10
mendel.c
|
|
@ -33,7 +33,9 @@
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#ifndef __ARMEL_NOTYET__
|
#ifndef __ARMEL_NOTYET__
|
||||||
#include "dda_queue.h"
|
#include "dda_queue.h"
|
||||||
|
#endif /* __ARMEL_NOTYET__ */
|
||||||
#include "gcode_parse.h"
|
#include "gcode_parse.h"
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "temp.h"
|
#include "temp.h"
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
@ -82,10 +84,10 @@ void init(void) {
|
||||||
// set up serial
|
// set up serial
|
||||||
serial_init();
|
serial_init();
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
// set up G-code parsing
|
// set up G-code parsing
|
||||||
gcode_init();
|
gcode_init();
|
||||||
|
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
// set up inputs and outputs
|
// set up inputs and outputs
|
||||||
pinio_init();
|
pinio_init();
|
||||||
|
|
||||||
|
|
@ -139,18 +141,17 @@ int main (int argc, char** argv)
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
uint8_t c, line_done, ack_waiting = 0;
|
uint8_t c, line_done, ack_waiting = 0;
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
// main loop
|
// main loop
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
// if queue is full, no point in reading chars- host will just have to wait
|
// if queue is full, no point in reading chars- host will just have to wait
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
if (queue_full() == 0) {
|
if (queue_full() == 0) {
|
||||||
|
#endif /* __ARMEL_NOTYET__ */
|
||||||
/**
|
/**
|
||||||
Postpone sending acknowledgement until there's a free slot in the
|
Postpone sending acknowledgement until there's a free slot in the
|
||||||
movement queue. This way the host waits with sending the next line
|
movement queue. This way the host waits with sending the next line
|
||||||
|
|
@ -180,6 +181,7 @@ int main (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
#ifdef SD
|
#ifdef SD
|
||||||
if (( ! gcode_active || gcode_active & GCODE_SOURCE_SD) &&
|
if (( ! gcode_active || gcode_active & GCODE_SOURCE_SD) &&
|
||||||
gcode_sources & GCODE_SOURCE_SD) {
|
gcode_sources & GCODE_SOURCE_SD) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue