Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 2.0.x #1

Merged
merged 35 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a461830
Fix E3V2 DWIN Jerk Menu (#20352)
sjasonsmith Dec 2, 2020
a4d6908
Permit SD EEPROM emulation on E3V2 (#20353)
sjasonsmith Dec 2, 2020
7bf04d1
[cron] Bump distribution date (2020-12-03)
thinkyhead Dec 3, 2020
2878876
Fix circle arc condition (#20322)
yysh12 Dec 3, 2020
31352f8
Fix up start, monitor baud (#20326)
ellensp Dec 3, 2020
a1f319d
Consolidate common pin includes
thinkyhead Dec 3, 2020
3eddbc7
Require minimum PlatformIO version (#20361)
rhapsodyv Dec 3, 2020
517bcd2
[cron] Bump distribution date (2020-12-04)
thinkyhead Dec 4, 2020
d17db47
Fix MESH_BED_LEVELING w/o SEGMENT_LEVELED_MOVES (#20363)
sjasonsmith Dec 4, 2020
465840e
Loosen E on pause for fila-manipulation (#20346)
thebelin Dec 4, 2020
71db4f0
[cron] Bump distribution date (2020-12-05)
thinkyhead Dec 5, 2020
0a03ef4
Don’t use near keyword as variable name (#20374)
tpruvot Dec 5, 2020
5fdd949
Improved Longer3D LKx Pro board (#20372)
thinkyhead Dec 5, 2020
21ee7b1
Fix TMC_HOME_PHASE divide by zero (#20368)
sjasonsmith Dec 5, 2020
2c8f566
Suspend Servos for STM32+NeoPixel (#19963)
sjasonsmith Dec 5, 2020
e8ed880
Add Creality 4.5.2 board (#20378)
InsanityAutomation Dec 5, 2020
2dbd206
[cron] Bump distribution date (2020-12-06)
thinkyhead Dec 6, 2020
7a6b742
Fix FYSETC S6 I2C EEPROM size (#20340)
LinFor Dec 6, 2020
9e68c9a
Creality 4.5.2 format and fix
thinkyhead Dec 6, 2020
bf4c08b
Use 'nearby' for 'near'
thinkyhead Dec 6, 2020
889695b
ExtUI homing / leveling additions
thinkyhead Nov 5, 2020
a8dffde
Move G29 3-point startup earlier
thinkyhead Dec 6, 2020
a3f6e48
Fix STM32F1 SERIAL_GET_TX_BUFFER_FREE
thinkyhead Dec 6, 2020
139a33c
G28 tweaks
thinkyhead Dec 6, 2020
6f4589b
G28 followup
thinkyhead Dec 6, 2020
1a04c8c
Avoid invalid memory optimizations (#20389)
rhapsodyv Dec 6, 2020
00143f7
[cron] Bump distribution date (2020-12-07)
thinkyhead Dec 7, 2020
ee4c2b3
Fix fileExists, use openFailed
thinkyhead Dec 7, 2020
2ecb4fa
Watch idle() depth over 5
thinkyhead Dec 7, 2020
b04914f
More LPC P-string macros
thinkyhead Dec 7, 2020
7f20184
Fix auto#.g file handling, add NO_SD_AUTOSTART (#20071)
thinkyhead Dec 7, 2020
182fdd9
Shorten Filament Load/Unload Strings to Fit on Graphical Displays (#2…
ellensp Dec 7, 2020
fee375f
Allow BTT EXP-MOT be used with Displays that needs only EXP 1 (#20396)
ellensp Dec 7, 2020
af20db4
[cron] Bump distribution date (2020-12-08)
thinkyhead Dec 8, 2020
9ead6a3
SPI TFT for STM32F4 boards (#20384)
rhapsodyv Dec 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@

#define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing

//#define NO_SD_AUTOSTART // Remove auto#.g file support completely to save some Flash, SRAM
//#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files

//#define BROWSE_MEDIA_ON_INSERT // Open the file browser when media is inserted
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/HAL/LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,11 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader
#ifndef strcmp_P
#define strcmp_P(a, b) strcmp((a), (b))
#endif

#ifndef strcat_P
#define strcat_P(a, b) strcat((a), (b))
#endif

#ifndef strcpy_P
#define strcpy_P(a, b) strcpy((a), (b))
#endif
3 changes: 3 additions & 0 deletions Marlin/src/HAL/STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "Servo.h"
#include "watchdog.h"
#include "MarlinSerial.h"

Expand Down Expand Up @@ -110,6 +111,8 @@
typedef int16_t pin_t;

#define HAL_SERVO_LIB libServo
#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
#define RESUME_SERVO_OUTPUT() libServo::resume_all_servos()

// ------------------------
// Public Variables
Expand Down
17 changes: 4 additions & 13 deletions Marlin/src/HAL/STM32/eeprom_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@

#include "../shared/eeprom_api.h"

#if HAS_SERVOS
#include "Servo.h"
#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
#define RESUME_SERVO_OUTPUT() libServo::resume_all_servos()
#else
#define PAUSE_SERVO_OUTPUT()
#define RESUME_SERVO_OUTPUT()
#endif

/**
* The STM32 HAL supports chips that deal with "pages" and some with "sectors" and some that
* even have multiple "banks" of flash.
Expand Down Expand Up @@ -172,11 +163,11 @@ bool PersistentStore::access_finish() {
current_slot = EEPROM_SLOTS - 1;
UNLOCK_FLASH();

PAUSE_SERVO_OUTPUT();
TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT());
DISABLE_ISRS();
status = HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError);
ENABLE_ISRS();
RESUME_SERVO_OUTPUT();
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
if (status != HAL_OK) {
DEBUG_ECHOLNPAIR("HAL_FLASHEx_Erase=", status);
DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError());
Expand Down Expand Up @@ -227,11 +218,11 @@ bool PersistentStore::access_finish() {
// Interrupts during this time can have unpredictable results, such as killing Servo
// output. Servo output still glitches with interrupts disabled, but recovers after the
// erase.
PAUSE_SERVO_OUTPUT();
TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT());
DISABLE_ISRS();
eeprom_buffer_flush();
ENABLE_ISRS();
RESUME_SERVO_OUTPUT();
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());

eeprom_data_written = false;
#endif
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/HAL/STM32/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@
#elif ENABLED(SERIAL_STATS_DROPPED_RX)
#error "SERIAL_STATS_DROPPED_RX is not supported on this platform."
#endif

#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) && NOT_TARGET(STM32F4xx, STM32F1xx)
#error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_U are currently only supported on STM32F4 and STM32F1 hardware."
#endif
143 changes: 67 additions & 76 deletions Marlin/src/HAL/STM32/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,32 +137,19 @@ const XrefInfo pin_xref[] PROGMEM = {
#endif

uint8_t get_pin_mode(const pin_t Ard_num) {
uint32_t mode_all = 0;
const PinName dp = digitalPinToPinName(Ard_num);
switch (PORT_ALPHA(dp)) {
case 'A' : mode_all = GPIOA->MODER; break;
case 'B' : mode_all = GPIOB->MODER; break;
case 'C' : mode_all = GPIOC->MODER; break;
case 'D' : mode_all = GPIOD->MODER; break;
#ifdef PE_0
case 'E' : mode_all = GPIOE->MODER; break;
#elif defined(PF_0)
case 'F' : mode_all = GPIOF->MODER; break;
#elif defined(PG_0)
case 'G' : mode_all = GPIOG->MODER; break;
#elif defined(PH_0)
case 'H' : mode_all = GPIOH->MODER; break;
#elif defined(PI_0)
case 'I' : mode_all = GPIOI->MODER; break;
#elif defined(PJ_0)
case 'J' : mode_all = GPIOJ->MODER; break;
#elif defined(PK_0)
case 'K' : mode_all = GPIOK->MODER; break;
#elif defined(PL_0)
case 'L' : mode_all = GPIOL->MODER; break;
#endif
uint32_t ll_pin = STM_LL_GPIO_PIN(dp);
GPIO_TypeDef *port = get_GPIO_Port(STM_PORT(dp));
uint32_t mode = LL_GPIO_GetPinMode(port, ll_pin);
switch (mode)
{
case LL_GPIO_MODE_ANALOG: return MODE_PIN_ANALOG;
case LL_GPIO_MODE_INPUT: return MODE_PIN_INPUT;
case LL_GPIO_MODE_OUTPUT: return MODE_PIN_OUTPUT;
case LL_GPIO_MODE_ALTERNATE: return MODE_PIN_ALT;
TERN_(STM32F1xx, case LL_GPIO_MODE_FLOATING:)
default: return 0;
}
return (mode_all >> (2 * uint8_t(PIN_NUM(dp)))) & 0x03;
}

bool GET_PINMODE(const pin_t Ard_num) {
Expand Down Expand Up @@ -217,58 +204,62 @@ bool pwm_status(const pin_t Ard_num) {
}

void pwm_details(const pin_t Ard_num) {
if (pwm_status(Ard_num)) {
uint32_t alt_all = 0;
const PinName dp = digitalPinToPinName(Ard_num);
pin_t pin_number = uint8_t(PIN_NUM(dp));
const bool over_7 = pin_number >= 8;
const uint8_t ind = over_7 ? 1 : 0;
switch (PORT_ALPHA(dp)) { // get alt function
case 'A' : alt_all = GPIOA->AFR[ind]; break;
case 'B' : alt_all = GPIOB->AFR[ind]; break;
case 'C' : alt_all = GPIOC->AFR[ind]; break;
case 'D' : alt_all = GPIOD->AFR[ind]; break;
#ifdef PE_0
case 'E' : alt_all = GPIOE->AFR[ind]; break;
#elif defined (PF_0)
case 'F' : alt_all = GPIOF->AFR[ind]; break;
#elif defined (PG_0)
case 'G' : alt_all = GPIOG->AFR[ind]; break;
#elif defined (PH_0)
case 'H' : alt_all = GPIOH->AFR[ind]; break;
#elif defined (PI_0)
case 'I' : alt_all = GPIOI->AFR[ind]; break;
#elif defined (PJ_0)
case 'J' : alt_all = GPIOJ->AFR[ind]; break;
#elif defined (PK_0)
case 'K' : alt_all = GPIOK->AFR[ind]; break;
#elif defined (PL_0)
case 'L' : alt_all = GPIOL->AFR[ind]; break;
#endif
}
if (over_7) pin_number -= 8;
#ifndef STM32F1xx
if (pwm_status(Ard_num)) {
uint32_t alt_all = 0;
const PinName dp = digitalPinToPinName(Ard_num);
pin_t pin_number = uint8_t(PIN_NUM(dp));
const bool over_7 = pin_number >= 8;
const uint8_t ind = over_7 ? 1 : 0;
switch (PORT_ALPHA(dp)) { // get alt function
case 'A' : alt_all = GPIOA->AFR[ind]; break;
case 'B' : alt_all = GPIOB->AFR[ind]; break;
case 'C' : alt_all = GPIOC->AFR[ind]; break;
case 'D' : alt_all = GPIOD->AFR[ind]; break;
#ifdef PE_0
case 'E' : alt_all = GPIOE->AFR[ind]; break;
#elif defined (PF_0)
case 'F' : alt_all = GPIOF->AFR[ind]; break;
#elif defined (PG_0)
case 'G' : alt_all = GPIOG->AFR[ind]; break;
#elif defined (PH_0)
case 'H' : alt_all = GPIOH->AFR[ind]; break;
#elif defined (PI_0)
case 'I' : alt_all = GPIOI->AFR[ind]; break;
#elif defined (PJ_0)
case 'J' : alt_all = GPIOJ->AFR[ind]; break;
#elif defined (PK_0)
case 'K' : alt_all = GPIOK->AFR[ind]; break;
#elif defined (PL_0)
case 'L' : alt_all = GPIOL->AFR[ind]; break;
#endif
}
if (over_7) pin_number -= 8;

uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F;
SERIAL_ECHOPAIR("Alt Function: ", alt_func);
if (alt_func < 10) SERIAL_CHAR(' ');
SERIAL_ECHOPGM(" - ");
switch (alt_func) {
case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break;
case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break;
case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break;
case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break;
case 4 : SERIAL_ECHOPGM("I2C1..3"); break;
case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break;
case 6 : SERIAL_ECHOPGM("SPI3"); break;
case 7 : SERIAL_ECHOPGM("USART1..3"); break;
case 8 : SERIAL_ECHOPGM("USART4..6"); break;
case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break;
case 10 : SERIAL_ECHOPGM("OTG"); break;
case 11 : SERIAL_ECHOPGM("ETH"); break;
case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break;
case 13 : SERIAL_ECHOPGM("DCMI"); break;
case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break;
case 15 : SERIAL_ECHOPGM("EVENTOUT"); break;
uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F;
SERIAL_ECHOPAIR("Alt Function: ", alt_func);
if (alt_func < 10) SERIAL_CHAR(' ');
SERIAL_ECHOPGM(" - ");
switch (alt_func) {
case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break;
case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break;
case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break;
case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break;
case 4 : SERIAL_ECHOPGM("I2C1..3"); break;
case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break;
case 6 : SERIAL_ECHOPGM("SPI3"); break;
case 7 : SERIAL_ECHOPGM("USART1..3"); break;
case 8 : SERIAL_ECHOPGM("USART4..6"); break;
case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break;
case 10 : SERIAL_ECHOPGM("OTG"); break;
case 11 : SERIAL_ECHOPGM("ETH"); break;
case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break;
case 13 : SERIAL_ECHOPGM("DCMI"); break;
case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break;
case 15 : SERIAL_ECHOPGM("EVENTOUT"); break;
}
}
}
#else
// TODO: F1 doesn't support changing pins function, so we need to check the function of the PIN and if it's enabled
#endif
} // pwm_details
Loading