Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into P3Steel-Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
effgarces committed Dec 1, 2020
2 parents 765affa + 0d080ce commit 9cf1a89
Show file tree
Hide file tree
Showing 159 changed files with 1,469 additions and 5,382 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- sanguino1284p
- sanguino644p

# Extended STM32 Environments
# STM32F1 (Maple) Environments

- STM32F103RC_btt
- STM32F103RC_btt_USB
Expand All @@ -64,38 +64,37 @@ jobs:
- STM32F103RC_meeb
- jgaurora_a5s_a1
- STM32F103VE_longer
- mks_robin
- mks_robin_lite
- mks_robin_pro
- STM32F103RET6_creality
- mks_robin_nano35

# STM32 (ST) Environments

- STM32F407VE_black
- STM32F401VE_STEVAL
- BIGTREE_BTT002
- BIGTREE_SKR_PRO
- BIGTREE_GTR_V1_0
- mks_robin
- mks_robin_stm32
- ARMED
- FYSETC_S6
- STM32F070CB_malyan
- STM32F070RB_malyan
- malyan_M300
- mks_robin_lite
- FLYF407ZG
- rumba32
- mks_robin_pro
- STM32F103RET6_creality
- LERDGEX
- mks_robin_nano35
- mks_robin_nano35_stm32
- NUCLEO_F767ZI
- REMRAM_V1

# Put lengthy tests last

- LPC1768
- LPC1769

# STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working.

#- STM32F4
#- STM32F7

# Non-working environment tests
#- at90usb1286_cdc
#- STM32F103CB_malyan
Expand Down
13 changes: 11 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,8 @@

// @section homing

//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed

//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed. Also enable HOME_AFTER_DEACTIVATE for extra safety.
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety.
//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.

#define Z_HOMING_HEIGHT 1 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
Expand Down Expand Up @@ -1291,6 +1291,9 @@
// at which point movement will be level to the machine's XY plane.
// The height can be set with M420 Z<height>
#define ENABLE_LEVELING_FADE_HEIGHT
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height.
#endif

// For Cartesian machines, instead of dividing moves on mesh boundaries,
// split up moves into short segments like a Delta. This follows the
Expand Down Expand Up @@ -1392,6 +1395,12 @@
#define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points
#define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points
//#define LEVEL_CENTER_TOO // Move to the center after the last corner
//#define LEVEL_CORNERS_USE_PROBE
#if ENABLED(LEVEL_CORNERS_USE_PROBE)
#define LEVEL_CORNERS_PROBE_TOLERANCE 0.1
#define LEVEL_CORNERS_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify
//#define LEVEL_CORNERS_AUDIO_FEEDBACK
#endif
#endif

/**
Expand Down
14 changes: 10 additions & 4 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,6 @@
// If the Nozzle or Bed falls when the Z stepper is disabled, set its resting position here.
//#define Z_AFTER_DEACTIVATE Z_HOME_POS

//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated

// Default Minimum Feedrates for printing and travel moves
#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S.
#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T.
Expand Down Expand Up @@ -1084,8 +1082,14 @@
#if HAS_BED_PROBE
#define PROBE_OFFSET_WIZARD
#if ENABLED(PROBE_OFFSET_WIZARD)
#define PROBE_OFFSET_START -4.0 // Estimated nozzle-to-probe Z offset, plus a little extra
//#define PROBE_OFFSET_WIZARD_XY_POS XY_CENTER // Set a convenient position to do the measurement
//
// Enable to init the Probe Z-Offset when starting the Wizard.
// Use the estimated nozzle-to-probe Z offset, plus a little more.
//
//#define PROBE_OFFSET_WIZARD_START_Z -4.0

// Set a convenient position to do the calibration (probing point and nozzle/bed-distance)
//#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER }
#endif
#endif

Expand Down Expand Up @@ -1180,6 +1184,8 @@
//#define SD_IGNORE_AT_STARTUP // Don't mount the SD card when starting up
//#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash)

//#define GCODE_REPEAT_MARKERS // Enable G-code M808 to set repeat markers and do looping

#define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls

#define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished
Expand Down
16 changes: 10 additions & 6 deletions Marlin/src/HAL/AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,16 @@ inline uint8_t HAL_get_reset_source() { return MCUSR; }

inline void HAL_reboot() {} // reboot the board or restart the bootloader

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
extern "C" {
int freeMemory();
}
#pragma GCC diagnostic pop
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

extern "C" int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif

// ADC
#ifdef DIDR2
Expand Down
12 changes: 9 additions & 3 deletions Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,16 @@ void HAL_init();
//
void _delay_ms(const int delay);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();
#pragma GCC diagnostic pop

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif

#ifdef __cplusplus
extern "C" {
Expand Down
12 changes: 9 additions & 3 deletions Marlin/src/HAL/ESP32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader

void _delay_ms(int delay);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();
#pragma GCC diagnostic pop

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif

void analogWrite(pin_t pin, int value);

Expand Down
8 changes: 5 additions & 3 deletions Marlin/src/HAL/ESP32/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ typedef uint64_t hal_timer_t;
#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
#endif

extern "C" void tempTC_Handler();
extern "C" void stepTC_Handler();
extern "C" void pwmTC_Handler();
extern "C" {
void tempTC_Handler();
void stepTC_Handler();
void pwmTC_Handler();
}

// ------------------------
// Types
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/HAL/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

#include "platforms.h"

#ifndef GCC_VERSION
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif

#include HAL_PATH(.,HAL.h)

#ifdef SERIAL_PORT_2
Expand Down
17 changes: 6 additions & 11 deletions Marlin/src/HAL/LINUX/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@
HalSerial usb_serial;

// U8glib required functions
extern "C" void u8g_xMicroDelay(uint16_t val) {
DELAY_US(val);
}
extern "C" void u8g_MicroDelay() {
u8g_xMicroDelay(1);
}
extern "C" void u8g_10MicroDelay() {
u8g_xMicroDelay(10);
}
extern "C" void u8g_Delay(uint16_t val) {
delay(val);
extern "C" {
void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); }
void u8g_MicroDelay() { u8g_xMicroDelay(1); }
void u8g_10MicroDelay() { u8g_xMicroDelay(10); }
void u8g_Delay(uint16_t val) { delay(val); }
}

//************************//

