Bladeren bron

Compile only selected PIO environment (#11519)

Dave Johnson 5 jaren geleden
bovenliggende
commit
c64199941e
58 gewijzigde bestanden met toevoegingen van 248 en 84 verwijderingen
  1. 1
    1
      Marlin/src/HAL/HAL_AVR/HAL.h
  2. 1
    1
      Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp
  3. 51
    0
      Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp
  4. 2
    2
      Marlin/src/HAL/HAL_AVR/servo_AVR.cpp
  5. 1
    1
      Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp
  6. 2
    2
      Marlin/src/HAL/HAL_DUE/HAL.h
  7. 1
    1
      Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp
  8. 1
    1
      Marlin/src/HAL/HAL_DUE/Servo_Due.cpp
  9. 3
    3
      Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
  10. 59
    0
      Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp
  11. 1
    1
      Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp
  12. 2
    2
      Marlin/src/HAL/HAL_ESP32/HAL.h
  13. 1
    1
      Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp
  14. 1
    1
      Marlin/src/HAL/HAL_LPC1768/HAL.cpp
  15. 2
    2
      Marlin/src/HAL/HAL_LPC1768/HAL.h
  16. 1
    1
      Marlin/src/HAL/HAL_LPC1768/arduino.cpp
  17. 1
    1
      Marlin/src/HAL/HAL_LPC1768/include/SPI.h
  18. 1
    1
      Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp
  19. 1
    1
      Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h
  20. 1
    1
      Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp
  21. 1
    1
      Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp
  22. 2
    2
      Marlin/src/HAL/HAL_STM32F1/HAL.h
  23. 1
    1
      Marlin/src/HAL/HAL_STM32F1/HAL_spi_Stm32f1.cpp
  24. 1
    1
      Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp
  25. 2
    1
      Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp
  26. 2
    2
      Marlin/src/HAL/HAL_STM32F4/HAL.h
  27. 1
    1
      Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp
  28. 1
    1
      Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp
  29. 2
    2
      Marlin/src/HAL/HAL_STM32F7/HAL.h
  30. 1
    1
      Marlin/src/HAL/HAL_STM32F7/HAL_spi_STM32F7.cpp
  31. 2
    2
      Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp
  32. 1
    1
      Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp
  33. 2
    2
      Marlin/src/HAL/HAL_TEENSY35_36/HAL.h
  34. 1
    1
      Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp
  35. 51
    0
      Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp
  36. 1
    1
      Marlin/src/HAL/persistent_store_api.cpp
  37. 1
    1
      Marlin/src/HAL/shared/Delay.h
  38. 0
    0
      Marlin/src/HAL/shared/HAL_SPI.h
  39. 1
    1
      Marlin/src/HAL/shared/I2cEeprom.cpp
  40. 1
    1
      Marlin/src/HAL/shared/SpiEeprom.cpp
  41. 1
    1
      Marlin/src/HAL/shared/math_32bit.h
  42. 0
    0
      Marlin/src/HAL/shared/persistent_store_api.h
  43. 0
    0
      Marlin/src/HAL/shared/platforms.h
  44. 1
    1
      Marlin/src/HAL/shared/servo.cpp
  45. 3
    3
      Marlin/src/HAL/shared/servo.h
  46. 2
    2
      Marlin/src/HAL/shared/servo_private.h
  47. 1
    1
      Marlin/src/feature/Max7219_Debug_LEDs.cpp
  48. 1
    1
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  49. 1
    1
      Marlin/src/feature/dac/dac_dac084s085.cpp
  50. 1
    1
      Marlin/src/inc/MarlinConfigPre.h
  51. 1
    1
      Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp
  52. 1
    1
      Marlin/src/module/configuration_store.cpp
  53. 2
    1
      Marlin/src/module/configuration_store.h
  54. 1
    1
      Marlin/src/module/printcounter.cpp
  55. 1
    1
      Marlin/src/module/servo.h
  56. 1
    1
      Marlin/src/module/stepper.cpp
  57. 1
    1
      Marlin/src/module/temperature.cpp
  58. 20
    19
      platformio.ini

+ 1
- 1
Marlin/src/HAL/HAL_AVR/HAL.h Bestand weergeven

@@ -34,7 +34,7 @@
34 34
 #include <avr/interrupt.h>
35 35
 #include <avr/io.h>
36 36
 
37
-#include "../HAL_SPI.h"
37
+#include "../shared/HAL_SPI.h"
38 38
 #include "fastio_AVR.h"
39 39
 #include "watchdog_AVR.h"
40 40
 #include "math_AVR.h"

+ 1
- 1
Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp Bestand weergeven

@@ -25,7 +25,7 @@
25 25
 
26 26
 #if ENABLED(EEPROM_SETTINGS)
27 27
 
28
-#include "../persistent_store_api.h"
28
+#include "../shared/persistent_store_api.h"
29 29
 
30 30
 bool PersistentStore::access_start() { return true; }
31 31
 bool PersistentStore::access_finish() { return true; }

+ 51
- 0
Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp Bestand weergeven

@@ -0,0 +1,51 @@
1
+#ifdef __AVR__
2
+
3
+#include "../shared/persistent_store_api.h"
4
+
5
+#include "../../inc/MarlinConfig.h"
6
+
7
+#if ENABLED(EEPROM_SETTINGS)
8
+
9
+namespace HAL {
10
+namespace PersistentStore {
11
+
12
+bool access_start() { return true; }
13
+bool access_finish() { return true; }
14
+
15
+bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
16
+  while (size--) {
17
+    uint8_t * const p = (uint8_t * const)pos;
18
+    uint8_t v = *value;
19
+    // EEPROM has only ~100,000 write cycles,
20
+    // so only write bytes that have changed!
21
+    if (v != eeprom_read_byte(p)) {
22
+      eeprom_write_byte(p, v);
23
+      if (eeprom_read_byte(p) != v) {
24
+        SERIAL_ECHO_START();
25
+        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
26
+        return true;
27
+      }
28
+    }
29
+    crc16(crc, &v, 1);
30
+    pos++;
31
+    value++;
32
+  };
33
+  return false;
34
+}
35
+
36
+bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) {
37
+  do {
38
+    uint8_t c = eeprom_read_byte((unsigned char*)pos);
39
+    if (writing) *value = c;
40
+    crc16(crc, &c, 1);
41
+    pos++;
42
+    value++;
43
+  } while (--size);
44
+  return false;  // always assume success for AVR's
45
+}
46
+
47
+}
48
+}
49
+
50
+#endif // EEPROM_SETTINGS
51
+#endif // __AVR__

