Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1b921b2
Fix pca9632_set_led_color
thinkyhead Aug 13, 2018
0bda223
Allow Einsy RAMBo FAN1_PIN override
thinkyhead Aug 13, 2018
f1347f7
Optimize thermistor table 71
thinkyhead Aug 13, 2018
11b411a
Improve AXIS_DRIVER_TYPE macros
thinkyhead Aug 13, 2018
fd15b14
add I parameter to M42 to allow access to sensitive pins
Roxy-3D Aug 13, 2018
60f1376
Make M7219 I more robust and nice to look at
Roxy-3D Aug 13, 2018
66d2b48
Update PersistentStore api (#11538)
p3p Aug 13, 2018
6a8b906
Followup for persistent_store_api.h
thinkyhead Aug 13, 2018
577aeb4
All EEPROM access uses persistentStore
hasenbanck Aug 12, 2018
65c5227
Change M7219 I to setup Max7219 registers, but not do initialization …
Roxy-3D Aug 13, 2018
cc0a604
Merge pull request #11526 from hasenbanck/eeprom-cleanup
thinkyhead Aug 14, 2018
a4b0148
Easier to find 'static inline'
thinkyhead Aug 14, 2018
865ee59
Followup persistent store with heading, const
thinkyhead Aug 14, 2018
ccf65c5
Merge pull request #11542 from thinkyhead/bf2_misc_fixes_aug_6
thinkyhead Aug 14, 2018
6964e1a
Clean up trailing whitespace
thinkyhead Aug 14, 2018
5be2559
Use flash memory to emulate EEPROM (#11500)
gloomyandy Aug 14, 2018
c641999
Compile only selected PIO environment (#11519)
Aug 14, 2018
834ea7f
Remove 'const' from PersistentStore::capacity
thinkyhead Aug 14, 2018
846bd24
MALYAN_LCD is ok without SD
thinkyhead Aug 14, 2018
5573ef6
[2.0.x] PersistentStore update followup (#11549)
p3p Aug 14, 2018
b37bfef
[2.0.x] Use the new const functions of the persistentStore api (#11544)
hasenbanck Aug 14, 2018
1561e61
New TMC2208 constructor
thinkyhead Aug 14, 2018
bd6d032
Update default driver configuration
thinkyhead Aug 14, 2018
67613bf
Update Czech translations (#11510)
petrzjunior Aug 14, 2018
952a1bc
Merge pull request #11551 from thinkyhead/bf2_trinamic_fixes
thinkyhead Aug 15, 2018
e9de321
declare void Max7219_register_setup();
Roxy-3D Aug 15, 2018
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
32 changes: 17 additions & 15 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -552,27 +552,30 @@
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.

/**
* Specify Stepper Driver types
* The options are used to determine driver pulse timings as well as more advanced functionality.
* Stepper timing options can be overridden in Configuration_adv.h
* Stepper Drivers
*
* These settings allow Marlin to tune stepper driver timing and enable advanced options for
* stepper drivers that support them. You may also override timing options in Configuration_adv.h.
*
* A4988 is assumed for unspecified drivers.
*
* Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE,
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
* TMC5130, TMC5130_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE']
*/
#define X_DRIVER_TYPE A4988
#define Y_DRIVER_TYPE A4988
#define Z_DRIVER_TYPE A4988
#define X2_DRIVER_TYPE A4988
#define Y2_DRIVER_TYPE A4988
#define Z2_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE A4988
#define E1_DRIVER_TYPE A4988
#define E2_DRIVER_TYPE A4988
#define E3_DRIVER_TYPE A4988
#define E4_DRIVER_TYPE A4988
//#define X_DRIVER_TYPE A4988
//#define Y_DRIVER_TYPE A4988
//#define Z_DRIVER_TYPE A4988
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
//#define E4_DRIVER_TYPE A4988

// Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles.
Expand Down Expand Up @@ -1803,7 +1806,6 @@

//
// LCD for Malyan M200 printers.
// This requires SDSUPPORT to be enabled
//
//#define MALYAN_LCD

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <avr/interrupt.h>
#include <avr/io.h>

#include "../HAL_SPI.h"
#include "../shared/HAL_SPI.h"
#include "fastio_AVR.h"
#include "watchdog_AVR.h"
#include "math_AVR.h"
Expand Down
68 changes: 68 additions & 0 deletions Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifdef __AVR__

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

#if ENABLED(EEPROM_SETTINGS)

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

bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }

bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value;
// EEPROM has only ~100,000 write cycles,
// so only write bytes that have changed!
if (v != eeprom_read_byte(p)) {
eeprom_write_byte(p, v);
if (eeprom_read_byte(p) != v) {
SERIAL_ECHO_START();
SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
};
return false;
}

bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((unsigned char*)pos);
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
value++;
} while (--size);
return false; // always assume success for AVR's
}

size_t PersistentStore::capacity() { return E2END + 1; }

#endif // EEPROM_SETTINGS
#endif // __AVR__
51 changes: 0 additions & 51 deletions Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp

This file was deleted.

4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_AVR/servo_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
#include <avr/interrupt.h>
#include <Arduino.h>

#include "../servo.h"
#include "../servo_private.h"
#include "../shared/servo.h"
#include "../shared/servo_private.h"

static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)

Expand Down
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 @@ -31,7 +31,7 @@

#ifdef ARDUINO_ARCH_SAM

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

#if ENABLED(EEPROM_SETTINGS) && DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

#include <Arduino.h>

#include "../math_32bit.h"
#include "../HAL_SPI.h"
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"
#include "fastio_Due.h"
#include "watchdog_Due.h"
#include "HAL_timers_Due.h"
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
// --------------------------------------------------------------------------

#include "../../inc/MarlinConfig.h"
#include "../Delay.h"
#include "../shared/Delay.h"

// --------------------------------------------------------------------------
// Public Variables
Expand Down
5 changes: 2 additions & 3 deletions Marlin/src/HAL/HAL_DUE/Servo_Due.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#if HAS_SERVOS

#include <Arduino.h>
#include "../servo.h"
#include "../servo_private.h"
#include "../shared/servo.h"
#include "../shared/servo_private.h"

static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)

Expand Down Expand Up @@ -158,4 +158,3 @@ void finISR(timer16_Sequence_t timer) {
#endif // HAS_SERVOS

#endif // ARDUINO_ARCH_SAM

82 changes: 82 additions & 0 deletions Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* Marlin 3D Printer Firmware
*
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifdef ARDUINO_ARCH_SAM

#include "../../inc/MarlinConfigPre.h"

#if ENABLED(EEPROM_SETTINGS)

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

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

extern void eeprom_flush(void);

bool PersistentStore::access_start() { return true; }

bool PersistentStore::access_finish() {
#if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM)
eeprom_flush();
#endif
return true;
}

bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value;
// EEPROM has only ~100,000 write cycles,
// so only write bytes that have changed!
if (v != eeprom_read_byte(p)) {
eeprom_write_byte(p, v);
if (eeprom_read_byte(p) != v) {
SERIAL_ECHO_START();
SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
};
return false;
}

bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((unsigned char*)pos);
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
value++;
} while (--size);
return false;
}

size_t PersistentStore::capacity() { return E2END + 1; }

#endif // EEPROM_SETTINGS
#endif // ARDUINO_ARCH_SAM
59 changes: 0 additions & 59 deletions Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

#include <U8glib.h>
#include <Arduino.h>
#include "../Delay.h"
#include "../shared/Delay.h"

void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index) {
PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1,
Expand Down
Loading