Skip to content

Commit

Permalink
LPC1768 EEPROM fallback to flash, add overrides (MarlinFirmware#17184)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored Mar 16, 2020
1 parent 2fc0df1 commit b14c933
Show file tree
Hide file tree
Showing 31 changed files with 168 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
#if USE_EMULATED_EEPROM
#undef SRAM_EEPROM_EMULATION
#undef SDCARD_EEPROM_EMULATION
#define FLASH_EEPROM_EMULATION 1
#define FLASH_EEPROM_EMULATION
#endif
5 changes: 5 additions & 0 deletions Marlin/src/HAL/ESP32/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
*
*/
#pragma once

// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
#define SDCARD_EEPROM_EMULATION
#endif
8 changes: 2 additions & 6 deletions Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*/
#pragma once

#if ENABLED(EEPROM_SETTINGS)
#undef USE_REAL_EEPROM
#define USE_EMULATED_EEPROM 1
#if DISABLED(FLASH_EEPROM_EMULATION)
#define SDCARD_EEPROM_EMULATION 1
#endif
#if USE_EMULATED_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
#define FLASH_EEPROM_EMULATION
#endif
3 changes: 1 addition & 2 deletions Marlin/src/HAL/LPC1768/persistent_store_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@
* 16Kb I/O buffers (intended to hold DMA USB and Ethernet data, but currently
* unused).
*/
#include "../../inc/MarlinConfigPre.h"
#include "../../inc/MarlinConfig.h"

#if ENABLED(FLASH_EEPROM_EMULATION)

#include "persistent_store_api.h"
#include "../../inc/MarlinConfig.h"

extern "C" {
#include <lpc17xx_iap.h>
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/SAMD51/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
#if USE_EMULATED_EEPROM
#undef SRAM_EEPROM_EMULATION
#undef SDCARD_EEPROM_EMULATION
#define FLASH_EEPROM_EMULATION 1
#define FLASH_EEPROM_EMULATION
#endif
5 changes: 5 additions & 0 deletions Marlin/src/HAL/STM32/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
*
*/
#pragma once

// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
#define SDCARD_EEPROM_EMULATION
#endif
3 changes: 1 addition & 2 deletions Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

#if ENABLED(EEPROM_SETTINGS) && defined(STM32F7)
#undef USE_REAL_EEPROM
#define USE_EMULATED_EEPROM 1
#undef SRAM_EEPROM_EMULATION
#undef SDCARD_EEPROM_EMULATION
#define FLASH_EEPROM_EMULATION 1
#define FLASH_EEPROM_EMULATION
#endif
5 changes: 5 additions & 0 deletions Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
*
*/
#pragma once

// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
#define SDCARD_EEPROM_EMULATION
#endif
4 changes: 1 addition & 3 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@
#define HAS_LINEAR_E_JERK 1
#endif

// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
#if ENABLED(EEPROM_SETTINGS)
#if NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) && EITHER(I2C_EEPROM, SPI_EEPROM)
#define USE_REAL_EEPROM 1
#else
#define USE_EMULATED_EEPROM 1
#endif
#if NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
#define SDCARD_EEPROM_EMULATION 1
#endif
#else
#undef I2C_EEPROM
#undef SPI_EEPROM
Expand Down
15 changes: 15 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1993,9 +1993,24 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
static_assert(PWM_PIN(E2_AUTO_FAN_PIN), "E2" AF_ERR_SUFF);
#elif HAS_AUTO_FAN_3
static_assert(PWM_PIN(E3_AUTO_FAN_PIN), "E3" AF_ERR_SUFF);
#elif HAS_AUTO_FAN_4
static_assert(PWM_PIN(E4_AUTO_FAN_PIN), "E4" AF_ERR_SUFF);
#elif HAS_AUTO_FAN_5
static_assert(PWM_PIN(E5_AUTO_FAN_PIN), "E5" AF_ERR_SUFF);
#elif HAS_AUTO_FAN_6
static_assert(PWM_PIN(E6_AUTO_FAN_PIN), "E6" AF_ERR_SUFF);
#elif HAS_AUTO_FAN_7
static_assert(PWM_PIN(E7_AUTO_FAN_PIN), "E7" AF_ERR_SUFF);
#endif
#endif

/**
* Make sure only one EEPROM type is enabled
*/
#if ENABLED(EEPROM_SETTINGS) && 1 < ENABLED(SDCARD_EEPROM_EMULATION) + ENABLED(FLASH_EEPROM_EMULATION) + ENABLED(SRAM_EEPROM_EMULATION)
#error "Please select only one of SDCARD, FLASH, or SRAM_EEPROM_EMULATION."
#endif

/**
* Make sure only one display is enabled
*/
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

#define BOARD_INFO_NAME "AZSMZ MINI"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
#define BOARD_INFO_NAME "BIQU Thunder B300 V1.0"
#endif

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Limit Switches
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@

#define BOARD_INFO_NAME "BIQU BQ111-A4"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Limit Switches
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@

#define BOARD_INFO_NAME "BIGTREE SKR 1.1"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Limit Switches
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@

#define BOARD_INFO_NAME "BIGTREE SKR 1.3"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

/**
* Trinamic Stallguard pins
*/
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
#define BOARD_INFO_NAME "BIGTREE SKR 1.4"
#endif

//
// EEPROM
//
#if NONE(FLASH_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION)
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION
#endif

//
// SD Connection
//
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
// Ignore temp readings during development.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000

#if DISABLED(SDCARD_EEPROM_EMULATION)
#define FLASH_EEPROM_EMULATION
#endif

//
// Steppers
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
// Ignore temp readings during develpment.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Enable 12MHz clock output on P1.27 pin to sync TMC2208 chip clocks
//
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SBASE"
#endif

//
// EEPROM
//
#if NONE(FLASH_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION)
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION
#endif

#define LED_PIN P1_18 // Used as a status indicator
#define LED2_PIN P1_19
#define LED3_PIN P1_20
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
#define BOARD_INFO_NAME "MKS SGen-L"
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN_L"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@

#define BOARD_INFO_NAME "Re-ARM RAMPS 1.4"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
#define BOARD_INFO_NAME "Selena Compact"
#define BOARD_WEBSITE_URL "github.com/Ales2-k/Selena"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand Down
7 changes: 6 additions & 1 deletion Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
#define BOARD_INFO_NAME "Azteeg X5 GT"
#define BOARD_WEBSITE_URL "tinyurl.com/yx8tdqa3"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand All @@ -47,7 +53,6 @@
#define Z_MIN_PIN P1_26
#define Z_MAX_PIN P1_29


//
// Steppers
//
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@

#endif // HAS_SPI_LCD

//
// EEPROM
//
#if NONE(FLASH_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION)
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION
#endif

//
// SD Support
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

#define BOARD_INFO_NAME "Azteeg X5 MINI WIFI"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// DIGIPOT slave addresses
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
#define BOARD_INFO_NAME "BIGTREE SKR 1.4 TURBO"
#define SKR_HAS_LPC1769

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Include SKR 1.4 pins
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

#define BOARD_INFO_NAME "Cohesion3D Mini"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

#define BOARD_INFO_NAME "Cohesion3D ReMix"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/pins/lpc1769/pins_MKS_SGEN.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@

#define BOARD_INFO_NAME "MKS SGen"
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN"
#define MKS_HAS_LPC1769

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

#define MKS_HAS_LPC1769
#include "../lpc1768/pins_MKS_SBASE.h"

#undef E1_STEP_PIN
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
#define BOARD_INFO_NAME "Smoothieboard"
#define BOARD_WEBSITE_URL "smoothieware.org/smoothieboard"

//
// EEPROM
//
#define FLASH_EEPROM_EMULATION
//#define SDCARD_EEPROM_EMULATION

//
// Servos
//
Expand Down
Loading

0 comments on commit b14c933

Please sign in to comment.