Browse Source

HAL updates

Scott Lahteine 8 years ago
parent
commit
54326fb06a
52 changed files with 330 additions and 381 deletions
  1. 1
    1
      Marlin/frameworks/CMSIS/LPC1768/driver/lpc17xx_emac.c
  2. 36
    36
      Marlin/frameworks/CMSIS/LPC1768/lib/LiquidCrystal.cpp
  3. 1
    1
      Marlin/frameworks/CMSIS/LPC1768/lib/Stream.cpp
  4. 2
    2
      Marlin/src/HAL/HAL.h
  5. 2
    2
      Marlin/src/HAL/HAL_AVR/HAL_AVR.cpp
  6. 3
    3
      Marlin/src/HAL/HAL_AVR/HAL_pinsDebug_AVR.h
  7. 1
    1
      Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp
  8. 2
    3
      Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
  9. 1
    1
      Marlin/src/HAL/HAL_AVR/MarlinSerial.h
  10. 2
    1
      Marlin/src/HAL/HAL_AVR/endstop_interrupts.h
  11. 8
    1
      Marlin/src/HAL/HAL_AVR/fastio_AVR.h
  12. 1
    4
      Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp
  13. 7
    3
      Marlin/src/HAL/HAL_AVR/pinsDebug_AVR_8_bit.h
  14. 1
    1
      Marlin/src/HAL/HAL_AVR/servo_AVR.cpp
  15. 2
    2
      Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp
  16. 7
    1
      Marlin/src/HAL/HAL_DUE/HAL_Due.h
  17. 1
    1
      Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp
  18. 1
    1
      Marlin/src/HAL/HAL_DUE/Servo_Due.cpp
  19. 1
    4
      Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp
  20. 1
    1
      Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp
  21. 3
    3
      Marlin/src/HAL/HAL_DUE/watchdog_Due.h
  22. 19
    25
      Marlin/src/HAL/HAL_LPC1768/HAL.cpp
  23. 1
    1
      Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp
  24. 1
    1
      Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp
  25. 1
    1
      Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp
  26. 21
    21
      Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.h
  27. 1
    1
      Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp
  28. 5
    5
      Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.h
  29. 131
    169
      Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp
  30. 2
    6
      Marlin/src/HAL/HAL_LPC1768/arduino.cpp
  31. 12
    14
      Marlin/src/HAL/HAL_LPC1768/arduino.h
  32. 1
    1
      Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py
  33. 9
    13
      Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp
  34. 2
    2
      Marlin/src/HAL/HAL_LPC1768/pinmapping.h
  35. 1
    1
      Marlin/src/HAL/HAL_LPC1768/pinsDebug_Re_ARM.h
  36. 4
    6
      Marlin/src/HAL/HAL_LPC1768/servo_private.h
  37. 1
    1
      Marlin/src/HAL/HAL_LPC1768/watchdog.cpp
  38. 1
    1
      Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp
  39. 6
    4
      Marlin/src/HAL/HAL_TEENSY35_36/HAL_Teensy.h
  40. 1
    1
      Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp
  41. 0
    1
      Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h
  42. 7
    10
      Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp
  43. 1
    1
      Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp
  44. 5
    5
      Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.h
  45. 0
    2
      Marlin/src/HAL/HAL_spi_pins.h
  46. 1
    1
      Marlin/src/HAL/I2cEeprom.cpp
  47. 1
    1
      Marlin/src/HAL/SpiEeprom.cpp
  48. 1
    1
      Marlin/src/HAL/math_32bit.h
  49. 3
    4
      Marlin/src/HAL/persistent_store_api.h
  50. 1
    1
      Marlin/src/HAL/servo.cpp
  51. 1
    1
      Marlin/src/HAL/servo.h
  52. 5
    6
      Marlin/src/HAL/servo_private.h

+ 1
- 1
Marlin/frameworks/CMSIS/LPC1768/driver/lpc17xx_emac.c View File

@@ -497,7 +497,7 @@ int32_t EMAC_SetPHYMode(uint32_t ulPHYMode)
497 497
 #endif
498 498
 			/* Wait to complete Auto_Negotiation */
499 499
 			for (tout = EMAC_PHY_RESP_TOUT; tout>=0; tout--) {
500
-				
500
+
501 501
 			}
502 502
 			break;
503 503
 		case EMAC_MODE_10M_FULL:

+ 36
- 36
Marlin/frameworks/CMSIS/LPC1768/lib/LiquidCrystal.cpp View File

@@ -3,22 +3,22 @@
3 3
 #include <stdio.h>
4 4
 #include <string.h>
5 5
 #include <inttypes.h>
6
-#include "../../../../src/HAL/HAL_LPC1768/arduino.h"
6
+#include <HAL_LPC1768/arduino.h>
7 7
 
8 8
 // When the display powers up, it is configured as follows:
9 9
 //
10 10
 // 1. Display clear
11
-// 2. Function set: 
12
-//    DL = 1; 8-bit interface data 
13
-//    N = 0; 1-line display 
14
-//    F = 0; 5x8 dot character font 
15
-// 3. Display on/off control: 
16
-//    D = 0; Display off 
17
-//    C = 0; Cursor off 
18
-//    B = 0; Blinking off 
19
-// 4. Entry mode set: 
20
-//    I/D = 1; Increment by 1 
21
-//    S = 0; No shift 
11
+// 2. Function set:
12
+//    DL = 1; 8-bit interface data
13
+//    N = 0; 1-line display
14
+//    F = 0; 5x8 dot character font
15
+// 3. Display on/off control:
16
+//    D = 0; Display off
17
+//    C = 0; Cursor off
18
+//    B = 0; Blinking off
19
+// 4. Entry mode set:
20
+//    I/D = 1; Increment by 1
21
+//    S = 0; No shift
22 22
 //
23 23
 // Note, however, that resetting the Arduino doesn't reset the LCD, so we
24 24
 // can't assume that its in that state when a sketch starts (and the
@@ -57,22 +57,22 @@ void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t en
57 57
   _rs_pin = rs;
58 58
   _rw_pin = rw;
59 59
   _enable_pin = enable;
60
-  
60
+
61 61
   _data_pins[0] = d0;
62 62
   _data_pins[1] = d1;
63 63
   _data_pins[2] = d2;
64
-  _data_pins[3] = d3; 
64
+  _data_pins[3] = d3;
65 65
   _data_pins[4] = d4;
66 66
   _data_pins[5] = d5;
67 67
   _data_pins[6] = d6;
68
-  _data_pins[7] = d7; 
68
+  _data_pins[7] = d7;
69 69
 
70 70
   if (fourbitmode)
71 71
     _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
72
-  else 
72
+  else
73 73
     _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
74
-  
75
-  begin(16, 1);  
74
+
75
+  begin(16, 1);
76 76
 }
77 77
 
78 78
 void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
@@ -81,7 +81,7 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
81 81
   }
82 82
   _numlines = lines;
83 83
 
84
-  setRowOffsets(0x00, 0x40, 0x00 + cols, 0x40 + cols);  
84
+  setRowOffsets(0x00, 0x40, 0x00 + cols, 0x40 + cols);
85 85
 
86 86
   // for some 1 line displays you can select a 10 pixel high font