+ 2
- 2
Marlin/src/HAL/HAL_AVR/servo_AVR.cpp Bestand weergeven

@@ -60,8 +60,8 @@
60 60
 #include <avr/interrupt.h>
61 61
 #include <Arduino.h>
62 62
 
63
-#include "../servo.h"
64
-#include "../servo_private.h"
63
+#include "../shared/servo.h"
64
+#include "../shared/servo_private.h"
65 65
 
66 66
 static volatile int8_t Channel[_Nbr_16timers];              // counter for the servo being pulsed for each timer (or -1 if refresh interval)
67 67
 

+ 1
- 1
Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp Bestand weergeven

@@ -31,7 +31,7 @@
31 31
 
32 32
 #ifdef ARDUINO_ARCH_SAM
33 33
 
34
-#include "../persistent_store_api.h"
34
+#include "../shared/persistent_store_api.h"
35 35
 #include "../../inc/MarlinConfig.h"
36 36
 
37 37
 #if ENABLED(EEPROM_SETTINGS) && DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM)

+ 2
- 2
Marlin/src/HAL/HAL_DUE/HAL.h Bestand weergeven

@@ -35,8 +35,8 @@
35 35
 
36 36
 #include <Arduino.h>
37 37
 
38
-#include "../math_32bit.h"
39
-#include "../HAL_SPI.h"
38
+#include "../shared/math_32bit.h"
39
+#include "../shared/HAL_SPI.h"
40 40
 #include "fastio_Due.h"
41 41
 #include "watchdog_Due.h"
42 42
 #include "HAL_timers_Due.h"

+ 1
- 1
Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp Bestand weergeven

@@ -42,7 +42,7 @@
42 42
 // --------------------------------------------------------------------------
43 43
 
44 44
 #include "../../inc/MarlinConfig.h"
45
-#include "../Delay.h"
45
+#include "../shared/Delay.h"
46 46
 
47 47
 // --------------------------------------------------------------------------
48 48
 // Public Variables

+ 1
- 1
Marlin/src/HAL/HAL_DUE/Servo_Due.cpp Bestand weergeven

@@ -46,7 +46,7 @@
46 46
 
47 47
 #include <Arduino.h>
48 48
 #include "../servo.h"
49
-#include "../servo_private.h"
49
+#include "../shared/servo_private.h"
50 50
 
51 51
 static volatile int8_t Channel[_Nbr_16timers];              // counter for the servo being pulsed for each timer (or -1 if refresh interval)
52 52
 

+ 3
- 3
Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp Bestand weergeven

@@ -22,12 +22,12 @@
22 22
  */
23 23
 #ifdef ARDUINO_ARCH_SAM
24 24
 
25
-#include "../persistent_store_api.h"
26
-
27
-#include "../../inc/MarlinConfig.h"
25
+#include "../../inc/MarlinConfigPre.h"
28 26
 
29 27
 #if ENABLED(EEPROM_SETTINGS)
30 28
 
29
+#include "../shared/persistent_store_api.h"
30
+
31 31
 extern void eeprom_flush(void);
32 32
 
33 33
 bool PersistentStore::access_start() { return true; }

+ 59
- 0
Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp Bestand weergeven

