Skip to content

Commit

Permalink
Merge pull request #42 from MarlinFirmware/bugfix-2.0.x
Browse files Browse the repository at this point in the history
sync Bugfix 2.0.x
  • Loading branch information
Msq001 authored Jul 8, 2019
2 parents 4aa70f2 + 8b81c0e commit 698e752
Show file tree
Hide file tree
Showing 486 changed files with 5,481 additions and 2,156 deletions.
26 changes: 12 additions & 14 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,20 @@
// @section machine

/**
* Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN
* Power Supply Control
*
* 0 = No Power Switch
* 1 = ATX
* 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
*
* :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' }
* Enable and connect the power supply to the PS_ON_PIN.
* Specify whether the power supply is active HIGH or active LOW.
*/
#define POWER_SUPPLY 0
//#define PSU_CONTROL
//#define PSU_NAME "Power Supply"

#if ENABLED(PSU_CONTROL)
#define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2)

#if POWER_SUPPLY > 0
// Enable this option to leave the PSU off at startup.
// Power to steppers and heaters will need to be turned on with M80.
//#define PS_DEFAULT_OFF
//#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80

//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
#if ENABLED(AUTO_POWER_CONTROL)
#define AUTO_POWER_FANS // Turn on PSU if fans need power
#define AUTO_POWER_E_FANS
Expand All @@ -337,7 +335,6 @@
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature
#define POWER_TIMEOUT 30
#endif

#endif

// @section temperature
Expand All @@ -362,6 +359,7 @@
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
* 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup)
* 501 : 100K Zonestar (Tronxy X3A) Thermistor
* 512 : 100k RPW-Ultra hotend thermistor (4.7k pullup)
* 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
* 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
* 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
Expand Down Expand Up @@ -398,7 +396,7 @@
* 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below.
* 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
*
* :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" }
* :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '512':"100k RPW-Ultra hotend thermistor", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" }
*/
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void spiBegin(void) {
#endif
}

#if DISABLED(SOFTWARE_SPI, FORCE_SOFT_SPI)
#if NONE(SOFTWARE_SPI, FORCE_SOFT_SPI)