87 87
   if ((dotsize != LCD_5x8DOTS) && (lines == 1)) {
@@ -90,28 +90,28 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
90 90
 
91 91
   pinMode(_rs_pin, OUTPUT);
92 92
   // we can save 1 pin by not using RW. Indicate by passing 255 instead of pin#
93
-  if (_rw_pin != 255) { 
93
+  if (_rw_pin != 255) {
94 94
     pinMode(_rw_pin, OUTPUT);
95 95
   }
96 96
   pinMode(_enable_pin, OUTPUT);
97
-  
97
+
98 98
   // Do these once, instead of every time a character is drawn for speed reasons.
99 99
   for (int i=0; i<((_displayfunction & LCD_8BITMODE) ? 8 : 4); ++i)
100 100
   {
101 101
     pinMode(_data_pins[i], OUTPUT);
102
-   } 
102
+   }
103 103
 
104 104
   // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
105 105
   // according to datasheet, we need at least 40ms after power rises above 2.7V
106 106
   // before sending commands. Arduino can turn on way before 4.5V so we'll wait 50
107
-  delayMicroseconds(50000); 
107
+  delayMicroseconds(50000);
108 108
   // Now we pull both RS and R/W low to begin commands
109 109
   digitalWrite(_rs_pin, LOW);
110 110
   digitalWrite(_enable_pin, LOW);
111
-  if (_rw_pin != 255) { 
111
+  if (_rw_pin != 255) {
112 112
     digitalWrite(_rw_pin, LOW);
113 113
   }
114
-  
114
+
115 115
   //put the LCD into 4 bit or 8 bit mode
116 116
   if (! (_displayfunction & LCD_8BITMODE)) {
117 117
     // this is according to the hitachi HD44780 datasheet
@@ -124,13 +124,13 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
124 124
     // second try
125 125
     write4bits(0x03);
126 126
     delayMicroseconds(4500); // wait min 4.1ms
127
-    
127
+
128 128
     // third go!
129
-    write4bits(0x03); 
129
+    write4bits(0x03);
130 130
     delayMicroseconds(150);
131 131
 
132 132
     // finally, set to 4-bit interface
133
-    write4bits(0x02); 
133
+    write4bits(0x02);
134 134
   } else {
135 135
     // this is according to the hitachi HD44780 datasheet
136 136
     // page 45 figure 23
@@ -148,10 +148,10 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
148 148
   }
149 149
 
150 150
   // finally, set # lines, font size, etc.
151
-  command(LCD_FUNCTIONSET | _displayfunction);  
151
+  command(LCD_FUNCTIONSET | _displayfunction);
152 152
 
153 153
   // turn the display on with no cursor or blinking default
154
-  _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;  
154
+  _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;
155 155
   display();
156 156
 
157 157
   // clear it off
@@ -194,7 +194,7 @@ void LiquidCrystal::setCursor(uint8_t col, uint8_t row)
194 194
   if ( row >= _numlines ) {
195 195
     row = _numlines - 1;    // we count rows starting w/0
196 196
   }
197
-  
197
+
198 198
   command(LCD_SETDDRAMADDR | (col + _row_offsets[row]));
199 199
 }
200 200
 
@@ -288,12 +288,12 @@ void LiquidCrystal::send(uint8_t value, uint8_t mode) {
288 288
   digitalWrite(_rs_pin, mode);
289 289
 
290 290
   // if there is a RW pin indicated, set it low to Write
291
-  if (_rw_pin != 255) { 
291
+  if (_rw_pin != 255) {
292 292
     digitalWrite(_rw_pin, LOW);
293 293
   }
294
-  
294
+
295 295
   if (_displayfunction & LCD_8BITMODE) {
296
-    write8bits(value); 
296
+    write8bits(value);
297 297
   } else {
298 298
     write4bits(value>>4);
299 299
     write4bits(value);
@@ -302,7 +302,7 @@ void LiquidCrystal::send(uint8_t value, uint8_t mode) {
302 302
 
303 303
 void LiquidCrystal::pulseEnable(void) {
304 304
   digitalWrite(_enable_pin, LOW);
305
-  delayMicroseconds(1);    
305
+  delayMicroseconds(1);
306 306
   digitalWrite(_enable_pin, HIGH);
307 307
   delayMicroseconds(1);    // enable pulse must be >450ns
308 308
   digitalWrite(_enable_pin, LOW);
@@ -321,6 +321,6 @@ void LiquidCrystal::write8bits(uint8_t value) {
321 321
   for (int i = 0; i < 8; i++) {
322 322
     digitalWrite(_data_pins[i], (value >> i) & 0x01);
323 323
   }
324
-  
324
+
325 325
   pulseEnable();
326 326
 }

+ 1
- 1
Marlin/frameworks/CMSIS/LPC1768/lib/Stream.cpp View File

@@ -23,7 +23,7 @@
23 23
  */
24 24
 
25 25
 #include <stdlib.h>
26
-#include "../../../../src/HAL/HAL_LPC1768/arduino.h"
26
+#include <HAL_LPC1768/arduino.h>
27 27
 
28 28
 #include "Stream.h"
29 29
 

+ 2
- 2
Marlin/src/HAL/HAL.h View File

@@ -92,7 +92,7 @@ void spiSendBlock(uint8_t token, const uint8_t* buf);
92 92
   #include "math_32bit.h"
93 93
   #include "HAL_LPC1768/HAL.h"
94 94
 #else
95
-  #error Unsupported Platform!
95
+  #error "Unsupported Platform!"
96 96
 #endif
97 97
 
98
-#endif /* HAL_H_ */
98
+#endif // _HAL_H

+ 2
- 2
Marlin/src/HAL/HAL_AVR/HAL_AVR.cpp View File

@@ -34,7 +34,7 @@
34 34
 // --------------------------------------------------------------------------
35 35
 
36 36
 #include "../HAL.h"
37
-#include "../../../macros.h"
37
+#include "../../core/macros.h"
38 38
 
39 39
 // --------------------------------------------------------------------------
40 40
 // Externals
@@ -75,7 +75,7 @@
75 75
 // --------------------------------------------------------------------------
76 76
 
77 77
 #if ENABLED(SDSUPPORT)
78
-  #include "../../../SdFatUtil.h"
78
+  #include "../../sd/SdFatUtil.h"
79 79
   int freeMemory() { return SdFatUtil::FreeRam(); }
80 80
 #else
81 81
 

+ 3
- 3
Marlin/src/HAL/HAL_AVR/HAL_pinsDebug_AVR.h View File

@@ -56,7 +56,7 @@ bool endstop_monitor_flag = false;
56 56
 #define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
57 57
 #define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
58 58
 
59
-#include "../../../pinsDebug_list.h"
59
+#include "../../pins/pinsDebug_list.h"
60 60
 #line 51
61 61
 
62 62
 // manually add pins that have names that are macros which don't play well with these macros
@@ -107,7 +107,7 @@ const PinInfo pin_array[] PROGMEM = {
107 107
     #endif
108 108
   #endif
109 109
 
110
-  #include "../../../pinsDebug_list.h"
110
+  #include "../../pins/pinsDebug_list.h"
111 111
   #line 102
112 112
 
113 113
 };
@@ -483,7 +483,7 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = f
483 483
         SERIAL_CHAR('.');
484 484
         SERIAL_ECHO_SP(26 + strlen(start_string));  // add padding if not the first instance found
485 485
       }
486
-      name_mem_pointer = (char*)pgm_read_word(&pin_array[x].name);
486
+      name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
487 487
       for (uint8_t y = 0; y < 28; y++) {                   // always print pin name
488 488
         temp_char = pgm_read_byte(name_mem_pointer + y);
489 489
         if (temp_char != 0)

+ 1
- 1
Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp View File

@@ -37,7 +37,7 @@
37 37
 // Includes
38 38
 // --------------------------------------------------------------------------
39 39
 
40
-#include "../../../MarlinConfig.h"
40
+#include "../../inc/MarlinConfig.h"
41 41
 
42 42
 // --------------------------------------------------------------------------
43 43
 // Public Variables

+ 2
- 3
Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp View File

@@ -31,7 +31,7 @@
31 31
 #ifdef ARDUINO_ARCH_AVR
32 32
 
33 33
 #include "MarlinSerial.h"
34
-#include "../../../Marlin.h"
34
+#include "../../Marlin.h"
35 35
 
36 36
 // Disable HardwareSerial.cpp to support chips without a UART (Attiny, etc.)
37 37
 
@@ -47,8 +47,7 @@
47 47
 
48 48
   #if ENABLED(EMERGENCY_PARSER)
49 49
 
50
-    #include "../../../stepper.h"
51
-    #include "../../../language.h"
50
+    #include "../../module/stepper.h"
52 51
 
53 52
     // Currently looking for: M108, M112, M410
54 53
     // If you alter the parser please don't forget to update the capabilities in Conditionals_post.h

+ 1
- 1
Marlin/src/HAL/HAL_AVR/MarlinSerial.h View File

@@ -32,7 +32,7 @@
32 32
 #ifndef MARLINSERIAL_H
33 33
 #define MARLINSERIAL_H
34 34
 
35
-#include "../../../MarlinConfig.h"
35
+#include "../../inc/MarlinConfig.h"
36 36
 
37 37
 #include <WString.h>
38 38
 

+ 2
- 1
Marlin/src/HAL/HAL_AVR/endstop_interrupts.h View File

@@ -38,7 +38,8 @@
38 38
 #ifndef _ENDSTOP_INTERRUPTS_H_
39 39
 #define _ENDSTOP_INTERRUPTS_H_
40 40
 
41
-#include "../../../macros.h"
41
+#include "../../core/macros.h"
42
+#include <stdint.h>
42 43
 
43 44
 /**
44 45
  * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h)

+ 8
- 1
Marlin/src/HAL/HAL_AVR/fastio_AVR.h View File

@@ -30,7 +30,7 @@
30 30
 #define _FASTIO_ARDUINO_H
31 31
 
32 32
 #include <avr/io.h>
33
-#include "../../../macros.h"
33
+#include "../../core/macros.h"
34 34
 
35 35
 #define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__)  || defined(__AVR_AT90USB647__))
36 36
 #define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
@@ -168,6 +168,7 @@ typedef enum {
168 168
 } ClockSource2;
169 169
 
170 170
 // Get interrupt bits in an orderly way
171
+// Ex: cs = GET_CS(0); coma1 = GET_COM(A,1);
171 172
 #define GET_WGM(T)   (((TCCR##T##A >> WGM##T##0) & 0x3) | ((TCCR##T##B >> WGM##T##2 << 2) & 0xC))
172 173
 #define GET_CS(T)    ((TCCR##T##B >> CS##T##0) & 0x7)
173 174
 #define GET_COM(T,Q) ((TCCR##T##Q >> COM##T##Q##0) & 0x3)
@@ -182,6 +183,7 @@ typedef enum {
182 183
 #define GET_FOCC(T)  GET_FOC(T,C)
183 184
 
184 185
 // Set Wave Generation Mode bits
186
+// Ex: SET_WGM(5,CTC_ICRn);
185 187
 #define _SET_WGM(T,V) do{ \
186 188
     TCCR##T##A = (TCCR##T##A & ~(0x3 << WGM##T##0)) | (( int(V)       & 0x3) << WGM##T##0); \
187 189
     TCCR##T##B = (TCCR##T##B & ~(0x3 << WGM##T##2)) | (((int(V) >> 2) & 0x3) << WGM##T##2); \
@@ -189,6 +191,7 @@ typedef enum {
189 191
 #define SET_WGM(T,V) _SET_WGM(T,WGM_##V)
190 192
 
191 193
 // Set Clock Select bits
194
+// Ex: SET_CS3(PRESCALER_64);
192 195
 #define _SET_CS(T,V) (TCCR##T##B = (TCCR##T##B & ~(0x7 << CS##T##0)) | ((int(V) & 0x7) << CS##T##0))
193 196
 #define _SET_CS0(V) _SET_CS(0,V)
194 197
 #define _SET_CS1(V) _SET_CS(1,V)
@@ -213,6 +216,7 @@ typedef enum {
213 216
 #define SET_CS(T,V) SET_CS##T(V)
214 217
 
215 218
 // Set Compare Mode bits
219
+// Ex: SET_COMS(4,CLEAR_SET,CLEAR_SET,CLEAR_SET);
216 220
 #define _SET_COM(T,Q,V) (TCCR##T##Q = (TCCR##T##Q & ~(0x3 << COM##T##Q##0)) | (int(V) << COM##T##Q##0))
217 221
 #define SET_COM(T,Q,V) _SET_COM(T,Q,COM_##V)
218 222
 #define SET_COMA(T,V) SET_COM(T,A,V)
@@ -221,12 +225,15 @@ typedef enum {
221 225
 #define SET_COMS(T,V1,V2,V3) do{ SET_COMA(T,V1); SET_COMB(T,V2); SET_COMC(T,V3); }while(0)
222 226
 
223 227
 // Set Noise Canceler bit
228
+// Ex: SET_ICNC(2,1)
224 229
 #define SET_ICNC(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICNC##T) : TCCR##T##B & ~_BV(ICNC##T))
225 230
 
226 231
 // Set Input Capture Edge Select bit
232
+// Ex: SET_ICES(5,0)
227 233
 #define SET_ICES(T,V) (TCCR##T##B = (V) ? TCCR##T##B | _BV(ICES##T) : TCCR##T##B & ~_BV(ICES##T))
228 234
 
229 235
 // Set Force Output Compare bit
236
+// Ex: SET_FOC(3,A,1)
230 237
 #define SET_FOC(T,Q,V) (TCCR##T##C = (V) ? TCCR##T##C | _BV(FOC##T##Q) : TCCR##T##C & ~_BV(FOC##T##Q))
231 238
 #define SET_FOCA(T,V) SET_FOC(T,A,V)
232 239
 #define SET_FOCB(T,V) SET_FOC(T,B,V)

+ 1
- 4
Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp View File

@@ -2,10 +2,7 @@
2 2
 
3 3
 #include "../persistent_store_api.h"
4 4
 
5
-#include "../../../types.h"
6
-#include "../../../language.h"
7
-#include "../../../serial.h"
8
-#include "../../../utility.h"
5
+#include "../../inc/MarlinConfig.h"
9 6
 
10 7
 #if ENABLED(EEPROM_SETTINGS)
11 8
 

+ 7
- 3
Marlin/src/HAL/HAL_AVR/pinsDebug_AVR_8_bit.h View File

@@ -54,13 +54,13 @@
54 54
   #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
55 55
 #endif
56 56
 
57
-#define VALID_PIN(pin)) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
57
+#define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
58 58
 #define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
59 59
 #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7)))
60 60
 #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
61 61
 
62 62
 void PRINT_ARRAY_NAME(uint8_t x) {
63
-  char *name_mem_pointer = (char*)pgm_read_word(&pin_array[x].name);
63
+  char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
64 64
   for (uint8_t y = 0; y < MAX_NAME_LENGTH; y++) {
65 65
     char temp_char = pgm_read_byte(name_mem_pointer + y);
66 66
     if (temp_char != 0)
@@ -362,7 +362,8 @@ static void pwm_details(uint8_t pin) {
362 362
   }
363 363
 #endif
364 364
 
365
-#ifndef PRINT_PORT(p)
365
+#ifndef PRINT_PORT
366
+
366 367
   void print_port(int8_t pin) {   // print port number
367 368
     #ifdef digitalPinToPort_DEBUG
368 369
       uint8_t x;
@@ -394,4 +395,7 @@ static void pwm_details(uint8_t pin) {
394 395
   }
395 396
   
396 397
   #define PRINT_PORT(p) print_port(p)
398
+
397 399
 #endif
400
+
401
+#define GET_PIN_INFO(pin) do{}while(0)

+ 1
- 1
Marlin/src/HAL/HAL_AVR/servo_AVR.cpp View File

@@ -53,7 +53,7 @@
53 53
 
54 54
 #ifdef ARDUINO_ARCH_AVR
55 55
 
56
-#include "../../../MarlinConfig.h"
56
+#include "../../inc/MarlinConfig.h"
57 57
 
58 58
 #if HAS_SERVOS
59 59
 

+ 2
- 2
Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp View File

@@ -22,13 +22,13 @@
22 22
 
23 23
 #ifdef ARDUINO_ARCH_AVR
24 24
 
25
-#include "../../../MarlinConfig.h"
25
+#include "../../inc/MarlinConfig.h"
26 26
 
27 27
 #if ENABLED(USE_WATCHDOG)
28 28
 
29 29
 #include "watchdog_AVR.h"
30 30
 
31
-#include "../../../Marlin.h"
31
+#include "../../Marlin.h"
32 32
 
33 33
 // Initialize watchdog with a 4 sec interrupt time
34 34
 void watchdog_init() {

+ 7
- 1
Marlin/src/HAL/HAL_DUE/HAL_Due.h View File

@@ -74,9 +74,15 @@
74 74
   #define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
75 75
 #endif
76 76
 
77
+#ifndef vsnprintf_P
78
+  #define vsnprintf_P vsnprintf
79
+#endif
80
+
77 81
 // Fix bug in pgm_read_ptr
78 82
 #undef pgm_read_ptr
79
-#define pgm_read_ptr(addr) (*(addr))
83
+#define pgm_read_ptr(addr) (*((void**)(addr)))
84
+#undef pgm_read_word
85
+#define pgm_read_word(addr) (*((uint16_t*)(addr)))
80 86
 
81 87
 #define RST_POWER_ON   1
82 88
 #define RST_EXTERNAL   2

+ 1
- 1
Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp View File

@@ -37,7 +37,7 @@
37 37
 // Includes
38 38
 // --------------------------------------------------------------------------
39 39
 
40
-#include "../../../MarlinConfig.h"
40
+#include "../../inc/MarlinConfig.h"
41 41
 
42 42
 // --------------------------------------------------------------------------
43 43
 // Public Variables

+ 1
- 1
Marlin/src/HAL/HAL_DUE/Servo_Due.cpp View File

@@ -40,7 +40,7 @@
40 40
 
41 41
 #ifdef ARDUINO_ARCH_SAM
42 42
 
43
-#include "../../../MarlinConfig.h"
43
+#include "../../inc/MarlinConfig.h"
44 44
 
45 45
 #if HAS_SERVOS
46 46
 

+ 1
- 4
Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp View File

@@ -2,10 +2,7 @@
2 2
 
3 3
 #include "../persistent_store_api.h"
4 4
 
5
-#include "../../../types.h"
6
-#include "../../../language.h"
7
-#include "../../../serial.h"
8
-#include "../../../utility.h"
5
+#include "../../inc/MarlinConfig.h"
9 6
 
10 7
 #if ENABLED(EEPROM_SETTINGS)
11 8
 

+ 1
- 1
Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #ifdef ARDUINO_ARCH_SAM
24 24
  
25
-#include "../../../MarlinConfig.h"
25
+#include "../../inc/MarlinConfig.h"
26 26
 
27 27
 #if ENABLED(USE_WATCHDOG)
28 28
 

+ 3
- 3
Marlin/src/HAL/HAL_DUE/watchdog_Due.h View File

@@ -23,10 +23,10 @@
23 23
 #ifndef WATCHDOG_DUE_H
24 24
 #define WATCHDOG_DUE_H
25 25
 
26
-//#include "../../../Marlin.h"
27
-
28 26
 // Arduino Due core now has watchdog support
29 27
 
28
+#include "../HAL.h"
29
+
30 30
 // Initialize watchdog with a 4 second interrupt time
31 31
 void watchdog_init();
32 32
 
@@ -34,4 +34,4 @@ void watchdog_init();
34 34
 // first watchdog_init or AVR will go into emergency procedures.
35 35
 inline void watchdog_reset() { watchdogReset(); }
36 36
 
37
-#endif /* WATCHDOG_DUE_H */
37
+#endif // WATCHDOG_DUE_H

+ 19
- 25
Marlin/src/HAL/HAL_LPC1768/HAL.cpp View File

@@ -18,16 +18,13 @@
18 18
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 19
 ****************************************************************************/
20 20
 
21
-
22
-/**
23
- *
24
- * For TARGET_LPC1768
25
- */
26
-
27 21
 #ifdef TARGET_LPC1768
28
-#include "../../../macros.h"
22
+
23
+#include "../../core/macros.h"
29 24
 #include "../HAL.h"
30 25
 
26
+#include <stdint.h>
27
+
31 28
 extern "C" {
32 29
   //#include <lpc17xx_adc.h>
33 30
   //#include <lpc17xx_pinsel.h>
@@ -51,7 +48,7 @@ extern "C" void u8g_Delay(uint16_t val) {
51 48
 //************************//
52 49
 
53 50
 // return free heap space
54
-int freeMemory(){
51
+int freeMemory() {
55 52
   char stack_end;
56 53
   void *heap_start = malloc(sizeof(uint32_t));
57 54
   if (heap_start == 0) return 0;
@@ -82,22 +79,22 @@ void HAL_adc_init(void) {
82 79
 }
83 80
 
84 81
 // externals need to make the call to KILL compile
85
-#include "../../../language.h"
82
+#include "../../core/language.h"
86 83
 
87 84
 extern void kill(const char*);
88 85
 extern const char errormagic[];
89 86
 
90 87
 void HAL_adc_enable_channel(int pin) {
91
-  if (pin < 0 || pin >= NUM_ANALOG_INPUTS)  {
88
+  if (!WITHIN(pin, 0, NUM_ANALOG_INPUTS - 1)) {
92 89
     usb_serial.printf("%sINVALID ANALOG PORT:%d\n", errormagic, pin);
93 90
     kill(MSG_KILLED);
94 91
   }
95 92
 
96
-  int8_t pin_port = adc_pin_map[pin].port;
97
-  int8_t pin_port_pin = adc_pin_map[pin].pin;
98
-  int8_t pinsel_start_bit = pin_port_pin > 15 ? 2 * (pin_port_pin - 16) : 2 * pin_port_pin;
93
+  int8_t pin_port = adc_pin_map[pin].port,
94
+         pin_port_pin = adc_pin_map[pin].pin,
95
+         pinsel_start_bit = pin_port_pin > 15 ? 2 * (pin_port_pin - 16) : 2 * pin_port_pin;
99 96
   uint8_t pin_sel_register = (pin_port == 0 && pin_port_pin <= 15) ? 0 :
100
-                             (pin_port == 0)                       ? 1 :
97
+                              pin_port == 0                        ? 1 :
101 98
                               pin_port == 1                        ? 3 : 10;
102 99
 
103 100
   switch (pin_sel_register) {
@@ -117,24 +114,21 @@ void HAL_adc_enable_channel(int pin) {
117 114
 }
118 115
 
119 116
 void HAL_adc_start_conversion(uint8_t adc_pin) {
120
-  if(  (adc_pin >= NUM_ANALOG_INPUTS) || (adc_pin_map[adc_pin].port == 0xFF) ) {
121
-    usb_serial.printf("HAL: HAL_adc_start_conversion: no pinmap for %d\n",adc_pin);
117
+  if (adc_pin >= (NUM_ANALOG_INPUTS) || adc_pin_map[adc_pin].port == 0xFF) {
118
+    usb_serial.printf("HAL: HAL_adc_start_conversion: no pinmap for %d\n", adc_pin);
122 119
     return;
123 120
   }
124
-  LPC_ADC->ADCR &= ~0xFF;                                // Reset
125
-  LPC_ADC->ADCR |= ( 0x01 << adc_pin_map[adc_pin].adc ); // Select Channel
126
-  LPC_ADC->ADCR |= ( 0x01 << 24 );                       // start conversion
121
+  LPC_ADC->ADCR &= ~0xFF;                       // Reset
122
+  SBI(LPC_ADC->ADCR, adc_pin_map[adc_pin].adc); // Select Channel
123
+  SBI(LPC_ADC->ADCR, 24);                       // Start conversion
127 124
 }
128 125
 
129
-bool HAL_adc_finished(void) {
130
-  return LPC_ADC->ADGDR & ADC_DONE;
131
-}
126
+bool HAL_adc_finished(void) { return LPC_ADC->ADGDR & ADC_DONE; }
132 127
 
133 128
 uint16_t HAL_adc_get_result(void) {
134 129
   uint32_t data = LPC_ADC->ADGDR;
135
-  LPC_ADC->ADCR &= ~(1 << 24); //stop conversion
136
-  if ( data & ADC_OVERRUN ) return 0;
137
-  return ((data >> 6) & 0x3ff); //10bit
130
+  CBI(LPC_ADC->ADCR, 24);                       // Stop conversion
131
+  return (data & ADC_OVERRUN) ? 0 : (data >> 6) & 0x3FF; // 10bit
138 132
 }
139 133
 
140 134
 #define SBIT_CNTEN     0

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp View File

@@ -36,7 +36,7 @@
36 36
 // Includes
37 37
 // --------------------------------------------------------------------------
38 38
 
39
-#include "../../../MarlinConfig.h"
39
+#include "../../inc/MarlinConfig.h"
40 40
 
41 41
 // --------------------------------------------------------------------------
42 42
 // Public Variables

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/HardwareSerial.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #ifdef TARGET_LPC1768
24 24
 
25
-#include "../../../macros.h"
25
+#include "../../core/macros.h"
26 26
 #include "../HAL.h"
27 27
 #include "HardwareSerial.h"
28 28
 #define UART3 3

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp View File

@@ -60,7 +60,7 @@
60 60
  * unless DEACTIVATE_SERVOS_AFTER_MOVE is enabled and a MOVE command was issued.
61 61
  */
62 62
 
63
-#include "../../../MarlinConfig.h"
63
+#include "../../inc/MarlinConfig.h"
64 64
 
65 65
 #if HAS_SERVOS && defined(TARGET_LPC1768)
66 66
 

+ 21
- 21
Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.h View File

@@ -34,29 +34,29 @@
34 34
 #ifndef LPC1768_SERVO_H
35 35
 #define LPC1768_SERVO_H
36 36
 
37
-#include <inttypes.h>
37
+#include <stdint.h>
38 38
 
39
-class Servo {
40
-  public:
41
-    Servo();
42
-    int8_t attach(int pin);            // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail)
43
-    int8_t attach(int pin, int min, int max); // as above but also sets min and max values for writes.
44
-    void detach();
45
-    void write(int value);             // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds
46
-    void writeMicroseconds(int value); // write pulse width in microseconds
47
-    void move(int value);              // attach the servo, then move to value
48
-                                       // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds
49
-                                       // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach
50
-    int read();                        // returns current pulse width as an angle between 0 and 180 degrees
51
-    int readMicroseconds();            // returns current pulse width in microseconds for this servo (was read_us() in first release)
52
-    bool attached();                   // return true if this servo is attached, otherwise false
39
+  class Servo {
40
+    public:
41
+      Servo();
42
+      int8_t attach(int pin);            // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail)
43
+      int8_t attach(int pin, int min, int max); // as above but also sets min and max values for writes.
44
+      void detach();
45
+      void write(int value);             // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds
46
+      void writeMicroseconds(int value); // write pulse width in microseconds
47
+      void move(int value);              // attach the servo, then move to value
48
+                                         // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds
49
+                                         // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach
50
+      int read();                        // returns current pulse width as an angle between 0 and 180 degrees
51
+      int readMicroseconds();            // returns current pulse width in microseconds for this servo (was read_us() in first release)
52
+      bool attached();                   // return true if this servo is attached, otherwise false
53 53
 
54
-  private:
55
-    uint8_t servoIndex;               // index into the channel data for this servo
56
-    int min;
57
-    int max;
58
-};
54
+    private:
55
+      uint8_t servoIndex;               // index into the channel data for this servo
56
+      int min;
57
+      int max;
58
+  };
59 59
 
60
-#define HAL_SERVO_LIB Servo
60
+  #define HAL_SERVO_LIB Servo
61 61
 
62 62
 #endif // LPC1768_SERVO_H

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp View File

@@ -35,7 +35,7 @@ http://arduiniana.org.
35 35
 // Includes
36 36
 //
37 37
 //#include <WInterrupts.h>
38
-#include "../../../macros.h"
38
+#include "../../core/macros.h"
39 39
 #include "../HAL.h"
40 40
 #include <stdint.h>
41 41
 #include <stdarg.h>

+ 5
- 5
Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.h View File

@@ -29,13 +29,13 @@ The latest version of this library can always be found at
29 29
 http://arduiniana.org.
30 30
 */
31 31
 
32
-#ifndef SoftwareSerial_h
33
-#define SoftwareSerial_h
32
+#ifndef SOFTWARESERIAL_H
33
+#define SOFTWARESERIAL_H
34 34
 
35 35
 #include "arduino.h"
36
-#include <inttypes.h>
36
+#include <stdint.h>
37 37
 //#include "serial.h"
38
- #include <Stream.h>
38
+#include <Stream.h>
39 39
 #include <Print.h>
40 40
 
41 41
 /******************************************************************************
@@ -116,4 +116,4 @@ public:
116 116
 #undef abs
117 117
 #undef round
118 118
 
119
-#endif
119
+#endif // SOFTWARESERIAL_H

+ 131
- 169
Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp View File

@@ -18,7 +18,7 @@
18 18
 
19 19
 #ifdef TARGET_LPC1768
20 20
 
21
-#include "../../../macros.h"
21
+#include "../../core/macros.h"
22 22
 #include "../HAL.h"
23 23
 #include "arduino.h"
24 24
 #include "pinmapping.h"
@@ -32,197 +32,159 @@ typedef void (*interruptCB)(void);
32 32
 static interruptCB callbacksP0[GNUM];
33 33
 static interruptCB callbacksP2[GNUM];
34 34
 
35
-	extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
36
-	extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);
35
+extern "C" void GpioEnableInt(const uint32_t port, const uint32_t pin, const uint32_t mode);
36
+extern "C" void GpioDisableInt(const uint32_t port, const uint32_t pin);
37 37
 
38 38
 //void deadloop(void) {}
39 39
 
40 40
 /* Configure PIO interrupt sources */
41 41
 static void __initialize() {
42
-	int i;
43
-	for (i=0; i<GNUM; i++) {
44
-		callbacksP0[i] = 0;
45
-		callbacksP2[i] = 0;
46
-		}
47
-NVIC_EnableIRQ(EINT3_IRQn);
42
+  for (uint8_t i = 0; i < GNUM; i++) {
43
+    callbacksP0[i] = 0;
44
+    callbacksP2[i] = 0;
45
+  }
46
+  NVIC_EnableIRQ(EINT3_IRQn);
48 47
 }
49 48
 
50
-void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode)
51
-{
52
-	static int enabled = 0;
53
-
54
-	if(!INTERRUPT_PIN(pin)) return;
55
-
56
-	if (!enabled) {
57
-		__initialize();
58
-		enabled = 1;
59
-	}
60
-	uint8_t myport = pin_map[pin].port;
61
-	uint8_t mypin = pin_map[pin].pin;
49
+void attachInterrupt(const uint32_t pin, void (*callback)(void), uint32_t mode) {
50
+  static int enabled = 0;
62 51
 
52
+  if (!INTERRUPT_PIN(pin)) return;
63 53
 
64
-	if (myport == 0 )
65
-		callbacksP0[mypin] = callback;
66
-	else
67
-		callbacksP2[mypin] = callback;
54
+  if (!enabled) {
55
+    __initialize();
56
+    ++enabled;
57
+  }
58
+  uint8_t myport = pin_map[pin].port,
59
+          mypin = pin_map[pin].pin;
68 60
 
69
-	// Enable interrupt
70
-		GpioEnableInt(myport,mypin,mode);
71
-}
61
+  if (myport == 0)
62
+    callbacksP0[mypin] = callback;
63
+  else
64
+    callbacksP2[mypin] = callback;
72 65
 
73
-void detachInterrupt(uint32_t pin)
74
-{
75
-	if(!INTERRUPT_PIN(pin)) return;
76
-
77
-  uint8_t myport = pin_map[pin].port;
78
-  uint8_t mypin = pin_map[pin].pin;
79
-
80
-	// Disable interrupt
81
-	GpioDisableInt(myport,mypin);
82
-
83
-//unset callback
84
-	if (myport == 0 )
85
-		callbacksP0[mypin] = 0;
86
-	else //if (myport == 2 )
87
-		callbacksP2[mypin] = 0;
88
-	}
89
-
90
-
91
-	extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode) {
92
-	//pin here is the processor pin, not logical pin
93
-	if (port==0) {
94
-		LPC_GPIOINT->IO0IntClr = (1 << pin);
95
-		if (mode ==RISING) {
96
-			LPC_GPIOINT->IO0IntEnR |= (1<<pin);
97
-  		LPC_GPIOINT->IO0IntEnF &= ~(1<<pin);
98
-		}
99
-		else if (mode==FALLING) {
100
-			LPC_GPIOINT->IO0IntEnF |= (1<<pin);
101
-  		LPC_GPIOINT->IO0IntEnR &= ~(1<<pin);
102
-		}
103
-		else if (mode==CHANGE) {
104
-		LPC_GPIOINT->IO0IntEnR |= (1<<pin);
105
-		LPC_GPIOINT->IO0IntEnF |= (1<<pin);
106
-		}
107
-	}
108
-	else{
109
-		LPC_GPIOINT->IO2IntClr = (1 << pin);
110
-		if (mode ==RISING) {
111
-			LPC_GPIOINT->IO2IntEnR |= (1<<pin);
112
-			LPC_GPIOINT->IO2IntEnF &= ~(1<<pin);
113
-		}
114
-		else if (mode==FALLING) {
115
-			LPC_GPIOINT->IO2IntEnF |= (1<<pin);
116
-			LPC_GPIOINT->IO2IntEnR &= ~(1<<pin);
117
-		}
118
-		else if (mode==CHANGE) {
119
-		LPC_GPIOINT->IO2IntEnR |= (1<<pin);
120
-		LPC_GPIOINT->IO2IntEnF |= (1<<pin);
121
-		}
122
-	}
123
-}
124
-extern "C"  void GpioDisableInt(uint32_t port, uint32_t pin)
125
-{
126
-	if (port==0){
127
-		LPC_GPIOINT->IO0IntEnR &= ~(1<<pin);
128
-		LPC_GPIOINT->IO0IntEnF &= ~(1<<pin);
129
-		LPC_GPIOINT->IO0IntClr = 1 << pin;
130
-	}
131
-	else {
132
-		LPC_GPIOINT->IO2IntEnR &= ~(1<<pin);
133
-		LPC_GPIOINT->IO2IntEnF &= ~(1<<pin);
134
-		LPC_GPIOINT->IO2IntClr = 1 << pin;
135
-	}
66
+  // Enable interrupt
67
+  GpioEnableInt(myport,mypin,mode);
136 68
 }
137 69
 
138
-bool isPowerOf2(unsigned int n)
70
+void detachInterrupt(const uint32_t pin) {
71
+  if (!INTERRUPT_PIN(pin)) return;
139 72
 
140
-{
73
+  const uint8_t myport = pin_map[pin].port,
74
+                mypin = pin_map[pin].pin;
141 75
 
142
-    return n == 1 || (n & (n-1)) == 0;
76
+  // Disable interrupt
77
+  GpioDisableInt(myport, mypin);
143 78
 
79
+  // unset callback
80
+  if (myport == 0)
81
+    callbacksP0[mypin] = 0;
82
+  else //if (myport == 2 )
83
+    callbacksP2[mypin] = 0;
144 84
 }
145 85
 
146
-#if 0
147
-extern "C" void EINT3_IRQHandler () {
148
-	LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF;
149
-	TOGGLE(13);
150
-	//NVIC_ClearPendingIRQ(EINT3_IRQn);
151
-}
152
-#else
153
-extern "C" void EINT3_IRQHandler(void)
154
-{
155
-	// Read in all current interrupt registers. We do this once as the
156
-// GPIO interrupt registers are on the APB bus, and this is slow.
157
-uint32_t rise0 = LPC_GPIOINT->IO0IntStatR;
158
-uint32_t fall0 = LPC_GPIOINT->IO0IntStatF;
159
-uint32_t rise2 = LPC_GPIOINT->IO2IntStatR;
160
-uint32_t fall2 = LPC_GPIOINT->IO2IntStatF;
161
-//Clear teh interrupts ASAP
162
-LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF;
163
-NVIC_ClearPendingIRQ(EINT3_IRQn);
164
-uint8_t bitloc;
165
-if (rise0 == 0)
166
-	goto fall0;
167
-	/* multiple pins changes happened.*/
168
-	while(rise0 > 0) {      //Continue as long as there are interrupts pending
169
-			bitloc = 31 - __CLZ(rise0); //CLZ returns number of leading zeros, 31 minus that is location of first pending interrupt
170
-			if (callbacksP0[bitloc]!=0)
171
-				callbacksP0[bitloc]();
172
-			rise0 -= 1<<bitloc;
173
-	}
174
-fall0:
175
-if (fall0==0)
176
-	goto rise2;
177
-/* if (isPowerOf2(fall0) && callbacksP0[31 - __CLZ(rise0)])
178
-  callbacksP0[31 - __CLZ(rise0)](); */
179
-	//LPC_GPIOINT->IO0IntClr = fall0;*/
180
-else {
181
-while(fall0 > 0) {
182
-		bitloc = 31 - __CLZ(fall0);
183
-		if (callbacksP0[bitloc]!=0)
184
-			callbacksP0[bitloc]();
185
-		fall0 -= 1<<bitloc;
86
+
87
+extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode) {
88
+  //pin here is the processor pin, not logical pin
89
+  if (port == 0) {
90
+    LPC_GPIOINT->IO0IntClr = _BV(pin);
91
+    if (mode == RISING) {
92
+      SBI(LPC_GPIOINT->IO0IntEnR, pin);
93
+      CBI(LPC_GPIOINT->IO0IntEnF, pin);
94
+    }
95
+    else if (mode == FALLING) {
96
+      SBI(LPC_GPIOINT->IO0IntEnF, pin);
97
+      CBI(LPC_GPIOINT->IO0IntEnR, pin);
98
+    }
99
+    else if (mode == CHANGE) {
100
+      SBI(LPC_GPIOINT->IO0IntEnR, pin);
101
+      SBI(LPC_GPIOINT->IO0IntEnF, pin);
102
+    }
186 103
   }
187
-}
188
-rise2:
189
-if (rise2==0)
190
-	goto fall2;
191
-/*if ((rise2 & (rise2 - 1)) == 0) {
192
-  callbacksP2[rise2]();
193
-	//LPC_GPIOINT->IO2IntClr = rise2;
194
-}*/
195
-else {
196
-while(rise2 > 0) {
197
-		bitloc = 31 - __CLZ(rise2);
198
-		if (callbacksP2[bitloc]!=0)
199
-			callbacksP2[bitloc]();
200
-		//LPC_GPIOINT->IO2IntClr = 1 << bitloc;
201
-		rise2 -= 1<<bitloc;
104
+  else {
105
+    LPC_GPIOINT->IO2IntClr = _BV(pin);
106
+    if (mode == RISING) {
107
+      SBI(LPC_GPIOINT->IO2IntEnR, pin);
108
+      CBI(LPC_GPIOINT->IO2IntEnF, pin);
109
+    }
110
+    else if (mode == FALLING) {
111
+      SBI(LPC_GPIOINT->IO2IntEnF, pin);
112
+      CBI(LPC_GPIOINT->IO2IntEnR, pin);
113
+    }
114
+    else if (mode == CHANGE) {
115
+      SBI(LPC_GPIOINT->IO2IntEnR, pin);
116
+      SBI(LPC_GPIOINT->IO2IntEnF, pin);
117
+    }
202 118
   }
203 119
 }
204
-fall2:
205
-if (fall2==0)
206
-	goto end;
207
-/*if ((fall2 & (fall2 - 1)) == 0) {
208
-  callbacksP2[fall2]();
209
-	//LPC_GPIOINT->IO2IntClr = fall2;
210
-}*/
211
-else {
212
-while(fall2 > 0) {
213
-		bitloc = 31 - __CLZ(fall2);
214
-		if (callbacksP2[bitloc]!=0)
215
-			callbacksP2[bitloc]();
216
-		//LPC_GPIOINT->IO2IntClr = 1 << bitloc;
217
-		fall2 -= 1<<bitloc;
218
-}
219
-end:
220
-//NVIC_ClearPendingIRQ(EINT3_IRQn);
221
-//LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF;
222
-//NVIC_ClearPendingIRQ(EINT3_IRQn);
223
-return; //silences warning
120
+
121
+extern "C" void GpioDisableInt(const uint32_t port, const uint32_t pin) {
122
+  if (port == 0) {
123
+    CBI(LPC_GPIOINT->IO0IntEnR, pin);
124
+    CBI(LPC_GPIOINT->IO0IntEnF, pin);
125
+    LPC_GPIOINT->IO0IntClr = _BV(pin);
126
+  }
127
+  else {
128
+    CBI(LPC_GPIOINT->IO2IntEnR, pin);
129
+    CBI(LPC_GPIOINT->IO2IntEnF, pin);
130
+    LPC_GPIOINT->IO2IntClr = _BV(pin);
131
+  }
224 132
 }
133
+
134
+bool isPowerOf2(unsigned int n) {
135
+  return n == 1 || (n & (n - 1)) == 0;
225 136
 }
137
+
138
+#if 0
139
+  extern "C" void EINT3_IRQHandler () {
140
+    LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF;
141
+    TOGGLE(13);
142
+    //NVIC_ClearPendingIRQ(EINT3_IRQn);
143
+  }
144
+#else
145
+
146
+  extern "C" void EINT3_IRQHandler(void) {
147
+    // Read in all current interrupt registers. We do this once as the
148
+    // GPIO interrupt registers are on the APB bus, and this is slow.
149
+    uint32_t rise0 = LPC_GPIOINT->IO0IntStatR,
150
+             fall0 = LPC_GPIOINT->IO0IntStatF,
151
+             rise2 = LPC_GPIOINT->IO2IntStatR,
152
+             fall2 = LPC_GPIOINT->IO2IntStatF;
153
+    // Clear the interrupts ASAP
154
+    LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF;
155
+    NVIC_ClearPendingIRQ(EINT3_IRQn);
156
+
157
+    /* multiple pins changes happened.*/
158
+    if (rise0) while (rise0 > 0) {      // Continue as long as there are interrupts pending
159
+      const uint8_t bitloc = 31 - __CLZ(rise0); //CLZ returns number of leading zeros, 31 minus that is location of first pending interrupt
160
+      if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc]();
161
+      rise0 -= _BV(bitloc);
162
+    }
163
+
164
+    if (fall0) while (fall0 > 0) {
165
+      const uint8_t bitloc = 31 - __CLZ(fall0);
166
+      if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc]();
167
+      fall0 -= _BV(bitloc);
168
+    }
169
+
170
+    if (rise2) while(rise2 > 0) {
171
+      const uint8_t bitloc = 31 - __CLZ(rise2);
172
+      if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc]();
173
+      //LPC_GPIOINT->IO2IntClr = 1 << bitloc;
174
+      rise2 -= _BV(bitloc);
175
+    }
176
+
177
+    if (fall2) while (fall2 > 0) {
178
+      const uint8_t bitloc = 31 - __CLZ(fall2);
179
+      if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc]();
180
+      //LPC_GPIOINT->IO2IntClr = 1 << bitloc;
181
+      fall2 -= _BV(bitloc);
182
+    }
183
+    //NVIC_ClearPendingIRQ(EINT3_IRQn);
184
+    //LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF;
185
+    //NVIC_ClearPendingIRQ(EINT3_IRQn);
186
+  }
187
+
226 188
 #endif
227 189
 
228 190
 #endif // TARGET_LPC1768

+ 2
- 6
Marlin/src/HAL/HAL_LPC1768/arduino.cpp View File

@@ -21,19 +21,15 @@
21 21
  */
22 22
 
23 23
 #ifdef TARGET_LPC1768
24
+
24 25
 #include <lpc17xx_pinsel.h>
25 26
 #include "HAL.h"
26
-#include "../../macros.h"
27
+#include "../../core/macros.h"
27 28
 
28 29
 // Interrupts
29 30
 void cli(void) { __disable_irq(); } // Disable
30 31
 void sei(void) { __enable_irq(); }  // Enable
31 32
 
32
-// Program Memory
33
-void serialprintPGM(const char * str){
34
-  usb_serial.print(str);
35
-}
36
-
37 33
 // Time functions
38 34
 void _delay_ms(int delay_ms) {
39 35
   delay (delay_ms);

+ 12
- 14
Marlin/src/HAL/HAL_LPC1768/arduino.h View File

@@ -38,7 +38,7 @@
38 38
 
39 39
 #define _BV(bit) (1 << (bit))
40 40
 
41
-#define E2END 4096 //EEPROM end address
41
+#define E2END 0xFFF // EEPROM end address
42 42
 
43 43
 typedef uint8_t byte;
44 44
 #define PROGMEM
@@ -49,10 +49,10 @@ typedef uint8_t byte;
49 49
 #define max(a,b) ((a)>(b)?(a):(b))
50 50
 #define abs(x) ((x)>0?(x):-(x))
51 51
 #ifndef isnan
52
-#define isnan std::isnan
52
+  #define isnan std::isnan
53 53
 #endif
54 54
 #ifndef isinf
55
-#define isinf std::isinf
55
+  #define isinf std::isinf
56 56
 #endif
57 57
 
58 58
 //not constexpr until c++14
@@ -73,15 +73,15 @@ extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
73 73
 extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);
74 74
 
75 75
 // Program Memory
76
-#define pgm_read_ptr(address_short) (*(address_short))
77
-#define pgm_read_byte_near(address_short) (*address_short)
78
-#define pgm_read_byte(address_short) pgm_read_byte_near(address_short)
79
-#define pgm_read_float_near(address_short) (*address_short)
80
-#define pgm_read_float(address_short) pgm_read_float_near(address_short)
81
-#define pgm_read_word_near(address_short) (*address_short)
82
-#define pgm_read_word(address_short) pgm_read_word_near(address_short)
83
-#define pgm_read_dword_near(address_short) (*address_short)
84
-#define pgm_read_dword(address_short) pgm_read_dword_near(address_short)
76
+#define pgm_read_ptr(addr)        (*((void**)(addr)))
77
+#define pgm_read_byte_near(addr)  (*((uint8_t*)(addr)))
78
+#define pgm_read_float_near(addr) (*((float*)(addr)))
79
+#define pgm_read_word_near(addr)  (*((uint16_t*)(addr)))
80
+#define pgm_read_dword_near(addr) (*((uint32_t*)(addr)))
81
+#define pgm_read_byte(addr)       pgm_read_byte_near(addr)
82
+#define pgm_read_float(addr)      pgm_read_float_near(addr)
83
+#define pgm_read_word(addr)       pgm_read_word_near(addr)
84
+#define pgm_read_dword(addr)      pgm_read_dword_near(addr)
85 85
 
86 86
 #define sprintf_P sprintf
87 87
 #define strstr_P strstr
@@ -90,8 +90,6 @@ extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);
90 90
 #define strcpy_P strcpy
91 91
 #define snprintf_P snprintf
92 92
 
93
-void serialprintPGM(const char *);
94
-
95 93
 // Time functions
96 94
 extern "C" {
97 95
 void delay(int milis);

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py View File

@@ -1,4 +1,4 @@
1
-#dynaomic build flags for generic compile options
1
+#dynamic build flags for generic compile options
2 2
 if __name__ == "__main__":
3 3
   print " ".join([  "-std=gnu11",
4 4
                     "-std=gnu++11",

+ 9
- 13
Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp View File

@@ -1,21 +1,17 @@
1 1
 #ifdef TARGET_LPC1768
2
-#include "../persistent_store_api.h"
3 2
 
4
-#include "../../../types.h"
5
-#include "../../../language.h"
6
-#include "../../../serial.h"
7
-#include "../../../utility.h"
3
+#include "../../inc/MarlinConfig.h"
8 4
 
9
-#include "chanfs/diskio.h"
10
-#include "chanfs/ff.h"
5
+#if ENABLED(EEPROM_SETTINGS)
11 6
 
7
+#include "../persistent_store_api.h"
12 8
 
13
-#if ENABLED(EEPROM_SETTINGS)
9
+#include "chanfs/diskio.h"
10
+#include "chanfs/ff.h"
14 11
 
15 12
 namespace HAL {
16 13
 namespace PersistentStore {
17 14
 
18
-
19 15
 FATFS fat_fs;
20 16
 FIL eeprom_file;
21 17
 
@@ -25,7 +21,7 @@ bool access_start() {
25 21
   return (res == FR_OK);
26 22
 }
27 23
 
28
-bool access_finish(){
24
+bool access_finish() {
29 25
   f_close(&eeprom_file);
30 26
   f_unmount("");
31 27
   return true;
@@ -48,8 +44,8 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) {
48 44
   pos = pos + size;
49 45
 }
50 46
 
51
-}
52
-}
47
+} // PersistentStore
48
+} // HAL
53 49
 
54 50
 #endif // EEPROM_SETTINGS
55
-#endif // ARDUINO_ARCH_AVR
51
+#endif // TARGET_LPC1768

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/pinmapping.h View File

@@ -22,12 +22,12 @@
22 22
 
23 23
 #ifndef __HAL_PINMAPPING_H__
24 24
 #define __HAL_PINMAPPING_H__
25
-#include "../../../macros.h"
25
+#include "../../core/macros.h"
26 26
 
27 27
 struct pin_data { uint8_t port, pin; };
28 28
 struct adc_pin_data { uint8_t port, pin, adc; };
29 29
 
30
-#if defined(IS_REARM)
30
+#if ENABLED(IS_REARM)
31 31
   #include "pinmap_re_arm.h"
32 32
 #else
33 33
   #error "HAL: LPC1768: No defined pin-mapping"

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/pinsDebug_Re_ARM.h View File

@@ -81,4 +81,4 @@ if (pin == 7) return;
81 81
 #define NAME_FORMAT(p) PSTR("%-##p##s")
82 82
 //  #define PRINT_ARRAY_NAME(x)  do {sprintf_P(buffer, NAME_FORMAT(MAX_NAME_LENGTH) , pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
83 83
 #define PRINT_ARRAY_NAME(x)  do {sprintf_P(buffer, PSTR("%-35s") , pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
84
-#define GET_ARRAY_IS_DIGITAL(x)  !pin_Re_ARM_analog
84
+#define GET_ARRAY_IS_DIGITAL(x)  !pin_Re_ARM_analog

+ 4
- 6
Marlin/src/HAL/HAL_LPC1768/servo_private.h View File

@@ -48,11 +48,10 @@
48 48
  */
49 49
 
50 50
 
51
-#ifndef servo_private_h
52
-#define servo_private_h
53
-
54
-#include <inttypes.h>
51
+#ifndef SERVO_PRIVATE_H
52
+#define SERVO_PRIVATE_H
55 53
 
54
+#include <stdint.h>
56 55
 
57 56
 // Macros
58 57
 //values in microseconds
@@ -83,5 +82,4 @@ typedef struct {
83 82
 extern uint8_t ServoCount;
84 83
 extern ServoInfo_t servo_info[MAX_SERVOS];
85 84
 
86
-
87
-#endif
85
+#endif // SERVO_PRIVATE_H

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/watchdog.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #ifdef TARGET_LPC1768
24 24
 
25
-#include "../../../MarlinConfig.h"
25
+#include "../../inc/MarlinConfig.h"
26 26
 
27 27
 #include "lpc17xx_wdt.h"
28 28
 #include "watchdog.h"

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 
4 4
 #include "HAL_Servo_Teensy.h"
5
-#include "../../../MarlinConfig.h"
5
+#include "../../inc/MarlinConfig.h"
6 6
 
7 7
 
8 8
 int8_t libServo::attach(int pin) {

+ 6
- 4
Marlin/src/HAL/HAL_TEENSY35_36/HAL_Teensy.h View File

@@ -30,8 +30,6 @@
30 30
 // Includes
31 31
 // --------------------------------------------------------------------------
32 32
 
33
-#include <stdint.h>
34
-
35 33
 #include "Arduino.h"
36 34
 
37 35
 #include "fastio_Teensy.h"
@@ -39,10 +37,13 @@
39 37
 
40 38
 #include "HAL_timers_Teensy.h"
41 39
 
40
+#include <stdint.h>
41
+
42 42
 // --------------------------------------------------------------------------
43 43
 // Defines
44 44
 // --------------------------------------------------------------------------
45 45
 
46
+#undef MOTHERBOARD
46 47
 #define MOTHERBOARD BOARD_TEENSY35_36
47 48
 
48 49
 #define IS_32BIT_TEENSY (defined(__MK64FX512__) || defined(__MK66FX1M0__))
@@ -79,9 +80,10 @@
79 80
 
80 81
 // Fix bug in pgm_read_ptr
81 82
 #undef pgm_read_ptr
82
-#define pgm_read_ptr(addr) (*(addr))
83
+#define pgm_read_ptr(addr) (*((void**)(addr)))
84
+// Add type-checking to pgm_read_word
83 85
 #undef pgm_read_word
84
-#define pgm_read_word(addr) (*(addr))
86
+#define pgm_read_word(addr) (*((uint16_t*)(addr)))
85 87
 
86 88
 #define RST_POWER_ON   1
87 89
 #define RST_EXTERNAL   2

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp View File

@@ -4,7 +4,7 @@
4 4
 #include <SPI.h>
5 5
 #include <pins_arduino.h>
6 6
 #include "spi_pins.h"
7
-#include "../../../macros.h"
7
+#include "../../core/macros.h"
8 8
 
9 9
 static SPISettings spiConfig;
10 10
 

+ 0
- 1
Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h View File

@@ -25,7 +25,6 @@
25 25
  * Teensy3.6 (__MK66FX1M0__)
26 26
  */
27 27
 
28
-
29 28
 #ifndef _HAL_TIMERS_TEENSY_H
30 29
 #define _HAL_TIMERS_TEENSY_H
31 30
 

+ 7
- 10
Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp View File

@@ -1,14 +1,11 @@
1 1
 #if defined(__MK64FX512__) || defined(__MK66FX1M0__)
2 2
 
3
-#include "../persistent_store_api.h"
4
-
5
-#include "../../../types.h"
6
-#include "../../../language.h"
7
-#include "../../../serial.h"
8
-#include "../../../utility.h"
3
+#include "../../inc/MarlinConfig.h"
9 4
 
10 5
 #if ENABLED(EEPROM_SETTINGS)
11 6
 
7
+#include "../persistent_store_api.h"
8
+
12 9
 namespace HAL {
13 10
 namespace PersistentStore {
14 11
 
@@ -16,7 +13,7 @@ bool access_start() {
16 13
   return true;
17 14
 }
18 15
 
19
-bool access_finish(){
16
+bool access_finish() {
20 17
   return true;
21 18
 }
22 19
 
@@ -51,8 +48,8 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) {
51 48
   } while (--size);
52 49
 }
53 50
 
54
-}
55
-}
51
+} // PersistentStore
52
+} // HAL
56 53
 
57 54
 #endif // EEPROM_SETTINGS
58
-#endif // ARDUINO_ARCH_AVR
55
+#endif // __MK64FX512__ || __MK66FX1M0__

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 #if defined(__MK64FX512__) || defined(__MK66FX1M0__)
24 24
  
25
-  #include "../../../Marlin.h"
25
+  #include "../../Marlin.h"
26 26
 
27 27
   #if ENABLED(USE_WATCHDOG)
28 28
 

+ 5
- 5
Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.h View File

@@ -23,16 +23,16 @@
23 23
 #ifndef WATCHDOG_TEENSY_H
24 24
 #define WATCHDOG_TEENSY_H
25 25
 
26
-//#include "../../../Marlin.h"
26
+#include "../HAL.h"
27 27
 
28 28
 // Arduino Due core now has watchdog support
29 29
 
30 30
 void watchdog_init();
31 31
 
32 32
 inline void watchdog_reset() {
33
-	// Watchdog refresh sequence
34
-	WDOG_REFRESH = 0xA602;
35
-	WDOG_REFRESH = 0xB480;
33
+  // Watchdog refresh sequence
34
+  WDOG_REFRESH = 0xA602;
35
+  WDOG_REFRESH = 0xB480;
36 36
 }
37 37
 
38
-#endif /* WATCHDOG_TEENSY_H */
38
+#endif // WATCHDOG_TEENSY_H

+ 0
- 2
Marlin/src/HAL/HAL_spi_pins.h View File

@@ -23,8 +23,6 @@
23 23
 #ifndef HAL_SPI_PINS_H_
24 24
 #define HAL_SPI_PINS_H_
25 25
 
26
-#include "../../MarlinConfig.h"
27
-
28 26
 #ifdef ARDUINO_ARCH_SAM
29 27
   #include "HAL_DUE/spi_pins.h"
30 28
 

+ 1
- 1
Marlin/src/HAL/I2cEeprom.cpp View File

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

+ 1
- 1
Marlin/src/HAL/SpiEeprom.cpp View File

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

+ 1
- 1
Marlin/src/HAL/math_32bit.h View File

@@ -30,4 +30,4 @@
30 30
 #define MultiU32X32toH32(intRes, longIn1, longIn2) intRes = ((uint64_t)longIn1 * longIn2 + 0x80000000) >> 32
31 31
 #define MultiU32X24toH32(intRes, longIn1, longIn2) intRes = ((uint64_t)longIn1 * longIn2 + 0x00800000) >> 24
32 32
 
33
-#endif
33
+#endif // MATH_32BIT_H

+ 3
- 4
Marlin/src/HAL/persistent_store_api.h View File

@@ -12,8 +12,7 @@ bool access_finish();
12 12
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc);
13 13
 void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) ;
14 14
 
15
-}
16
-}
15
+} // PersistentStore
16
+} // HAL
17 17
 
18
-
19
-#endif /* _PERSISTANT_STORE_H_ */
18
+#endif // _PERSISTENT_STORE_H_

+ 1
- 1
Marlin/src/HAL/servo.cpp View File

@@ -52,7 +52,7 @@
52 52
  */
53 53
 
54 54
 
55
-#include "../../MarlinConfig.h"
55
+#include "../inc/MarlinConfig.h"
56 56
 
57 57
 #include "HAL.h"
58 58
 

+ 1
- 1
Marlin/src/HAL/servo.h View File

@@ -76,7 +76,7 @@
76 76
   #include "HAL_LPC1768/LPC1768_Servo.h"
77 77
 
78 78
 #else
79
-  #include <inttypes.h>
79
+  #include <stdint.h>
80 80
 
81 81
   #if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_SAM)
82 82
     // we're good to go

+ 5
- 6
Marlin/src/HAL/servo_private.h View File

@@ -21,7 +21,7 @@
21 21
  */
22 22
 
23 23
 /**
24
-  servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
24
+  servo_private.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
25 25
   Copyright (c) 2009 Michael Margolis.  All right reserved.
26 26
 
27 27
   This library is free software; you can redistribute it and/or
@@ -39,10 +39,10 @@
39 39
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
40 40
 */
41 41
 
42
-#ifndef servo_private_h
43
-#define servo_private_h
42
+#ifndef SERVO_PRIVATE_H
43
+#define SERVO_PRIVATE_H
44 44
 
45
-#include <inttypes.h>
45
+#include <stdint.h>
46 46
 
47 47
 // Architecture specific include
48 48
 #ifdef ARDUINO_ARCH_AVR
@@ -99,5 +99,4 @@ extern ServoInfo_t servo_info[MAX_SERVOS];
99 99
 extern void initISR(timer16_Sequence_t timer);
100 100
 extern void finISR(timer16_Sequence_t timer);
101 101
 
102
-
103
-#endif
102
+#endif // SERVO_PRIVATE_H

Loading…
Cancel
Save