@@ -0,0 +1,59 @@
1
+#ifdef ARDUINO_ARCH_SAM
2
+
3
+#include "../shared/persistent_store_api.h"
4
+
5
+#include "../../inc/MarlinConfig.h"
6
+
7
+#if ENABLED(EEPROM_SETTINGS)
8
+
9
+extern void eeprom_flush(void);
10
+
11
+namespace HAL {
12
+namespace PersistentStore {
13
+
14
+bool access_start() { return true; }
15
+
16
+bool access_finish() {
17
+  #if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM)
18
+    eeprom_flush();
19
+  #endif
20
+  return true;
21
+}
22
+
23
+bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
24
+  while (size--) {
25
+    uint8_t * const p = (uint8_t * const)pos;
26
+    uint8_t v = *value;
27
+    // EEPROM has only ~100,000 write cycles,
28
+    // so only write bytes that have changed!
29
+    if (v != eeprom_read_byte(p)) {
30
+      eeprom_write_byte(p, v);
31
+      if (eeprom_read_byte(p) != v) {
32
+        SERIAL_ECHO_START();
33
+        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
34
+        return true;
35
+      }
36
+    }
37
+    crc16(crc, &v, 1);
38
+    pos++;
39
+    value++;
40
+  };
41
+  return false;
42
+}
43
+
44
+bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) {
45
+  do {
46
+    uint8_t c = eeprom_read_byte((unsigned char*)pos);
47
+    if (writing) *value = c;
48
+    crc16(crc, &c, 1);
49
+    pos++;
50
+    value++;
51
+  } while (--size);
52
+  return false;
53
+}
54
+
55
+}
56
+}
57
+
58
+#endif // EEPROM_SETTINGS
59
+#endif // __AVR__

+ 1
- 1
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp Bestand weergeven

@@ -61,7 +61,7 @@
61 61
 
62 62
 #include <U8glib.h>
63 63
 #include <Arduino.h>
64
-#include "../Delay.h"
64
+#include "../shared/Delay.h"
65 65
 