//------------------------------------------------------------------------------
// Hardware SPI
Expand Down Expand Up @@ -173,7 +173,7 @@ void spiBegin(void) {
// Invert the SPI2X bit
clockDiv ^= 0x1;

SPCR = _BV(SPE) | _BV(MSTR) | ((bitOrder == SPI_LSBFIRST) ? _BV(DORD) : 0) |
SPCR = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |
(dataMode << CPHA) | ((clockDiv >> 1) << SPR0);
SPSR = clockDiv | 0x01;
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,4 @@ static void pwm_details(uint8_t pin) {

#endif

#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer);} while (0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "../shared/persistent_store_api.h"
#include "../../inc/MarlinConfig.h"

#if ENABLED(EEPROM_SETTINGS) && DISABLED(I2C_EEPROM, SPI_EEPROM)
#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM)

#include "../shared/Marduino.h"

Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_DUE/G2_PWM.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* This module is stripped down version of the LPC1768_PWM.h file from
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_DUE/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* Test Arduino Due specific configuration values for errors at compile-time.
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "../../inc/MarlinConfig.h"
#include "../shared/persistent_store_api.h"

#if DISABLED(I2C_EEPROM, SPI_EEPROM)
#if NONE(I2C_EEPROM, SPI_EEPROM)
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
#endif

Expand All @@ -38,7 +38,7 @@ extern void eeprom_flush(void);
bool PersistentStore::access_start() { return true; }

bool PersistentStore::access_finish() {
#if DISABLED(I2C_EEPROM, SPI_EEPROM)
#if NONE(I2C_EEPROM, SPI_EEPROM)
eeprom_flush();
#endif
return true;
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_DUE/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
#define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin
#define PRINT_PORT(p)
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer);} while (0)
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
#define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL ? 1 : 0)
Expand Down
8 changes: 0 additions & 8 deletions Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@

#include "../../Marlin.h"

#define SPI_FULL_SPEED 0
#define SPI_HALF_SPEED 1
#define SPI_QUARTER_SPEED 2
#define SPI_EIGHTH_SPEED 3
#define SPI_SIXTEENTH_SPEED 4
#define SPI_SPEED_5 5
#define SPI_SPEED_6 6

void spiBegin();
void spiInit(uint8_t spiRate);
void spiSend(uint8_t b);
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifdef ARDUINO_ARCH_ESP32

Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_ESP32/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for ESP32. Disable EMERGENCY_PARSER to continue."
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_ESP32/servotimers.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_LINUX/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* Test X86_64-specific configuration values for errors at compile-time.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LINUX/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void write_serial_thread() {
void read_serial_thread() {
char buffer[255] = {};
for (;;) {
std::size_t len = MIN(usb_serial.receive_buffer.free(), 254U);
std::size_t len = _MIN(usb_serial.receive_buffer.free(), 254U);
if (fgets(buffer, len, stdin))
for (std::size_t i = 0; i < strlen(buffer); i++)
usb_serial.receive_buffer.write(buffer[i]);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_LINUX/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#define PRINT_PORT(p)
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer);} while (0)
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin

// active ADC function/mode/code values for PINSEL registers
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_LPC1768/HAL_Servo_LPC1768.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
// setup for SPI mode
SSP_CFG_Type HW_SPI_init; // data structure to hold init values
SSP_ConfigStructInit(&HW_SPI_init); // set values for SPI mode
HW_SPI_init.ClockRate = Marlin_speed[MIN(spiRate, 6)]; // put in the specified bit rate
HW_SPI_init.ClockRate = Marlin_speed[_MIN(spiRate, 6)]; // put in the specified bit rate
HW_SPI_init.Mode |= SSP_CR1_SSP_EN;
SSP_Init(LPC_SSPn, &HW_SPI_init); // puts the values into the proper bits in the SSP0 registers
}
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_LPC1768/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* Test LPC176x-specific configuration values for errors at compile-time.
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_LPC1768/include/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

#pragma once

#include "../../shared/HAL_SPI.h"
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#include "../shared/persistent_store_api.h"

#define FLASH_EEPROM_EMULATION
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_LPC1768/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#define PRINT_PORT(p)
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_ARRAY_NAME(x) do {sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%d.%02d"), LPC1768_PIN_PORT(p), LPC1768_PIN_PIN(p)); SERIAL_ECHO(buffer);} while (0)
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%d.%02d"), LPC1768_PIN_PORT(p), LPC1768_PIN_PIN(p)); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin

// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

void u8g_i2c_init(uint8_t options);
uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos);
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* LPC1768 LCD-specific defines
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* LCD delay routines - used by all the drivers.
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* Low level pin manipulation routines - used by all the drivers.
Expand Down
10 changes: 1 addition & 9 deletions Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,8 @@

#if HAS_GRAPHICAL_LCD

//#include <inttypes.h>
#include <U8glib.h>

#define SPI_FULL_SPEED 0
#define SPI_HALF_SPEED 1
#define SPI_QUARTER_SPEED 2
#define SPI_EIGHTH_SPEED 3
#define SPI_SIXTEENTH_SPEED 4
#define SPI_SPEED_5 5
#define SPI_SPEED_6 6
#include "../../shared/HAL_SPI.h"

void spiBegin();
void spiInit(uint8_t spiRate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,10 @@

#if HAS_GRAPHICAL_LCD

//#include <inttypes.h>
#include <U8glib.h>
#include "../../shared/HAL_SPI.h"
#include "../../shared/Delay.h"

#define SPI_FULL_SPEED 0
#define SPI_HALF_SPEED 1
#define SPI_QUARTER_SPEED 2
#define SPI_EIGHTH_SPEED 3
#define SPI_SIXTEENTH_SPEED 4
#define SPI_SPEED_5 5
#define SPI_SPEED_6 6

void spiBegin();
void spiInit(uint8_t spiRate);
void spiSend(uint8_t b);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
// Types
// --------------------------------------------------------------------------

typedef int8_t pin_t;
typedef int16_t pin_t;

#define HAL_SERVO_LIB libServo

Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@

#include "../shared/persistent_store_api.h"

#if DISABLED(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
#if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
#include <EEPROM.h>
static bool eeprom_data_written = false;
#endif

bool PersistentStore::access_start() {
#if DISABLED(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
#if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
eeprom_buffer_fill();
#endif
return true;
}

bool PersistentStore::access_finish() {
#if DISABLED(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
#if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
if (eeprom_data_written) {
eeprom_buffer_flush();
eeprom_data_written = false;
Expand Down Expand Up @@ -76,7 +76,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
pos++;
value++;
};
#if DISABLED(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
#if NONE(EEPROM_EMULATED_WITH_SRAM, SPI_EEPROM, I2C_EEPROM)
eeprom_data_written = true;
#endif

Expand Down
Loading

0 comments on commit 698e752

Please sign in to comment.