Skip to content

Commit

Permalink
Revert "Bugfix 2.0.x update (#1)" (#2)
Browse files Browse the repository at this point in the history
This reverts commit 49fa99c.
  • Loading branch information
Speaka committed Aug 13, 2020
1 parent 705b060 commit 32b7b9f
Show file tree
Hide file tree
Showing 234 changed files with 2,351 additions and 4,058 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/HAL/LPC1768/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void HAL_init() {
delay(1000); // Give OS time to notice
USB_Connect(TRUE);

#if DISABLED(NO_SD_HOST_DRIVE)
#if !BOTH(SHARED_SD_CARD, INIT_SDCARD_ON_BOOT) && DISABLED(NO_SD_HOST_DRIVE)
MSC_SD_Init(0); // Enable USB SD card access
#endif

Expand All @@ -140,7 +140,7 @@ void HAL_init() {

// HAL idle task
void HAL_idletask() {
#if HAS_SHARED_MEDIA
#if ENABLED(SHARED_SD_CARD)
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/SAMD51/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ void HAL_adc_init();
#define HAL_ADC_READY() true

void HAL_adc_start_conversion(const uint8_t adc_pin);
inline uint16_t HAL_adc_get_result() { return HAL_adc_result; }

//
// Pin Map
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/STM32/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ void FastIO_init(); // Must be called before using fast io macros
#define IS_OUTPUT(IO)

#define PWM_PIN(P) digitalPinHasPWM(P)
#define NO_COMPILE_TIME_PWM

// digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO)
Expand Down
7 changes: 4 additions & 3 deletions Marlin/src/HAL/STM32F1/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@ void HAL_init() {
// HAL idle task
void HAL_idletask() {
#ifdef USE_USB_COMPOSITE
#if HAS_SHARED_MEDIA
#if ENABLED(SHARED_SD_CARD)
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
// this will not reliably detect delete operations. To be safe we will lock
// the disk if Marlin has it mounted. Unfortunately there is currently no way
// to unmount the disk from the LCD menu.
// if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
/* copy from lpc1768 framework, should be fixed later for process HAS_SHARED_MEDIA*/
/* copy from lpc1768 framework, should be fixed later for process SHARED_SD_CARD*/
#endif
// process USB mass storage device class loop
MarlinMSC.loop();
Expand All @@ -277,8 +277,9 @@ void HAL_clear_reset_source() { }

/**
* TODO: Check this and change or remove.
* currently returns 1 that's equal to poweron reset.
*/
uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
uint8_t HAL_get_reset_source() { return 1; }

void _delay_ms(const int delay_ms) { delay(delay_ms); }

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) {
return uint32_t(data);
}

#ifdef LCD_USE_DMA_FSMC
#if ENABLED(LCD_USE_DMA_FSMC)

void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) {
while (count > 0) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/onboard_sd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "SPI.h"
#include "fastio.h"

#if HAS_SHARED_MEDIA
#if ENABLED(SHARED_SD_CARD)
#ifndef ON_BOARD_SPI_DEVICE
#define ON_BOARD_SPI_DEVICE SPI_DEVICE
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) {
* @brief Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE
* @param None
* @retval Status of the last operation (Flash write or erase) done during
* EEPROM formatting
* EEPROM formating
*/
static HAL_StatusTypeDef EE_Format() {
FLASH_EraseInitTypeDef pEraseInit;
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/MarlinCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ extern bool wait_for_heatup;
void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
#endif

// Inactivity shutdown timer
extern millis_t max_inactive_time, stepper_inactive_time;

#if ENABLED(PSU_CONTROL)
extern bool powersupply_on;
#define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0)
Expand Down Expand Up @@ -120,6 +123,5 @@ void protected_pin_err();
#endif

extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
SP_A_STR[], SP_B_STR[], SP_C_STR[],
SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];
11 changes: 5 additions & 6 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,11 @@
#define BOARD_BTT_BTT002_V1_0 4211 // BigTreeTech BTT002 v1.0 (STM32F407VG)
#define BOARD_BTT_GTR_V1_0 4212 // BigTreeTech GTR v1.0 (STM32F407IGT)
#define BOARD_LERDGE_K 4213 // Lerdge K (STM32F407ZG)
#define BOARD_LERDGE_S 4214 // Lerdge S (STM32F407VE)
#define BOARD_LERDGE_X 4215 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4216 // VAkE 403D (STM32F446VET6)
#define BOARD_FYSETC_S6 4217 // FYSETC S6 board
#define BOARD_FLYF407ZG 4218 // FLYF407ZG board (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4219 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_LERDGE_X 4214 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4215 // VAkE 403D (STM32F446VET6)
#define BOARD_FYSETC_S6 4216 // FYSETC S6 board
#define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE)

//
// ARM Cortex M7
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
// pl Polish
// pt Portuguese
// pt_br Portuguese (Brazilian)
// ro Romanian
// ru Russian
// sk Slovak
// tr Turkish
Expand Down Expand Up @@ -205,6 +204,7 @@
#define STR_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
#define STR_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
#define STR_ERR_HOTEND_TOO_COLD "Hotend too cold"
#define STR_ERR_Z_HOMING_SER "Home XY first"
#define STR_ERR_EEPROM_WRITE "Error writing to EEPROM!"

#define STR_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle"
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
#define NEAR(x,y) NEAR_ZERO((x)-(y))

#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0 : (1 / float(x)))
#define FIXFLOAT(f) ({__typeof__(f) _f = (f); _f + (_f < 0 ? -0.0000005f : 0.0000005f);})
#define FIXFLOAT(f) ({__typeof__(f) _f = (f); _f + (_f < 0 ? -0.00005f : 0.00005f);})

//
// Maths macros that can be overridden by HAL
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/core/serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void serial_echopair_PGM(PGM_P const s_P, const char *v) { serialprintPGM(s_P)
void serial_echopair_PGM(PGM_P const s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); }
void serial_echopair_PGM(PGM_P const s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_PGM(PGM_P const s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_PGM(PGM_P const s_P, float v) { serialprintPGM(s_P); SERIAL_DECIMAL(v); }
void serial_echopair_PGM(PGM_P const s_P, double v) { serialprintPGM(s_P); SERIAL_DECIMAL(v); }
void serial_echopair_PGM(PGM_P const s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_PGM(PGM_P const s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_PGM(PGM_P const s_P, unsigned int v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_PGM(PGM_P const s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }

Expand Down
6 changes: 0 additions & 6 deletions Marlin/src/core/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,6 @@ extern uint8_t marlin_debug_flags;

#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST) serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST))

#if SERIAL_FLOAT_PRECISION
#define SERIAL_DECIMAL(V) SERIAL_PRINT(V, SERIAL_FLOAT_PRECISION)
#else
#define SERIAL_DECIMAL(V) SERIAL_ECHO(V)
#endif

//
// Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,4 +501,4 @@ struct XYZEval {
#undef FI

const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' };
#define XYZ_CHAR(A) ((char)('X' + A))
#define XYZ_CHAR(A) ('X' + char(A))
4 changes: 2 additions & 2 deletions Marlin/src/core/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ void safe_delay(millis_t ms) {
#if ABL_PLANAR
SERIAL_ECHOPGM("ABL Adjustment X");
LOOP_XYZ(a) {
const float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a];
float v = planner.get_axis_position_mm(AxisEnum(a)) - current_position[a];
SERIAL_CHAR(' ', XYZ_CHAR(a));
if (v > 0) SERIAL_CHAR('+');
SERIAL_DECIMAL(v);
SERIAL_ECHO(v);
}
#else
#if ENABLED(AUTO_BED_LEVELING_UBL)
Expand Down
8 changes: 6 additions & 2 deletions Marlin/src/feature/bedlevel/ubl/ubl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
_GRIDPOS(Y, 12), _GRIDPOS(Y, 13), _GRIDPOS(Y, 14), _GRIDPOS(Y, 15)
);

volatile int16_t unified_bed_leveling::encoder_diff;
#if HAS_LCD_MENU
bool unified_bed_leveling::lcd_map_control = false;
#endif

volatile int unified_bed_leveling::encoder_diff;

unified_bed_leveling::unified_bed_leveling() {
reset();
Expand Down Expand Up @@ -202,7 +206,7 @@
if (human) SERIAL_CHAR(is_current ? ']' : ' ');

SERIAL_FLUSHTX();
idle_no_sleep();
idle();
}
if (!lcd) SERIAL_EOL();

Expand Down
5 changes: 1 addition & 4 deletions Marlin/src/feature/bedlevel/ubl/ubl.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ class unified_bed_leveling {

#if HAS_LCD_MENU
static bool lcd_map_control;
static void steppers_were_disabled();
#else
static inline void steppers_were_disabled() {}
#endif

static volatile int16_t encoder_diff; // Volatile because buttons may changed it at interrupt time
static volatile int encoder_diff; // Volatile because it's changed at interrupt time.

unified_bed_leveling();

Expand Down
Loading

0 comments on commit 32b7b9f

Please sign in to comment.