From e5b71af8c9475a48f544acdda40d13c746e819fc Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Mon, 1 Jan 2018 16:41:38 -0600 Subject: [PATCH] snapshot found a few more nasties --- Marlin/src/HAL/HAL_DUE/HAL_pinsDebug_Due.h | 4 ++-- Marlin/src/HAL/HAL_DUE/usb/conf_access.h | 7 ++++++- Marlin/src/HAL/HAL_DUE/usb/conf_usb.h | 6 +++++- Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp | 2 +- Marlin/src/HAL/HAL_DUE/usb/usb_task.c | 2 ++ 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Marlin/src/HAL/HAL_DUE/HAL_pinsDebug_Due.h b/Marlin/src/HAL/HAL_DUE/HAL_pinsDebug_Due.h index 2c2e52415c..d128087e34 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_pinsDebug_Due.h +++ b/Marlin/src/HAL/HAL_DUE/HAL_pinsDebug_Due.h @@ -72,8 +72,8 @@ #define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0) #define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0)) #define IS_ANALOG(P) (((P) >= analogInputToDigitalPin(0)) && ((P) <= analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1))) -#define pwm_status(pin) ((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \ - ((g_APinDescription[pin].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM) +#define pwm_status(pin) (((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \ + ((g_APinDescription[pin].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM)) #define MULTI_NAME_PAD 14 // space needed to be pretty if not first name assigned to a pin bool GET_PINMODE(int8_t pin) { // 1: output, 0: input diff --git a/Marlin/src/HAL/HAL_DUE/usb/conf_access.h b/Marlin/src/HAL/HAL_DUE/usb/conf_access.h index a87e7c005c..d9f7ddb40e 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/conf_access.h +++ b/Marlin/src/HAL/HAL_DUE/usb/conf_access.h @@ -53,7 +53,12 @@ /*! \name Activation of Logical Unit Numbers */ //! @{ -#define LUN_0 ENABLE //!< SD/MMC Card over MCI Slot 0. + +#ifdef SDSUPPORT + #define LUN_0 ENABLE //!< SD/MMC Card over MCI Slot 0. +#else + #define LUN_0 DISABLE +#endif #define LUN_1 DISABLE #define LUN_2 DISABLE #define LUN_3 DISABLE diff --git a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h index 4f780e0093..b32f37d313 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h @@ -72,7 +72,11 @@ //! USB Device string definitions (Optional) #define USB_DEVICE_MANUFACTURE_NAME "marlinfw.org" -#define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME +#ifdef CUSTOM_MACHINE_NAME + #define USB_DEVICE_PRODUCT_NAME CUSTOM_MACHINE_NAME +#else + #define USB_DEVICE_PRODUCT_NAME "3D Printer" +#endif #define USB_DEVICE_SERIAL_NAME "123985739853" /** diff --git a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp index b54e74e05d..57c4de58de 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp @@ -2,7 +2,7 @@ * Interface from Atmel USB MSD to Marlin SD card */ -#ifdef ARDUINO_ARCH_SAM +#if defined(ARDUINO_ARCH_SAM) && defined(SDSUPPORT) #include "../../../inc/MarlinConfig.h" #include "../../../sd/cardreader.h" diff --git a/Marlin/src/HAL/HAL_DUE/usb/usb_task.c b/Marlin/src/HAL/HAL_DUE/usb/usb_task.c index 2931dbbc47..58221aa05c 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/usb_task.c +++ b/Marlin/src/HAL/HAL_DUE/usb/usb_task.c @@ -47,6 +47,7 @@ #include "conf_usb.h" #include "udc.h" +#include static volatile bool main_b_msc_enable = false; static volatile bool main_b_cdc_enable = false; @@ -253,6 +254,7 @@ bool usb_task_other_requests(void) { return true; } + void HAL_init(void) { uint16_t *ptr;