66 66
 void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index) {
67 67
    PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1,

+ 2
- 2
Marlin/src/HAL/HAL_ESP32/HAL.h Bestand weergeven

@@ -40,8 +40,8 @@
40 40
 #undef DISABLED
41 41
 #define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b))
42 42
 
43
-#include "../math_32bit.h"
44
-#include "../HAL_SPI.h"
43
+#include "../shared/math_32bit.h"
44
+#include "../shared/HAL_SPI.h"
45 45
 
46 46
 #include "fastio_ESP32.h"
47 47
 #include "watchdog_ESP32.h"

+ 1
- 1
Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp Bestand weergeven

@@ -28,7 +28,7 @@
28 28
 // --------------------------------------------------------------------------
29 29
 
30 30
 #include "HAL.h"
31
-#include "../HAL_SPI.h"
31
+#include "../shared/HAL_SPI.h"
32 32
 #include "pins_arduino.h"
33 33
 #include "spi_pins.h"
34 34
 #include "../../core/macros.h"

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/HAL.cpp Bestand weergeven

@@ -21,7 +21,7 @@
21 21
 #ifdef TARGET_LPC1768
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24
-#include "../Delay.h"
24
+#include "../shared/Delay.h"
25 25
 
26 26
 HalSerial usb_serial;
27 27
 

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/HAL.h Bestand weergeven

@@ -60,8 +60,8 @@ extern "C" volatile uint32_t _millis;
60 60
 #include <Arduino.h>
61 61
 #include <pinmapping.h>
62 62
 
63
-#include "../math_32bit.h"
64
-#include "../HAL_SPI.h"
63
+#include "../shared/math_32bit.h"
64
+#include "../shared/HAL_SPI.h"
65 65
 #include "fastio.h"
66 66
 #include "watchdog.h"
67 67
 #include "serial.h"

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/arduino.cpp Bestand weergeven

@@ -26,7 +26,7 @@
26 26
 #include <lpc17xx_pinsel.h>
27 27
 
28 28
 #include "../../inc/MarlinConfig.h"
29
-#include "../Delay.h"
29
+#include "../shared/Delay.h"
30 30
 
31 31
 // Interrupts
32 32
 void cli(void) { __disable_irq(); } // Disable

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/include/SPI.h Bestand weergeven

@@ -22,7 +22,7 @@
22 22
 
23 23
 #pragma once
24 24
 
25
-#include "../../HAL_SPI.h"
25
+#include "../../shared/HAL_SPI.h"
26 26
 
27 27
 #include <stdint.h>
28 28
 

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp Bestand weergeven

@@ -37,7 +37,7 @@
37 37
 //
38 38
 //#include <WInterrupts.h>
39 39
 #include "../../../inc/MarlinConfig.h"
40
-#include "../../Delay.h"
40
+#include "../../shared/Delay.h"
41 41
 #include <stdint.h>
42 42
 #include <stdarg.h>
43 43
 #include <Arduino.h>

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h Bestand weergeven

@@ -19,6 +19,6 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
-#include "../persistent_store_api.h"
22
+#include "../shared/persistent_store_api.h"
23 23
 
24 24
 //#define FLASH_EEPROM

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp Bestand weergeven

@@ -61,7 +61,7 @@
61 61
 
62 62
 //#include <inttypes.h>
63 63
 #include <U8glib.h>
64
-#include "../Delay.h"
64
+#include "../shared/Delay.h"
65 65
 
66 66
 #define SPI_FULL_SPEED 0
67 67
 #define SPI_HALF_SPEED 1

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp Bestand weergeven

@@ -61,7 +61,7 @@
61 61
 
62 62
 #include <U8glib.h>
63 63
 #include "SoftwareSPI.h"
64
-#include "../Delay.h"
64
+#include "../shared/Delay.h"
65 65
 
66 66
 #define SPI_SPEED 3  // About 1 MHz
67 67
 

+ 2
- 2
Marlin/src/HAL/HAL_STM32F1/HAL.h Bestand weergeven

@@ -56,8 +56,8 @@
56 56
 // Includes
57 57
 // --------------------------------------------------------------------------
58 58
 
59
-#include "../math_32bit.h"
60
-#include "../HAL_SPI.h"
59
+#include "../shared/math_32bit.h"
60
+#include "../shared/HAL_SPI.h"
61 61
 
62 62
 #include "fastio_Stm32f1.h"
63 63
 #include "watchdog_Stm32f1.h"

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL_spi_Stm32f1.cpp Bestand weergeven

@@ -37,7 +37,7 @@
37 37
 // --------------------------------------------------------------------------
38 38
 
39 39
 #include "HAL.h"
40
-#include "../HAL_SPI.h"
40
+#include "../shared/HAL_SPI.h"
41 41
 #include "pins_arduino.h"
42 42
 #include "spi_pins.h"
43 43
 #include "../../core/macros.h"

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp Bestand weergeven

@@ -34,7 +34,7 @@
34 34
 // This is for EEPROM emulation in flash
35 35
 #if ENABLED(EEPROM_SETTINGS) && ENABLED(FLASH_EEPROM_EMULATION)
36 36
 
37
-#include "../persistent_store_api.h"
37
+#include "../shared/persistent_store_api.h"
38 38
 
39 39
 #include <flash_stm32.h>
40 40
 #include <EEPROM.h>

+ 2
- 1
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp Bestand weergeven

@@ -31,7 +31,8 @@
31 31
 
32 32
 #if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
33 33
 
34
-#include "../persistent_store_api.h"
34
+#include "../shared/persistent_store_api.h"
35
+
35 36
 #include "../../sd/cardreader.h"
36 37
 
37 38
 #define HAL_STM32F1_EEPROM_SIZE 4096

+ 2
- 2
Marlin/src/HAL/HAL_STM32F4/HAL.h Bestand weergeven

@@ -43,8 +43,8 @@
43 43
   #include <USBSerial.h>
44 44
 #endif
45 45
 
46
-#include "../math_32bit.h"
47
-#include "../HAL_SPI.h"
46
+#include "../shared/math_32bit.h"
47
+#include "../shared/HAL_SPI.h"
48 48
 #include "fastio_STM32F4.h"
49 49
 #include "watchdog_STM32F4.h"
50 50
 

+ 1
- 1
Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp Bestand weergeven

@@ -37,7 +37,7 @@
37 37
 // --------------------------------------------------------------------------
38 38
 
39 39
 #include "HAL.h"
40
-#include "../HAL_SPI.h"
40
+#include "../shared/HAL_SPI.h"
41 41
 #include "pins_arduino.h"
42 42
 #include "spi_pins.h"
43 43
 #include "../../core/macros.h"

+ 1
- 1
Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp Bestand weergeven

@@ -23,7 +23,7 @@
23 23
 
24 24
 #if defined(STM32F4) || defined(STM32F4xx)
25 25
 
26
-#include "../persistent_store_api.h"
26
+#include "../shared/persistent_store_api.h"
27 27
 
28 28
 #include "../../inc/MarlinConfig.h"
29 29
 

+ 2
- 2
Marlin/src/HAL/HAL_STM32F7/HAL.h Bestand weergeven

@@ -39,8 +39,8 @@
39 39
 
40 40
 #include "Arduino.h"
41 41
 
42
-#include "../math_32bit.h"
43
-#include "../HAL_SPI.h"
42
+#include "../shared/math_32bit.h"
43
+#include "../shared/HAL_SPI.h"
44 44
 
45 45
 #include "fastio_STM32F7.h"
46 46
 #include "watchdog_STM32F7.h"

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/HAL_spi_STM32F7.cpp Bestand weergeven

@@ -37,7 +37,7 @@
37 37
 // --------------------------------------------------------------------------
38 38
 
39 39
 #include "HAL.h"
40
-#include "../HAL_SPI.h"
40
+#include "../shared/HAL_SPI.h"
41 41
 #include "pins_arduino.h"
42 42
 #include "spi_pins.h"
43 43
 #include "../../core/macros.h"

+ 2
- 2
Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp Bestand weergeven

@@ -23,11 +23,11 @@
23 23
 
24 24
 #ifdef STM32F7
25 25
 
26
-#include "../../inc/MarlinConfig.h"
26
+#include "../../inc/MarlinConfigPre.h"
27 27
 
28 28
 #if ENABLED(EEPROM_SETTINGS)
29 29
 
30
-#include "../persistent_store_api.h"
30
+#include "../shared/persistent_store_api.h"
31 31
 
32 32
 bool PersistentStore::access_start() { return true; }
33 33
 bool PersistentStore::access_finish() { return true; }

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp Bestand weergeven

@@ -26,7 +26,7 @@
26 26
 #if defined(__MK64FX512__) || defined(__MK66FX1M0__)
27 27
 
28 28
 #include "HAL.h"
29
-#include "../Delay.h"
29
+#include "../shared/Delay.h"
30 30
 
31 31
 #include <Wire.h>
32 32
 

+ 2
- 2
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h Bestand weergeven

@@ -42,8 +42,8 @@
42 42
 #undef sq
43 43
 #define sq(x) ((x)*(x))
44 44
 
45
-#include "../math_32bit.h"
46
-#include "../HAL_SPI.h"
45
+#include "../shared/math_32bit.h"
46
+#include "../shared/HAL_SPI.h"
47 47
 
48 48
 #include "fastio_Teensy.h"
49 49
 #include "watchdog_Teensy.h"

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp Bestand weergeven

@@ -27,7 +27,7 @@
27 27
 
28 28
 #if ENABLED(EEPROM_SETTINGS)
29 29
 
30
-#include "../persistent_store_api.h"
30
+#include "../shared/persistent_store_api.h"
31 31
 #include <avr/eeprom.h>
32 32
 
33 33
 bool PersistentStore::access_start() { return true; }

+ 51
- 0
Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp Bestand weergeven

@@ -0,0 +1,51 @@
1
+#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
2
+
3
+#include "../../inc/MarlinConfig.h"
4
+
5
+#if ENABLED(EEPROM_SETTINGS)
6
+
7
+#include "../shared/persistent_store_api.h"
8
+
9
+namespace HAL {
10
+namespace PersistentStore {
11
+
12
+bool access_start() { return true; }
13
+bool access_finish() { return true; }
14
+
15
+bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
16
+  while (size--) {
17
+    uint8_t * const p = (uint8_t * const)pos;
18
+    uint8_t v = *value;
19
+    // EEPROM has only ~100,000 write cycles,
20
+    // so only write bytes that have changed!
21
+    if (v != eeprom_read_byte(p)) {
22
+      eeprom_write_byte(p, v);
23
+      if (eeprom_read_byte(p) != v) {
24
+        SERIAL_ECHO_START();
25
+        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
26
+        return true;
27
+      }
28
+    }
29
+    crc16(crc, &v, 1);
30
+    pos++;
31
+    value++;
32
+  };
33
+  return false;
34
+}
35
+
36
+bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) {
37
+  do {
38
+    uint8_t c = eeprom_read_byte((unsigned char*)pos);
39
+    if (writing) *value = c;
40
+    crc16(crc, &c, 1);
41
+    pos++;
42
+    value++;
43
+  } while (--size);
44
+  return false;
45
+}
46
+
47
+} // PersistentStore
48
+} // HAL
49
+
50
+#endif // EEPROM_SETTINGS
51
+#endif // __MK64FX512__ || __MK66FX1M0__

+ 1
- 1
Marlin/src/HAL/persistent_store_api.cpp Bestand weergeven

@@ -24,7 +24,7 @@
24 24
 
25 25
 #if ENABLED(EEPROM_SETTINGS)
26 26
 
27
-  #include "persistent_store_api.h"
27
+  #include "shared/persistent_store_api.h"
28 28
   PersistentStore persistentStore;
29 29
 
30 30
 #endif

Marlin/src/HAL/Delay.h → Marlin/src/HAL/shared/Delay.h Bestand weergeven

@@ -31,7 +31,7 @@
31 31
 #ifndef MARLIN_DELAY_H
32 32
 #define MARLIN_DELAY_H
33 33
 
34
-#include "../core/macros.h"
34
+#include "../../core/macros.h"
35 35
 
36 36
 #if defined(__arm__) || defined(__thumb__)
37 37
 

Marlin/src/HAL/HAL_SPI.h → Marlin/src/HAL/shared/HAL_SPI.h Bestand weergeven


Marlin/src/HAL/I2cEeprom.cpp → Marlin/src/HAL/shared/I2cEeprom.cpp Bestand weergeven

@@ -25,7 +25,7 @@
25 25
  * Not platform dependent.
26 26
  */
27 27
 
28
-#include "../inc/MarlinConfig.h"
28
+#include "../../inc/MarlinConfig.h"
29 29
 
30 30
 #if ENABLED(I2C_EEPROM)
31 31
 

Marlin/src/HAL/SpiEeprom.cpp → Marlin/src/HAL/shared/SpiEeprom.cpp Bestand weergeven

@@ -25,7 +25,7 @@
25 25
  * Not platform dependent.
26 26
  */
27 27
 
28
-#include "../inc/MarlinConfig.h"
28
+#include "../../inc/MarlinConfig.h"
29 29
 
30 30
 #if ENABLED(SPI_EEPROM)
31 31
 

Marlin/src/HAL/math_32bit.h → Marlin/src/HAL/shared/math_32bit.h Bestand weergeven

@@ -23,7 +23,7 @@
23 23
 #ifndef MATH_32BIT_H
24 24
 #define MATH_32BIT_H
25 25
 
26
-#include "../core/macros.h"
26
+#include "../../core/macros.h"
27 27
 
28 28
 /**
29 29
  * Math helper functions for 32 bit CPUs

Marlin/src/HAL/persistent_store_api.h → Marlin/src/HAL/shared/persistent_store_api.h Bestand weergeven


Marlin/src/HAL/platforms.h → Marlin/src/HAL/shared/platforms.h Bestand weergeven


Marlin/src/HAL/servo.cpp → Marlin/src/HAL/shared/servo.cpp Bestand weergeven

@@ -51,7 +51,7 @@
51 51
  *
52 52
  */
53 53
 
54
-#include "../inc/MarlinConfig.h"
54
+#include "../../inc/MarlinConfig.h"
55 55
 
56 56
 #if HAS_SERVOS && !(IS_32BIT_TEENSY || defined(TARGET_LPC1768) || defined(STM32F4) || defined(STM32F4xx))
57 57
 

Marlin/src/HAL/servo.h → Marlin/src/HAL/shared/servo.h Bestand weergeven

@@ -70,12 +70,12 @@
70 70
 #define SERVO_H
71 71
 
72 72
 #if IS_32BIT_TEENSY
73
-  #include "HAL_TEENSY35_36/HAL_Servo_Teensy.h" // Teensy HAL uses an inherited library
73
+  #include "../HAL_TEENSY35_36/HAL_Servo_Teensy.h" // Teensy HAL uses an inherited library
74 74
 
75 75
 #elif defined(TARGET_LPC1768)
76
-  #include "HAL_LPC1768/LPC1768_Servo.h"
76
+  #include "../HAL_LPC1768/LPC1768_Servo.h"
77 77
 #elif defined(STM32F4) || defined(STM32F4xx)
78
-  #include "HAL_STM32F4/HAL_Servo_STM32F4.h"
78
+  #include "../HAL_STM32F4/HAL_Servo_STM32F4.h"
79 79
 #else
80 80
   #include <stdint.h>
81 81
 

Marlin/src/HAL/servo_private.h → Marlin/src/HAL/shared/servo_private.h Bestand weergeven

@@ -46,9 +46,9 @@
46 46
 
47 47
 // Architecture specific include
48 48
 #ifdef __AVR__
49
-  #include "HAL_AVR/ServoTimers.h"
49
+  #include "../HAL_AVR/ServoTimers.h"
50 50
 #elif defined(ARDUINO_ARCH_SAM)
51
-  #include "HAL_DUE/ServoTimers.h"
51
+  #include "../HAL_DUE/ServoTimers.h"
52 52
 #else
53 53
   #error "This library only supports boards with an AVR or SAM3X processor."
54 54
 #endif

+ 1
- 1
Marlin/src/feature/Max7219_Debug_LEDs.cpp Bestand weergeven

@@ -46,7 +46,7 @@
46 46
 #include "../module/planner.h"
47 47
 #include "../module/stepper.h"
48 48
 #include "../Marlin.h"
49
-#include "../HAL/Delay.h"
49
+#include "../HAL/shared/Delay.h"
50 50
 
51 51
 uint8_t LEDs[8 * (MAX7219_NUMBER_UNITS)] = { 0 };
52 52
 

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Bestand weergeven

@@ -29,7 +29,7 @@
29 29
   #include "ubl.h"
30 30
 
31 31
   #include "../../../Marlin.h"
32
-  #include "../../../HAL/persistent_store_api.h"
32
+  #include "../../../HAL/shared/persistent_store_api.h"
33 33
   #include "../../../libs/hex_print_routines.h"
34 34
   #include "../../../module/configuration_store.h"
35 35
   #include "../../../lcd/ultralcd.h"

+ 1
- 1
Marlin/src/feature/dac/dac_dac084s085.cpp Bestand weergeven

@@ -12,7 +12,7 @@
12 12
 
13 13
 #include "../../Marlin.h"
14 14
 #include "../../module/stepper.h"
15
-#include "../../HAL/Delay.h"
15
+#include "../../HAL/shared/Delay.h"
16 16
 
17 17
 dac084s085::dac084s085() { }
18 18
 

+ 1
- 1
Marlin/src/inc/MarlinConfigPre.h Bestand weergeven

@@ -23,7 +23,7 @@
23 23
 #ifndef _MARLIN_CONFIGPRE_H_
24 24
 #define _MARLIN_CONFIGPRE_H_
25 25
 
26
-#include "../HAL/platforms.h"
26
+#include "../HAL/shared/platforms.h"
27 27
 #include "../core/boards.h"
28 28
 #include "../core/macros.h"
29 29
 #include "../core/types.h"

+ 1
- 1
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp Bestand weergeven

@@ -29,7 +29,7 @@
29 29
 
30 30
 #if !(defined(U8G_HAL_LINKS) || defined(__SAM3X8E__))
31 31
 
32
-#include "../../HAL/Delay.h"
32
+#include "../../HAL/shared/Delay.h"
33 33
 
34 34
 #define ST7920_CLK_PIN  LCD_PINS_D4
35 35
 #define ST7920_DAT_PIN  LCD_PINS_ENABLE

+ 1
- 1
Marlin/src/module/configuration_store.cpp Bestand weergeven

@@ -344,7 +344,7 @@ void MarlinSettings::postprocess() {
344 344
 }
345 345
 
346 346
 #if ENABLED(EEPROM_SETTINGS)
347
-  #include "../HAL/persistent_store_api.h"
347
+  #include "../HAL/shared/persistent_store_api.h"
348 348
 
349 349
   #define DUMMY_PID_VALUE 3000.0f
350 350
   #define EEPROM_START() int eeprom_index = EEPROM_OFFSET; persistentStore.access_start()

+ 2
- 1
Marlin/src/module/configuration_store.h Bestand weergeven

@@ -24,8 +24,9 @@
24 24
 #define CONFIGURATION_STORE_H
25 25
 
26 26
 #include "../inc/MarlinConfig.h"
27
+
27 28
 #if ENABLED(EEPROM_SETTINGS)
28
-  #include "../HAL/persistent_store_api.h"
29
+  #include "../HAL/shared/persistent_store_api.h"
29 30
 #endif
30 31
 
31 32
 #define ADD_PORT_ARG ENABLED(EEPROM_CHITCHAT) && NUM_SERIAL > 1

+ 1
- 1
Marlin/src/module/printcounter.cpp Bestand weergeven

@@ -31,7 +31,7 @@ Stopwatch print_job_timer;      // Global Print Job Timer instance
31 31
 
32 32
 #include "printcounter.h"
33 33
 #include "../Marlin.h"
34
-#include "../HAL/persistent_store_api.h"
34
+#include "../HAL/shared/persistent_store_api.h"
35 35
 
36 36
 PrintCounter print_job_timer;   // Global Print Job Timer instance
37 37
 

+ 1
- 1
Marlin/src/module/servo.h Bestand weergeven

@@ -27,7 +27,7 @@
27 27
 #ifndef _SERVO_H_
28 28
 #define _SERVO_H_
29 29
 
30
-#include "../HAL/servo.h"
30
+#include "../HAL/shared/servo.h"
31 31
 
32 32
 extern HAL_SERVO_LIB servo[NUM_SERVOS];
33 33
 extern void servo_init();

+ 1
- 1
Marlin/src/module/stepper.cpp Bestand weergeven

@@ -93,7 +93,7 @@
93 93
 #include "../gcode/queue.h"
94 94
 #include "../sd/cardreader.h"
95 95
 #include "../Marlin.h"
96
-#include "../HAL/Delay.h"
96
+#include "../HAL/shared/Delay.h"
97 97
 
98 98
 #if MB(ALLIGATOR)
99 99
   #include "../feature/dac/dac_dac084s085.h"

+ 1
- 1
Marlin/src/module/temperature.cpp Bestand weergeven

@@ -31,7 +31,7 @@
31 31
 #include "../lcd/ultralcd.h"
32 32
 #include "planner.h"
33 33
 #include "../core/language.h"
34
-#include "../HAL/Delay.h"
34
+#include "../HAL/shared/Delay.h"
35 35
 
36 36
 #if ENABLED(HEATER_0_USES_MAX6675)
37 37
   #include "../libs/private_spi.h"

+ 20
- 19
platformio.ini Bestand weergeven

@@ -58,7 +58,7 @@ board             = megaatmega2560
58 58
 build_flags       = ${common.build_flags}
59 59
 board_build.f_cpu = 16000000L
60 60
 lib_deps          = ${common.lib_deps}
61
-src_filter        = ${common.default_src_filter}
61
+src_filter        = ${common.default_src_filter} +<src/HAL/HAL_AVR>
62 62
 monitor_speed     = 250000
63 63
 
64 64
 #
@@ -71,7 +71,7 @@ board             = megaatmega1280
71 71
 build_flags       = ${common.build_flags}
72 72
 board_build.f_cpu = 16000000L
73 73
 lib_deps          = ${common.lib_deps}
74
-src_filter        = ${common.default_src_filter}
74
+src_filter        = ${common.default_src_filter} +<src/HAL/HAL_AVR>
75 75
 monitor_speed     = 250000
76 76
 
77 77
 #
@@ -88,7 +88,7 @@ board         = at90usb1286
88 88
 build_flags   = ${common.build_flags}
89 89
 lib_deps      = ${common.lib_deps}
90 90
 lib_ldf_mode  = deep+
91
-src_filter    = ${common.default_src_filter}
91
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
92 92
 extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_CDC.py
93 93
 monitor_speed = 250000
94 94
 
@@ -122,7 +122,7 @@ board         = due
122 122
 build_flags   = ${common.build_flags}
123 123
 lib_deps      = ${common.lib_deps}
124 124
 lib_ignore    = c1921b4
125
-src_filter    = ${common.default_src_filter}
125
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_DUE>
126 126
 monitor_speed = 250000
127 127
 [env:DUE_USB]
128 128
 platform      = atmelsam
@@ -131,7 +131,7 @@ board         = dueUSB
131 131
 build_flags   = ${common.build_flags}
132 132
 lib_deps      = ${common.lib_deps}
133 133
 lib_ignore    = c1921b4
134
-src_filter    = ${common.default_src_filter}
134
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_DUE>
135 135
 monitor_speed = 250000
136 136
 [env:DUE_debug]
137 137
 # Used when WATCHDOG_RESET_MANUAL is enabled
@@ -143,7 +143,7 @@ build_flags   = ${common.build_flags}
143 143
   -mpoke-function-name
144 144
 lib_deps      = ${common.lib_deps}
145 145
 lib_ignore    = c1921b4
146
-src_filter    = ${common.default_src_filter}
146
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_DUE>
147 147
 monitor_speed = 250000
148 148
 
149 149
 #
@@ -165,7 +165,7 @@ lib_deps          = CMSIS-LPC1768
165 165
   TMC2130Stepper@>=2.2.1
166 166
   TMC2208Stepper@>=0.2.1
167 167
 extra_scripts     = Marlin/src/HAL/HAL_LPC1768/debug_extra_script.py, Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py, Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
168
-src_filter        = ${common.default_src_filter}
168
+src_filter        = ${common.default_src_filter} +<src/HAL/HAL_LPC1768>
169 169
 monitor_speed     = 250000
170 170
 debug_tool        = custom
171 171
 debug_server      =
@@ -187,7 +187,7 @@ board         = sanguino_atmega1284p
187 187
 build_flags   = ${common.build_flags}
188 188
 upload_speed  = 57600
189 189
 lib_deps      = ${common.lib_deps}
190
-src_filter    = ${common.default_src_filter}
190
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
191 191
 monitor_speed = 250000
192 192
 
193 193
 #
@@ -200,7 +200,7 @@ board         = sanguino_atmega1284p
200 200
 build_flags   = ${common.build_flags}
201 201
 upload_speed  = 115200
202 202
 lib_deps      = ${common.lib_deps}
203
-src_filter    = ${common.default_src_filter}
203
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
204 204
 monitor_speed = 250000
205 205
 
206 206
 #
@@ -213,7 +213,7 @@ board             = reprap_rambo
213 213
 build_flags       = ${common.build_flags}
214 214
 board_build.f_cpu = 16000000L
215 215
 lib_deps          = ${common.lib_deps}
216
-src_filter        = ${common.default_src_filter}
216
+src_filter        = ${common.default_src_filter} +<src/HAL/HAL_AVR>
217 217
 monitor_speed     = 250000
218 218
 
219 219
 #
@@ -225,7 +225,7 @@ framework     = arduino
225 225
 board         = sanguino_atmega644p
226 226
 build_flags   = ${common.build_flags}
227 227
 lib_deps      = ${common.lib_deps}
228
-src_filter    = ${common.default_src_filter}
228
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
229 229
 monitor_speed = 250000
230 230
 
231 231
 #
@@ -237,7 +237,7 @@ framework     = arduino
237 237
 board         = sanguino_atmega1284p
238 238
 build_flags   = ${common.build_flags}
239 239
 lib_deps      = ${common.lib_deps}
240
-src_filter    = ${common.default_src_filter}
240
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
241 241
 monitor_speed = 250000
242 242
 
243 243
 #
@@ -259,7 +259,7 @@ lib_ignore    = U8glib-HAL
259 259
   libf3e
260 260
   TMC26XStepper
261 261
 lib_ldf_mode  = 1
262
-src_filter    = ${common.default_src_filter}
262
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
263 263
 monitor_speed = 250000
264 264
 
265 265
 #
@@ -272,7 +272,7 @@ board         = disco_f407vg
272 272
 build_flags   = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB
273 273
 lib_deps      = ${common.lib_deps}
274 274
 lib_ignore    = Adafruit NeoPixel, c1921b4, TMC2130Stepper
275
-src_filter    = ${common.default_src_filter}
275
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F4>
276 276
 monitor_speed = 250000
277 277
 
278 278
 #
@@ -285,7 +285,7 @@ board         = teensy35
285 285
 build_flags   = ${common.build_flags}
286 286
 lib_deps      = ${common.lib_deps}
287 287
 lib_ignore    = Adafruit NeoPixel
288
-src_filter    = ${common.default_src_filter}
288
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_TEENSY35_36>
289 289
 monitor_speed = 250000
290 290
 
291 291
 [env:malyanm200]
@@ -293,7 +293,7 @@ platform    = ststm32
293 293
 framework   = arduino
294 294
 board       = malyanM200
295 295
 build_flags = !python Marlin/src/HAL/HAL_STM32F1/stm32f1_flag_script.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections
296
-src_filter  = ${common.default_src_filter}
296
+src_filter  = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
297 297
 #-<frameworks>
298 298
 lib_ignore  =
299 299
   U8glib
@@ -313,9 +313,9 @@ lib_ignore  =
313 313
 # Espressif ESP32
314 314
 #
315 315
 [env:esp32]
316
-platform = https://github.com/platformio/platform-espressif32.git#feature/stage
317
-board = esp32dev
318
-framework = arduino
316
+platform    = https://github.com/platformio/platform-espressif32.git#feature/stage
317
+board       = esp32dev
318
+framework   = arduino
319 319
 upload_port = COM3
320 320
 lib_ignore  =
321 321
   LiquidCrystal_I2C
@@ -324,3 +324,4 @@ lib_ignore  =
324 324
   LiquidTWI2
325 325
   TMC26XStepper
326 326
   c1921b4
327
+src_filter  = ${common.default_src_filter} +<src/HAL/HAL_ESP32>

Laden…
Annuleren
Opslaan