Make use of the new usb_serial (and drop usage of lufa_serial).
At this point in time not a single user of LUFA is known and here is reported how usb_serial apparently works more reliable: http://forums.reprap.org/read.php?147,33082,160724#msg-160724 So it's likely we can move from lufa_serial to usb_serial entirely.
This commit is contained in:
parent
7d6ffdae17
commit
0b11812ce5
17
Makefile
17
Makefile
|
|
@ -94,7 +94,7 @@ PROGID = stk500v2
|
|||
|
||||
PROGRAM = mendel
|
||||
|
||||
SOURCES = $(PROGRAM).c gcode_parse.c gcode_process.c dda.c dda_maths.c dda_queue.c timer.c temp.c sermsg.c watchdog.c debug.c sersendf.c heater.c analog.c intercom.c pinio.c clock.c home.c crc.c delay.c
|
||||
SOURCES = $(PROGRAM).c gcode_parse.c gcode_process.c dda.c dda_maths.c dda_queue.c timer.c temp.c sermsg.c watchdog.c debug.c sersendf.c heater.c analog.c intercom.c pinio.c clock.c home.c crc.c delay.c serial.c
|
||||
|
||||
ARCH = avr-
|
||||
CC = $(ARCH)gcc
|
||||
|
|
@ -110,19 +110,14 @@ LIBDEPS =
|
|||
SUBDIRS =
|
||||
|
||||
ifneq (,$(findstring usb,$(MCU_TARGET)))
|
||||
USE_LUFA = true
|
||||
USE_USB = true
|
||||
endif
|
||||
ifneq (,$(findstring u4,$(MCU_TARGET)))
|
||||
USE_LUFA = true
|
||||
USE_USB = true
|
||||
endif
|
||||
ifdef USE_LUFA
|
||||
LDFLAGS += -Llufa_serial
|
||||
|
||||
LIBS += -llufa_serial
|
||||
SUBDIRS += lufa_serial
|
||||
LIBDEPS += lufa_serial/liblufa_serial.a
|
||||
else
|
||||
SOURCES += serial.c
|
||||
ifdef USE_USB
|
||||
CFLAGS += -DUSE_USB
|
||||
SOURCES += usb_serial.c
|
||||
endif
|
||||
|
||||
ifeq ($(PROGBAUD),0)
|
||||
|
|
|
|||
2
serial.c
2
serial.c
|
|
@ -24,6 +24,7 @@
|
|||
/// ascii XON character
|
||||
#define ASCII_XON 17
|
||||
|
||||
#ifndef USE_USB
|
||||
/// rx buffer head pointer. Points to next available space.
|
||||
volatile uint8_t rxhead = 0;
|
||||
/// rx buffer tail pointer. Points to last character in buffer
|
||||
|
|
@ -223,6 +224,7 @@ void serial_writechar(uint8_t data)
|
|||
// enable TX interrupt so we can send this character
|
||||
UCSR0B |= MASK(UDRIE0);
|
||||
}
|
||||
#endif /* USE_USB */
|
||||
|
||||
/// send a whole block
|
||||
void serial_writeblock(void *data, int datalen)
|
||||
|
|
|
|||
10
serial.h
10
serial.h
|
|
@ -5,10 +5,17 @@
|
|||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#ifdef USE_USB
|
||||
#define serial_init() usb_init()
|
||||
#define serial_rxchars() usb_serial_available()
|
||||
#define serial_popchar() usb_serial_getchar()
|
||||
#define serial_writechar(c) usb_serial_putchar(c)
|
||||
#else
|
||||
// initialise serial subsystem
|
||||
void serial_init(void);
|
||||
|
||||
// return number of characters in the receive buffer, and number of spaces in the send buffer
|
||||
// return number of characters in the receive buffer,
|
||||
// and number of spaces in the send buffer
|
||||
uint8_t serial_rxchars(void);
|
||||
// uint8_t serial_txchars(void);
|
||||
|
||||
|
|
@ -16,6 +23,7 @@ uint8_t serial_rxchars(void);
|
|||
uint8_t serial_popchar(void);
|
||||
// send one character
|
||||
void serial_writechar(uint8_t data);
|
||||
#endif
|
||||
|
||||
// read/write many characters
|
||||
// uint8_t serial_recvblock(uint8_t *block, int blocksize);
|
||||
|
|
|
|||
Loading…
Reference in New Issue