mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-08 07:27:27 -06:00
🧑💻 Organize some HAL code
This commit is contained in:
parent
75d60b77ba
commit
4d8f82df32
49 changed files with 77 additions and 92 deletions
|
@ -204,7 +204,7 @@ public:
|
||||||
static void isr_on() { sei(); }
|
static void isr_on() { sei(); }
|
||||||
static void isr_off() { cli(); }
|
static void isr_off() { cli(); }
|
||||||
|
|
||||||
static void delay_ms(const int ms) { _delay_ms(ms); }
|
static void delay_ms(const int ms) { delay(ms); }
|
||||||
|
|
||||||
// Tasks, called from idle()
|
// Tasks, called from idle()
|
||||||
static void idletask() {}
|
static void idletask() {}
|
||||||
|
|
|
@ -63,8 +63,8 @@
|
||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
#include "preprocessor.h"
|
#include "preprocessor.h"
|
||||||
#ifdef FREERTOS_USED
|
#ifdef FREERTOS_USED
|
||||||
#include "FreeRTOS.h"
|
#include <FreeRTOS.h>
|
||||||
#include "semphr.h"
|
#include <semphr.h>
|
||||||
#endif
|
#endif
|
||||||
#include "ctrl_access.h"
|
#include "ctrl_access.h"
|
||||||
|
|
||||||
|
|
|
@ -34,13 +34,13 @@
|
||||||
|
|
||||||
#if ENABLED(WIFISUPPORT)
|
#if ENABLED(WIFISUPPORT)
|
||||||
#include <ESPAsyncWebServer.h>
|
#include <ESPAsyncWebServer.h>
|
||||||
#include "wifi.h"
|
#include "wifi/wifi.h"
|
||||||
#if ENABLED(OTASUPPORT)
|
#if ENABLED(OTASUPPORT)
|
||||||
#include "ota.h"
|
#include "wifi/ota.h"
|
||||||
#endif
|
#endif
|
||||||
#if ENABLED(WEBSUPPORT)
|
#if ENABLED(WEBSUPPORT)
|
||||||
#include "spiffs.h"
|
#include "wifi/spiffs.h"
|
||||||
#include "web.h"
|
#include "wifi/web.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -175,8 +175,6 @@ uint8_t MarlinHAL::get_reset_source() { return rtc_get_reset_reason(1); }
|
||||||
|
|
||||||
void MarlinHAL::reboot() { ESP.restart(); }
|
void MarlinHAL::reboot() { ESP.restart(); }
|
||||||
|
|
||||||
void _delay_ms(const int ms) { delay(ms); }
|
|
||||||
|
|
||||||
// return free memory between end of heap (or end bss) and whatever is current
|
// return free memory between end of heap (or end bss) and whatever is current
|
||||||
int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
|
int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,11 @@
|
||||||
#include "i2s.h"
|
#include "i2s.h"
|
||||||
|
|
||||||
#if ENABLED(WIFISUPPORT)
|
#if ENABLED(WIFISUPPORT)
|
||||||
#include "WebSocketSerial.h"
|
#include "wifi/WebSocketSerial.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(ESP3D_WIFISUPPORT)
|
#if ENABLED(ESP3D_WIFISUPPORT)
|
||||||
#include "esp3dlib.h"
|
#include <esp3dlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "FlushableHardwareSerial.h"
|
#include "FlushableHardwareSerial.h"
|
||||||
|
@ -165,8 +165,6 @@ int freeMemory();
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
void _delay_ms(const int ms);
|
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
// MarlinHAL Class
|
// MarlinHAL Class
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
@ -194,7 +192,7 @@ public:
|
||||||
static void isr_on() { if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock); }
|
static void isr_on() { if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock); }
|
||||||
static void isr_off() { portENTER_CRITICAL(&spinlock); }
|
static void isr_off() { portENTER_CRITICAL(&spinlock); }
|
||||||
|
|
||||||
static void delay_ms(const int ms) { _delay_ms(ms); }
|
static void delay_ms(const int ms) { delay(ms); }
|
||||||
|
|
||||||
// Tasks, called from idle()
|
// Tasks, called from idle()
|
||||||
static void idletask();
|
static void idletask();
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#if HAS_MEDIA
|
#if HAS_MEDIA
|
||||||
#include "../../sd/cardreader.h"
|
#include "../../sd/cardreader.h"
|
||||||
#if ENABLED(ESP3D_WIFISUPPORT)
|
#if ENABLED(ESP3D_WIFISUPPORT)
|
||||||
#include "sd_ESP32.h"
|
#include <sd_ESP32.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ENABLED(WIFISUPPORT)
|
#if ENABLED(WIFISUPPORT)
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
#include "../../core/serial_hook.h"
|
#include "../../../core/serial_hook.h"
|
||||||
|
|
||||||
#include <Stream.h>
|
#include <Stream.h>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#undef ENABLED
|
#undef ENABLED
|
||||||
#undef DISABLED
|
#undef DISABLED
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ALL(WIFISUPPORT, OTASUPPORT)
|
#if ALL(WIFISUPPORT, OTASUPPORT)
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
*/
|
*/
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ALL(WIFISUPPORT, WEBSUPPORT)
|
#if ALL(WIFISUPPORT, WEBSUPPORT)
|
||||||
|
|
||||||
#include "../../core/serial.h"
|
#include "../../../core/serial.h"
|
||||||
|
|
||||||
#include <FS.h>
|
#include <FS.h>
|
||||||
#include <SPIFFS.h>
|
#include <SPIFFS.h>
|
|
@ -21,11 +21,11 @@
|
||||||
*/
|
*/
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ALL(WIFISUPPORT, WEBSUPPORT)
|
#if ALL(WIFISUPPORT, WEBSUPPORT)
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#undef DISABLED // esp32-hal-gpio.h
|
#undef DISABLED // esp32-hal-gpio.h
|
||||||
#include <SPIFFS.h>
|
#include <SPIFFS.h>
|
|
@ -21,11 +21,11 @@
|
||||||
*/
|
*/
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if ENABLED(WIFISUPPORT)
|
#if ENABLED(WIFISUPPORT)
|
||||||
|
|
||||||
#include "../../core/serial.h"
|
#include "../../../core/serial.h"
|
||||||
|
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
|
@ -15,12 +15,12 @@
|
||||||
// If not, see <https://www.gnu.org/licenses/>.
|
// If not, see <https://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../../platforms.h"
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_MFL
|
#ifdef ARDUINO_ARCH_MFL
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
#include "../shared/Delay.h"
|
#include "../../shared/Delay.h"
|
||||||
|
|
||||||
#include "SDCard.h"
|
#include "SDCard.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
|
@ -16,9 +16,9 @@
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#include "SDIO.hpp"
|
#include <SDIO.hpp>
|
||||||
|
|
||||||
namespace sdio {
|
namespace sdio {
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../../platforms.h"
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_MFL
|
#ifdef ARDUINO_ARCH_MFL
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(ONBOARD_SDIO)
|
#if ENABLED(ONBOARD_SDIO)
|
||||||
|
|
||||||
|
@ -215,7 +215,6 @@ void DMA1_IRQHandler() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
void SDIO_IRQHandler(void) {
|
void SDIO_IRQHandler(void) {
|
||||||
|
@ -228,6 +227,5 @@ extern "C" {
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
|
|
||||||
#endif // ONBOARD_SDIO
|
#endif // ONBOARD_SDIO
|
||||||
#endif // ARDUINO_ARCH_MFL
|
#endif // ARDUINO_ARCH_MFL
|
|
@ -27,7 +27,7 @@
|
||||||
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include HAL_PATH(..,HAL.h)
|
#include HAL_PATH(.., HAL.h)
|
||||||
extern MarlinHAL hal;
|
extern MarlinHAL hal;
|
||||||
|
|
||||||
#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
|
#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
|
||||||
|
|
|
@ -124,7 +124,7 @@ public:
|
||||||
static void isr_on() {}
|
static void isr_on() {}
|
||||||
static void isr_off() {}
|
static void isr_off() {}
|
||||||
|
|
||||||
static void delay_ms(const int ms) { _delay_ms(ms); }
|
static void delay_ms(const int ms) { delay(ms); }
|
||||||
|
|
||||||
// Tasks, called from idle()
|
// Tasks, called from idle()
|
||||||
static void idletask() {}
|
static void idletask() {}
|
||||||
|
|
|
@ -31,8 +31,6 @@ void cli() { } // Disable
|
||||||
void sei() { } // Enable
|
void sei() { } // Enable
|
||||||
|
|
||||||
// Time functions
|
// Time functions
|
||||||
void _delay_ms(const int ms) { delay(ms); }
|
|
||||||
|
|
||||||
unsigned long millis() {
|
unsigned long millis() {
|
||||||
return (unsigned long)Clock::millis();
|
return (unsigned long)Clock::millis();
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,6 @@ extern "C" {
|
||||||
|
|
||||||
// Time functions
|
// Time functions
|
||||||
extern "C" void delay(const int ms);
|
extern "C" void delay(const int ms);
|
||||||
void _delay_ms(const int ms);
|
|
||||||
void delayMicroseconds(unsigned long);
|
void delayMicroseconds(unsigned long);
|
||||||
unsigned long millis();
|
unsigned long millis();
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ public:
|
||||||
static void isr_on() {}
|
static void isr_on() {}
|
||||||
static void isr_off() {}
|
static void isr_off() {}
|
||||||
|
|
||||||
static void delay_ms(const int ms) { _delay_ms(ms); }
|
static void delay_ms(const int ms) { delay(ms); }
|
||||||
|
|
||||||
// Tasks, called from idle()
|
// Tasks, called from idle()
|
||||||
static void idletask();
|
static void idletask();
|
||||||
|
|
|
@ -87,7 +87,7 @@ void MarlinHAL::init() {
|
||||||
|
|
||||||
#if PIN_EXISTS(USB_CONNECT)
|
#if PIN_EXISTS(USB_CONNECT)
|
||||||
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
|
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
|
||||||
delay_ms(1000); // Give OS time to notice
|
delay_ms(1000); // Give OS time to notice
|
||||||
WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
|
WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ public:
|
||||||
static void isr_on() { __enable_irq(); }
|
static void isr_on() { __enable_irq(); }
|
||||||
static void isr_off() { __disable_irq(); }
|
static void isr_off() { __disable_irq(); }
|
||||||
|
|
||||||
static void delay_ms(const int ms) { ::delay(ms); }
|
static void delay_ms(const int ms) { delay(ms); }
|
||||||
|
|
||||||
// Tasks, called from idle()
|
// Tasks, called from idle()
|
||||||
static void idletask() {}
|
static void idletask() {}
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SD_HOST_DRIVE
|
#if HAS_SD_HOST_DRIVE
|
||||||
#include "msc_sd.h"
|
#include "sd/msc_sd.h"
|
||||||
#include "usbd_cdc_if.h"
|
#include <usbd_cdc_if.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
@ -97,7 +97,7 @@ void MarlinHAL::init() {
|
||||||
|
|
||||||
#if PIN_EXISTS(USB_CONNECT)
|
#if PIN_EXISTS(USB_CONNECT)
|
||||||
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
|
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
|
||||||
delay(1000); // Give OS time to notice
|
delay_ms(1000); // Give OS time to notice
|
||||||
WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
|
WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,18 +23,14 @@
|
||||||
|
|
||||||
#define CPU_32_BIT
|
#define CPU_32_BIT
|
||||||
|
|
||||||
#include "../../core/macros.h"
|
#include "../../inc/MarlinConfigPre.h"
|
||||||
#include "../shared/Marduino.h"
|
|
||||||
#include "../shared/math_32bit.h"
|
#include "../shared/math_32bit.h"
|
||||||
#include "../shared/HAL_SPI.h"
|
#include "../shared/HAL_SPI.h"
|
||||||
#include "temp_soc.h"
|
#include "temp_soc.h"
|
||||||
#include "fastio.h"
|
#include "fastio.h"
|
||||||
#include "Servo.h"
|
#include "Servo.h"
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Default graphical display delays
|
// Default graphical display delays
|
||||||
//
|
//
|
||||||
|
|
|
@ -20,20 +20,19 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "../platforms.h"
|
#include "../../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_SD_HOST_DRIVE
|
#if HAS_SD_HOST_DRIVE
|
||||||
|
|
||||||
#include "../shared/Marduino.h"
|
#include "../../../sd/cardreader.h"
|
||||||
|
|
||||||
#include "msc_sd.h"
|
#include "msc_sd.h"
|
||||||
#include "usbd_core.h"
|
|
||||||
|
|
||||||
#include "../../sd/cardreader.h"
|
|
||||||
|
|
||||||
|
#include <usbd_core.h>
|
||||||
#include <USB.h>
|
#include <USB.h>
|
||||||
#include <USBMscHandler.h>
|
#include <USBMscHandler.h>
|
||||||
|
|
|
@ -20,18 +20,17 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../platforms.h"
|
#include "../../platforms.h"
|
||||||
|
|
||||||
#ifdef HAL_STM32
|
#ifdef HAL_STM32
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ALL(USE_OTG_USB_HOST, USBHOST)
|
#if ALL(USE_OTG_USB_HOST, USBHOST)
|
||||||
|
|
||||||
#include "usb_host.h"
|
#include "usb_host.h"
|
||||||
#include "../shared/Marduino.h"
|
#include <usbh_core.h>
|
||||||
#include "usbh_core.h"
|
#include <usbh_msc.h>
|
||||||
#include "usbh_msc.h"
|
|
||||||
|
|
||||||
USBH_HandleTypeDef hUsbHost;
|
USBH_HandleTypeDef hUsbHost;
|
||||||
USBHost usb;
|
USBHost usb;
|
|
@ -253,7 +253,7 @@ void MarlinHAL::init() {
|
||||||
#endif
|
#endif
|
||||||
#if PIN_EXISTS(USB_CONNECT)
|
#if PIN_EXISTS(USB_CONNECT)
|
||||||
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
|
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
|
||||||
delay(1000); // Give OS time to notice
|
delay_ms(1000); // Give OS time to notice
|
||||||
WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
|
WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
|
||||||
#endif
|
#endif
|
||||||
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the minimal serial handler
|
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the minimal serial handler
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_SD_HOST_DRIVE
|
#if HAS_SD_HOST_DRIVE
|
||||||
#include "msc_sd.h"
|
#include "sd/msc_sd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
|
@ -22,20 +22,21 @@
|
||||||
*/
|
*/
|
||||||
#ifdef __STM32F1__
|
#ifdef __STM32F1__
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_SD_HOST_DRIVE
|
#if HAS_SD_HOST_DRIVE
|
||||||
|
|
||||||
#include "msc_sd.h"
|
#include "msc_sd.h"
|
||||||
#include "SPI.h"
|
#include "../SPI.h"
|
||||||
#include "usb_reg_map.h"
|
|
||||||
|
#include <usb_reg_map.h>
|
||||||
|
|
||||||
#define PRODUCT_ID 0x29
|
#define PRODUCT_ID 0x29
|
||||||
|
|
||||||
USBMassStorage MarlinMSC;
|
USBMassStorage MarlinMSC;
|
||||||
Serial1Class<USBCompositeSerial> MarlinCompositeSerial(true);
|
Serial1Class<USBCompositeSerial> MarlinCompositeSerial(true);
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if SD_CONNECTION_IS(ONBOARD)
|
#if SD_CONNECTION_IS(ONBOARD)
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
#include <USBComposite.h>
|
#include <USBComposite.h>
|
||||||
|
|
||||||
#include "../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
#include "../../core/serial_hook.h"
|
#include "../../../core/serial_hook.h"
|
||||||
|
|
||||||
extern USBMassStorage MarlinMSC;
|
extern USBMassStorage MarlinMSC;
|
||||||
extern Serial1Class<USBCompositeSerial> MarlinCompositeSerial;
|
extern Serial1Class<USBCompositeSerial> MarlinCompositeSerial;
|
|
@ -13,13 +13,13 @@
|
||||||
|
|
||||||
#ifdef __STM32F1__
|
#ifdef __STM32F1__
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if SD_CONNECTION_IS(ONBOARD)
|
#if SD_CONNECTION_IS(ONBOARD)
|
||||||
|
|
||||||
#include "onboard_sd.h"
|
#include "onboard_sd.h"
|
||||||
#include "SPI.h"
|
#include "../SPI.h"
|
||||||
#include "fastio.h"
|
#include "../fastio.h"
|
||||||
|
|
||||||
#ifndef ONBOARD_SPI_DEVICE
|
#ifndef ONBOARD_SPI_DEVICE
|
||||||
#define ONBOARD_SPI_DEVICE SPI_DEVICE
|
#define ONBOARD_SPI_DEVICE SPI_DEVICE
|
|
@ -19,11 +19,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifdef ARDUINO_ARCH_STM32F1
|
#ifdef __STM32F1__
|
||||||
|
|
||||||
#include <libmaple/stm32.h>
|
#include <libmaple/stm32.h>
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density
|
#include "../../../inc/MarlinConfig.h" // Allow pins/pins.h to set density
|
||||||
|
|
||||||
#if ANY(STM32_HIGH_DENSITY, STM32_XL_DENSITY)
|
#if ANY(STM32_HIGH_DENSITY, STM32_XL_DENSITY)
|
||||||
|
|
||||||
|
@ -308,4 +308,4 @@ bool SDIO_GetCmdResp7() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // STM32_HIGH_DENSITY || STM32_XL_DENSITY
|
#endif // STM32_HIGH_DENSITY || STM32_XL_DENSITY
|
||||||
#endif // ARDUINO_ARCH_STM32F1
|
#endif // __STM32F1__
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to override SDIO clock / retries
|
#include "../../../inc/MarlinConfig.h" // Allow pins/pins.h to override SDIO clock / retries
|
||||||
|
|
||||||
#include <libmaple/sdio.h>
|
#include <libmaple/sdio.h>
|
||||||
#include <libmaple/dma.h>
|
#include <libmaple/dma.h>
|
|
@ -22,6 +22,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../core/macros.h"
|
#include "../../core/macros.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Math helper functions for 32 bit CPUs
|
* Math helper functions for 32 bit CPUs
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
// Prefix header for all Marlin sources
|
// Prefix header for all Marlin sources
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "MarlinConfigPre-6-type.h" // Include even with __MARLIN_DEPS__
|
|
||||||
#include "Conditionals-6-type.h"
|
#include "Conditionals-6-type.h"
|
||||||
|
|
||||||
#ifndef __MARLIN_DEPS__
|
#ifndef __MARLIN_DEPS__
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "MarlinConfigPre-5-post.h"
|
|
||||||
#include "Conditionals-5-post.h"
|
#include "Conditionals-5-post.h"
|
||||||
|
|
||||||
#ifndef __MARLIN_DEPS__
|
#ifndef __MARLIN_DEPS__
|
||||||
|
|
|
@ -84,10 +84,10 @@
|
||||||
#elif ENABLED(USE_OTG_USB_HOST)
|
#elif ENABLED(USE_OTG_USB_HOST)
|
||||||
|
|
||||||
#if HAS_SD_HOST_DRIVE
|
#if HAS_SD_HOST_DRIVE
|
||||||
#include HAL_PATH(../.., msc_sd.h)
|
#include HAL_PATH(../.., sd/msc_sd.h)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include HAL_PATH(../.., usb_host.h)
|
#include HAL_PATH(../.., sd/usb_host.h)
|
||||||
|
|
||||||
#define UHS_START usb.start()
|
#define UHS_START usb.start()
|
||||||
#define rREVISION 0
|
#define rREVISION 0
|
||||||
|
@ -293,7 +293,7 @@ uint32_t DiskIODriver_USBFlash::cardSize() {
|
||||||
#if USB_DEBUG < 3
|
#if USB_DEBUG < 3
|
||||||
const uint32_t
|
const uint32_t
|
||||||
#endif
|
#endif
|
||||||
lun0_capacity = bulk.GetCapacity(0);
|
lun0_capacity = bulk.GetCapacity(0);
|
||||||
return lun0_capacity;
|
return lun0_capacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "../../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_USB_FLASH_DRIVE && DISABLED(USE_UHS3_USB)
|
#if ALL(HAS_USB_FLASH_DRIVE, USE_UHS2_USB)
|
||||||
|
|
||||||
#include "Usb.h"
|
#include "Usb.h"
|
||||||
|
|
||||||
|
@ -792,4 +792,4 @@ uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
|
||||||
return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
|
return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_USB_FLASH_DRIVE && !USE_UHS3_USB
|
#endif // HAS_USB_FLASH_DRIVE && USE_UHS2_USB
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "../../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_USB_FLASH_DRIVE && DISABLED(USE_UHS3_USB)
|
#if ALL(HAS_USB_FLASH_DRIVE, USE_UHS2_USB)
|
||||||
|
|
||||||
#include "masstorage.h"
|
#include "masstorage.h"
|
||||||
|
|
||||||
|
@ -1204,4 +1204,4 @@ uint8_t BulkOnly::Read(uint8_t lun __attribute__((unused)), uint32_t addr __attr
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_USB_FLASH_DRIVE && !USE_UHS3_USB
|
#endif // HAS_USB_FLASH_DRIVE && USE_UHS2_USB
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "../../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_USB_FLASH_DRIVE && DISABLED(USE_UHS3_USB)
|
#if ALL(HAS_USB_FLASH_DRIVE, USE_UHS2_USB)
|
||||||
|
|
||||||
#include "Usb.h"
|
#include "Usb.h"
|
||||||
|
|
||||||
|
@ -125,4 +125,4 @@ void E_Notify(double d, int lvl) {
|
||||||
|
|
||||||
#endif // DEBUG_USB_HOST
|
#endif // DEBUG_USB_HOST
|
||||||
|
|
||||||
#endif // HAS_USB_FLASH_DRIVE && !USE_UHS3_USB
|
#endif // HAS_USB_FLASH_DRIVE && USE_UHS2_USB
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "../../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_USB_FLASH_DRIVE && DISABLED(USE_UHS3_USB)
|
#if ALL(HAS_USB_FLASH_DRIVE, USE_UHS2_USB)
|
||||||
|
|
||||||
#include "Usb.h"
|
#include "Usb.h"
|
||||||
|
|
||||||
|
@ -74,4 +74,4 @@ bool PTPListParser::Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_USB_FLASH_DRIVE && !USE_UHS3_USB
|
#endif // HAS_USB_FLASH_DRIVE && USE_UHS2_USB
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "../../../inc/MarlinConfigPre.h"
|
#include "../../../inc/MarlinConfigPre.h"
|
||||||
|
|
||||||
#if HAS_USB_FLASH_DRIVE && DISABLED(USE_UHS3_USB)
|
#if ALL(HAS_USB_FLASH_DRIVE, USE_UHS2_USB)
|
||||||
|
|
||||||
#if !PINS_EXIST(USB_CS, USB_INTR)
|
#if !PINS_EXIST(USB_CS, USB_INTR)
|
||||||
#error "USB_FLASH_DRIVE_SUPPORT requires USB_CS_PIN and USB_INTR_PIN (or USE_UHS3_USB) to be defined."
|
#error "USB_FLASH_DRIVE_SUPPORT requires USB_CS_PIN and USB_INTR_PIN (or USE_UHS3_USB) to be defined."
|
||||||
|
@ -203,4 +203,4 @@ uint8_t MAX3421e::IntHandler() {
|
||||||
return HIRQ_sendback;
|
return HIRQ_sendback;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_USB_FLASH_DRIVE && !USE_UHS3_USB
|
#endif // HAS_USB_FLASH_DRIVE && USE_UHS2_USB
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue