Remove old XON/XOFF implementation, as it's redundant now.
This commit is contained in:
parent
a438a3fa2f
commit
f799228a8e
15
dda_queue.c
15
dda_queue.c
|
|
@ -3,7 +3,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
#include "config.h" // for XONXOFF
|
#include "config.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "sermsg.h"
|
#include "sermsg.h"
|
||||||
|
|
@ -76,13 +76,6 @@ void enqueue(TARGET *t) {
|
||||||
|
|
||||||
mb_head = h;
|
mb_head = h;
|
||||||
|
|
||||||
#ifdef XONXOFF
|
|
||||||
// If the queue has only two slots remaining, stop transmission. More
|
|
||||||
// characters might come in until the stop takes effect.
|
|
||||||
if (((mb_tail - mb_head - 1) & (MOVEBUFFER_SIZE - 1)) < (MOVEBUFFER_SIZE - 2))
|
|
||||||
xoff();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// fire up in case we're not running yet
|
// fire up in case we're not running yet
|
||||||
if (timerInterruptIsEnabled() == 0)
|
if (timerInterruptIsEnabled() == 0)
|
||||||
next_move();
|
next_move();
|
||||||
|
|
@ -99,12 +92,6 @@ void next_move() {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
disableTimerInterrupt();
|
disableTimerInterrupt();
|
||||||
|
|
||||||
#ifdef XONXOFF
|
|
||||||
// restart transmission if the move buffer is only half full
|
|
||||||
if (((mb_tail - mb_head - 1) & (MOVEBUFFER_SIZE - 1)) > (MOVEBUFFER_SIZE / 2))
|
|
||||||
xon();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_queue() {
|
void print_queue() {
|
||||||
|
|
|
||||||
6
gcode.c
6
gcode.c
|
|
@ -411,17 +411,11 @@ void process_gcode_command(GCODE_COMMAND *gcmd) {
|
||||||
|
|
||||||
// G4 - Dwell
|
// G4 - Dwell
|
||||||
case 4:
|
case 4:
|
||||||
#ifdef XONXOFF
|
|
||||||
xoff();
|
|
||||||
#endif
|
|
||||||
// wait for all moves to complete
|
// wait for all moves to complete
|
||||||
for (;queue_empty() == 0;)
|
for (;queue_empty() == 0;)
|
||||||
wd_reset();
|
wd_reset();
|
||||||
// delay
|
// delay
|
||||||
delay_ms(gcmd->P);
|
delay_ms(gcmd->P);
|
||||||
#ifdef XONXOFF
|
|
||||||
xon();
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// G20 - inches as units
|
// G20 - inches as units
|
||||||
|
|
|
||||||
28
serial.c
28
serial.c
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
|
#include "config.h" // for XONXOFF
|
||||||
#include "arduino.h"
|
#include "arduino.h"
|
||||||
|
|
||||||
#define BUFSIZE 64
|
#define BUFSIZE 64
|
||||||
|
|
@ -94,6 +95,7 @@ ISR(USART0_RX_vect)
|
||||||
// the buffer has only 16 free characters left, so send an XOFF
|
// the buffer has only 16 free characters left, so send an XOFF
|
||||||
// more characters might come in until the XOFF takes effect
|
// more characters might come in until the XOFF takes effect
|
||||||
flowflags = FLOWFLAG_SEND_XOFF | FLOWFLAG_STATE_XON;
|
flowflags = FLOWFLAG_SEND_XOFF | FLOWFLAG_STATE_XON;
|
||||||
|
// enable TX interrupt so we can send this character
|
||||||
UCSR0B |= MASK(UDRIE0);
|
UCSR0B |= MASK(UDRIE0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -214,29 +216,3 @@ void serial_writestr_P(PGM_P data)
|
||||||
while ((r = pgm_read_byte(&data[i++])))
|
while ((r = pgm_read_byte(&data[i++])))
|
||||||
serial_writechar(r);
|
serial_writechar(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XONXOFF
|
|
||||||
void xon() {
|
|
||||||
// disable TX interrupt
|
|
||||||
UCSR0B &= ~MASK(UDRIE0);
|
|
||||||
|
|
||||||
if ((flowflags & FLOWFLAG_STATE_XON) == 0)
|
|
||||||
flowflags = FLOWFLAG_SEND_XON;
|
|
||||||
else
|
|
||||||
flowflags = FLOWFLAG_STATE_XON; // purge a possible FLOWFLAG_SEND_XOFF
|
|
||||||
|
|
||||||
// enable TX interrupt so we can send this character
|
|
||||||
UCSR0B |= MASK(UDRIE0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void xoff() {
|
|
||||||
UCSR0B &= ~MASK(UDRIE0);
|
|
||||||
|
|
||||||
if (flowflags & FLOWFLAG_STATE_XON)
|
|
||||||
flowflags = FLOWFLAG_SEND_XOFF | FLOWFLAG_STATE_XON;
|
|
||||||
else
|
|
||||||
flowflags = 0;
|
|
||||||
|
|
||||||
UCSR0B |= MASK(UDRIE0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
8
serial.h
8
serial.h
|
|
@ -5,8 +5,6 @@
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
#include "config.h" // for XONXOFF
|
|
||||||
|
|
||||||
// initialise serial subsystem
|
// initialise serial subsystem
|
||||||
void serial_init(void);
|
void serial_init(void);
|
||||||
|
|
||||||
|
|
@ -29,10 +27,4 @@ void serial_writestr(uint8_t *data);
|
||||||
void serial_writeblock_P(PGM_P data, int datalen);
|
void serial_writeblock_P(PGM_P data, int datalen);
|
||||||
void serial_writestr_P(PGM_P data);
|
void serial_writestr_P(PGM_P data);
|
||||||
|
|
||||||
#ifdef XONXOFF
|
|
||||||
// XON/XOFF flow control
|
|
||||||
void xon(void);
|
|
||||||
void xoff(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _SERIAL_H */
|
#endif /* _SERIAL_H */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue