Minor updates.
- Updated makefile to be more universally compatible by not requiring grep or ruby. - Edited XON/XOFF flow control usage, noting that FTDI-based Arduinos are known to work, but not Atmega8U2-based Arduino. Still officially not supported, but added for advanced users. - Minor edits.
This commit is contained in:
parent
d6abf10d49
commit
86cdae0060
5
Makefile
5
Makefile
@ -40,7 +40,7 @@ FUSES = -U hfuse:w:0xd2:m -U lfuse:w:0xff:m
|
|||||||
# Tune the lines below only if you know what you are doing:
|
# Tune the lines below only if you know what you are doing:
|
||||||
|
|
||||||
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F
|
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -B 10 -F
|
||||||
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -I. -ffunction-sections
|
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -I. -ffunction-sections
|
||||||
|
|
||||||
# symbolic targets:
|
# symbolic targets:
|
||||||
all: grbl.hex
|
all: grbl.hex
|
||||||
@ -81,8 +81,7 @@ main.elf: $(OBJECTS)
|
|||||||
grbl.hex: main.elf
|
grbl.hex: main.elf
|
||||||
rm -f grbl.hex
|
rm -f grbl.hex
|
||||||
avr-objcopy -j .text -j .data -O ihex main.elf grbl.hex
|
avr-objcopy -j .text -j .data -O ihex main.elf grbl.hex
|
||||||
avr-objdump -h main.elf | grep .bss | ruby -e 'puts "\n\n--- Requires %s bytes of SRAM" % STDIN.read.match(/0[0-9a-f]+\s/)[0].to_i(16)'
|
avr-size -C --mcu=$(DEVICE) main.elf
|
||||||
avr-size *.hex *.elf *.o
|
|
||||||
# If you have an EEPROM section, you must also create a hex file for the
|
# If you have an EEPROM section, you must also create a hex file for the
|
||||||
# EEPROM and add it to the "flash" target.
|
# EEPROM and add it to the "flash" target.
|
||||||
|
|
||||||
|
15
config.h
15
config.h
@ -115,12 +115,15 @@
|
|||||||
#define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds)
|
#define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds)
|
||||||
|
|
||||||
// FOR ADVANCED USERS ONLY: Toggles XON/XOFF software flow control for serial communications.
|
// FOR ADVANCED USERS ONLY: Toggles XON/XOFF software flow control for serial communications.
|
||||||
// Officially not supported due to problems involving USB-to-serial chip latency (Atmega8U2/FTDI)
|
// Officially not supported due to problems involving the Atmega8U2 USB-to-serial chips on current
|
||||||
// when connecting to an Arduino through the USB port. This problem has to do with having no control
|
// future Arduinos boards. The firmware on these chips do not support XON/XOFF flow control
|
||||||
// of the USB packets and causing standard terminal programs not being able to honor the XON/XOFF
|
// characters and the intermediate buffer in the chips cause latency and overflow problems with
|
||||||
// control characters on time. However, with specially programmed UI's or avoiding the USB interface
|
// standard terminal programs. However, using specifically-programmed UI's to manage this latency
|
||||||
// completely, XON/XOFF flow control should work. In any case, please report any successes to grbl
|
// problem has been confirmed to work, as well as, using older FTDI FT232RL-based Arduinos
|
||||||
// administrators!
|
// (Duemilanove) since their firmaware correctly manage the XON/XOFF characters. Other unconfirmed
|
||||||
|
// methods include using an FTDI board/cable or directly communicate on the RX/TX pins on the
|
||||||
|
// Arduino, both of which circumvent the Atmega8U2 chip altogether. In any case, please report any
|
||||||
|
// successes to grbl administrators!
|
||||||
#define ENABLE_XONXOFF 0 // Boolean. Default disabled.
|
#define ENABLE_XONXOFF 0 // Boolean. Default disabled.
|
||||||
|
|
||||||
// -----------------------------------------------
|
// -----------------------------------------------
|
||||||
|
2
gcode.c
2
gcode.c
@ -569,7 +569,7 @@ static int next_statement(char *letter, double *double_ptr, char *line, uint8_t
|
|||||||
- Evaluation of expressions
|
- Evaluation of expressions
|
||||||
- Variables
|
- Variables
|
||||||
- Multiple home locations
|
- Multiple home locations
|
||||||
- Multiple coordinate systems (May be added in the future)
|
- Multiple coordinate systems (Additional ones maybe added in config.h)
|
||||||
- Probing
|
- Probing
|
||||||
- Override control
|
- Override control
|
||||||
- Tool changes
|
- Tool changes
|
||||||
|
2
limits.c
2
limits.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
limits.h - code pertaining to limit-switches and performing the homing cycle
|
limits.c - code pertaining to limit-switches and performing the homing cycle
|
||||||
Part of Grbl
|
Part of Grbl
|
||||||
|
|
||||||
Copyright (c) 2009-2011 Simen Svale Skogsrud
|
Copyright (c) 2009-2011 Simen Svale Skogsrud
|
||||||
|
36
serial.c
36
serial.c
@ -111,24 +111,24 @@ ISR(USART_UDRE_vect)
|
|||||||
uint8_t tail = tx_buffer_tail;
|
uint8_t tail = tx_buffer_tail;
|
||||||
|
|
||||||
#if ENABLE_XONXOFF
|
#if ENABLE_XONXOFF
|
||||||
switch (flow_ctrl) {
|
if (flow_ctrl == SEND_XOFF) {
|
||||||
case SEND_XOFF: UDR0 = XOFF_CHAR; flow_ctrl = XOFF_SENT; break;
|
UDR0 = XOFF_CHAR;
|
||||||
case SEND_XON: UDR0 = XON_CHAR; flow_ctrl = XON_SENT; break;
|
flow_ctrl = XOFF_SENT;
|
||||||
default:
|
} else if (flow_ctrl == SEND_XON) {
|
||||||
|
UDR0 = XON_CHAR;
|
||||||
|
flow_ctrl = XON_SENT;
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
// Send a byte from the buffer
|
||||||
|
UDR0 = tx_buffer[tail];
|
||||||
|
|
||||||
// Send a byte from the buffer
|
// Update tail position
|
||||||
UDR0 = tx_buffer[tail];
|
tail++;
|
||||||
|
if (tail == TX_BUFFER_SIZE) { tail = 0; }
|
||||||
// Update tail position
|
|
||||||
tail++;
|
tx_buffer_tail = tail;
|
||||||
if (tail == TX_BUFFER_SIZE) { tail = 0; }
|
}
|
||||||
|
|
||||||
tx_buffer_tail = tail;
|
|
||||||
|
|
||||||
#if ENABLE_XONXOFF
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Turn off Data Register Empty Interrupt to stop tx-streaming if this concludes the transfer
|
// Turn off Data Register Empty Interrupt to stop tx-streaming if this concludes the transfer
|
||||||
if (tail == tx_buffer_head) { UCSR0B &= ~(1 << UDRIE0); }
|
if (tail == tx_buffer_head) { UCSR0B &= ~(1 << UDRIE0); }
|
||||||
@ -144,7 +144,7 @@ uint8_t serial_read()
|
|||||||
if (rx_buffer_tail == RX_BUFFER_SIZE) { rx_buffer_tail = 0; }
|
if (rx_buffer_tail == RX_BUFFER_SIZE) { rx_buffer_tail = 0; }
|
||||||
|
|
||||||
#if ENABLE_XONXOFF
|
#if ENABLE_XONXOFF
|
||||||
if ((get_rx_buffer_count() < RX_BUFFER_LOW) && flow_ctrl != XON_SENT) {
|
if ((get_rx_buffer_count() < RX_BUFFER_LOW) && flow_ctrl == XOFF_SENT) {
|
||||||
flow_ctrl = SEND_XON;
|
flow_ctrl = SEND_XON;
|
||||||
UCSR0B |= (1 << UDRIE0); // Force TX
|
UCSR0B |= (1 << UDRIE0); // Force TX
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ ISR(USART_RX_vect)
|
|||||||
rx_buffer_head = next_head;
|
rx_buffer_head = next_head;
|
||||||
|
|
||||||
#if ENABLE_XONXOFF
|
#if ENABLE_XONXOFF
|
||||||
if ((get_rx_buffer_count() >= RX_BUFFER_FULL) && flow_ctrl != XOFF_SENT) {
|
if ((get_rx_buffer_count() >= RX_BUFFER_FULL) && flow_ctrl == XON_SENT) {
|
||||||
flow_ctrl = SEND_XOFF;
|
flow_ctrl = SEND_XOFF;
|
||||||
UCSR0B |= (1 << UDRIE0); // Force TX
|
UCSR0B |= (1 << UDRIE0); // Force TX
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user