Adding USB MSD implementation to the HAL: Now, when you plug the Native USB port of the Arduino DUE to your PC, it will be detected as a composite USB device: One of the devices is a USB CDC (Serial port over USB) with native USB handshake (no more overflows!!) (set SERIAL_PORT to -1 to use it as main serial port) and also, a MSD (USB Mass Storage Device) will be detected, and the SD card present on the socket will be reflected as a Removable disk on your PC)

This commit is contained in:
etagle
2017-12-21 02:42:46 -03:00
parent d8a4db72ac
commit 33a6fc70e4
43 changed files with 16226 additions and 8 deletions

View File

@@ -40,15 +40,13 @@
//
// Defines
//
#if SERIAL_PORT == -1
#define MYSERIAL SerialUSB
#elif SERIAL_PORT >= 0 && SERIAL_PORT <= 4
#if SERIAL_PORT >= -1 && SERIAL_PORT <= 4
#define MYSERIAL customizedSerial
#endif
// We need the previous define before the include, or compilation bombs...
#include "MarlinSerial_Due.h"
#include "MarlinSerialUSB_Due.h"
#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
@@ -153,4 +151,16 @@ void HAL_enable_AdcFreerun(void);
#define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
// Enable hooks into idle and setup for USB stack
#define HAL_IDLETASK 1
#define HAL_INIT 1
#ifdef __cplusplus
extern "C" {
#endif
void HAL_idletask(void);
void HAL_init(void);
#ifdef __cplusplus
}
#endif
#endif // _HAL_DUE_H