1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-28 14:24:34 +00:00

STM32F1: STM32_HIGH_DENSITY is auto defined in HAL (#14057)

- Fix the `fsmc` and `sdio` units which required hard defines for use.
This commit is contained in:
Tanguy Pruvot 2019-05-19 03:45:22 +02:00 committed by Scott Lahteine
parent 87e7193259
commit 402f1f7307
2 changed files with 18 additions and 8 deletions

View File

@ -21,7 +21,11 @@
* *
*/ */
#if defined(ARDUINO_ARCH_STM32F1) && (defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY)) #ifdef ARDUINO_ARCH_STM32F1
#include <libmaple/stm32.h>
#if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY)
#include "HAL_sdio_STM32F1.h" #include "HAL_sdio_STM32F1.h"
@ -276,4 +280,5 @@ bool SDIO_GetCmdResp7(void) {
return true; return true;
} }
#endif // ARDUINO_ARCH_STM32F1 && (STM32_HIGH_DENSITY || STM32_XL_DENSITY) #endif // STM32_HIGH_DENSITY || STM32_XL_DENSITY
#endif // ARDUINO_ARCH_STM32F1

View File

@ -26,10 +26,10 @@
* Communication interface for FSMC * Communication interface for FSMC
*/ */
#if defined(ARDUINO_ARCH_STM32F1) && (defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY))
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if defined(ARDUINO_ARCH_STM32F1) && (defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY))
#if HAS_GRAPHICAL_LCD #if HAS_GRAPHICAL_LCD
#include "U8glib.h" #include "U8glib.h"
@ -232,8 +232,13 @@ void LCD_IO_Init(uint8_t cs, uint8_t rs) {
gpio_set_mode(PIN_MAP[cs].gpio_device, PIN_MAP[cs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_CS_NEx gpio_set_mode(PIN_MAP[cs].gpio_device, PIN_MAP[cs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_CS_NEx
gpio_set_mode(PIN_MAP[rs].gpio_device, PIN_MAP[rs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_RS_Ax gpio_set_mode(PIN_MAP[rs].gpio_device, PIN_MAP[rs].gpio_bit, GPIO_AF_OUTPUT_PP); //FSMC_RS_Ax
#ifdef STM32_XL_DENSITY
FSMC_NOR_PSRAM4_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN; FSMC_NOR_PSRAM4_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN;
FSMC_NOR_PSRAM4_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME; FSMC_NOR_PSRAM4_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME;
#else // PSRAM1 for STM32F103V (high density)
FSMC_NOR_PSRAM1_BASE->BCR = FSMC_BCR_WREN | FSMC_BCR_MTYP_SRAM | FSMC_BCR_MWID_16BITS | FSMC_BCR_MBKEN;
FSMC_NOR_PSRAM1_BASE->BTR = (FSMC_DATA_SETUP_TIME << 8) | FSMC_ADDRESS_SETUP_TIME;
#endif
afio_remap(AFIO_REMAP_FSMC_NADV); afio_remap(AFIO_REMAP_FSMC_NADV);