// return free heap space
Expand Down
12 changes: 9 additions & 3 deletions Marlin/src/HAL/LINUX/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,16 @@ extern HalSerial usb_serial;
inline void HAL_init() {}

// Utility functions
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();
#pragma GCC diagnostic pop

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif

// ADC
#define HAL_ADC_VREF 5.0
Expand Down
11 changes: 6 additions & 5 deletions Marlin/src/HAL/LINUX/include/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ void cli(); // Disable
void sei(); // Enable
void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode);
void detachInterrupt(uint32_t pin);
extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);

extern "C" {
void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
void GpioDisableInt(uint32_t port, uint32_t pin);
}

// Program Memory
#define pgm_read_ptr(addr) (*((void**)(addr)))
Expand All @@ -92,9 +95,7 @@ using std::memcpy;
#define strlen_P strlen

// Time functions
extern "C" {
void delay(const int milis);
}
extern "C" void delay(const int milis);
void _delay_ms(const int delay);
void delayMicroseconds(unsigned long);
uint32_t millis();
Expand Down
17 changes: 6 additions & 11 deletions Marlin/src/HAL/LPC1768/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,13 @@
uint32_t HAL_adc_reading = 0;

// U8glib required functions
extern "C" void u8g_xMicroDelay(uint16_t val) {
DELAY_US(val);
}
extern "C" void u8g_MicroDelay() {
u8g_xMicroDelay(1);
}
extern "C" void u8g_10MicroDelay() {
u8g_xMicroDelay(10);
}
extern "C" void u8g_Delay(uint16_t val) {
delay(val);
extern "C" {
void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); }
void u8g_MicroDelay() { u8g_xMicroDelay(1); }
void u8g_10MicroDelay() { u8g_xMicroDelay(10); }
void u8g_Delay(uint16_t val) { delay(val); }
}

//************************//

// return free heap space
Expand Down
12 changes: 9 additions & 3 deletions Marlin/src/HAL/LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,16 @@ extern "C" volatile uint32_t _millis;
//
// Utility functions
//
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();
#pragma GCC diagnostic pop

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif

//
// ADC API
Expand Down
19 changes: 4 additions & 15 deletions Marlin/src/HAL/LPC1768/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,19 @@

#if USING_SERIAL_0
MarlinSerial MSerial(LPC_UART0);
extern "C" void UART0_IRQHandler() {
MSerial.IRQHandler();
}
extern "C" void UART0_IRQHandler() { MSerial.IRQHandler(); }
#endif

#if USING_SERIAL_1
MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1);
extern "C" void UART1_IRQHandler() {
MSerial1.IRQHandler();
}
extern "C" void UART1_IRQHandler() { MSerial1.IRQHandler(); }
#endif

#if USING_SERIAL_2
MarlinSerial MSerial2(LPC_UART2);
extern "C" void UART2_IRQHandler() {
MSerial2.IRQHandler();
}
extern "C" void UART2_IRQHandler() { MSerial2.IRQHandler(); }
#endif

#if USING_SERIAL_3
MarlinSerial MSerial3(LPC_UART3);
extern "C" void UART3_IRQHandler() {
MSerial3.IRQHandler();
}
extern "C" void UART3_IRQHandler() { MSerial3.IRQHandler(); }
#endif

#endif // TARGET_LPC1768
12 changes: 6 additions & 6 deletions Marlin/src/HAL/LPC1768/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
#include <CDCSerial.h>
#include <usb/mscuser.h>

extern "C" {
#include <debug_frmwrk.h>
}

#include "../../inc/MarlinConfig.h"
#include "../../core/millis_t.h"

#include "../../sd/cardreader.h"

extern uint32_t MSC_SD_Init(uint8_t pdrv);
extern "C" int isLPC1769();
extern "C" void disk_timerproc();

extern "C" {
#include <debug_frmwrk.h>
extern "C" int isLPC1769();
extern "C" void disk_timerproc();
}

void SysTick_Callback() { disk_timerproc(); }

Expand Down
Loading

0 comments on commit 9cf1a89

Please sign in to comment.