Browse Source

Drop C-style 'void' argument

Scott Lahteine 5 years ago
parent
commit
f01f0d1956
100 changed files with 596 additions and 596 deletions
  1. 1
    1
      Marlin/src/HAL/HAL_AVR/HAL.cpp
  2. 14
    14
      Marlin/src/HAL/HAL_AVR/HAL.h
  3. 2
    2
      Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp
  4. 7
    7
      Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
  5. 7
    7
      Marlin/src/HAL/HAL_AVR/MarlinSerial.h
  6. 2
    2
      Marlin/src/HAL/HAL_AVR/endstop_interrupts.h
  7. 9
    9
      Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp
  8. 1
    1
      Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp
  9. 7
    7
      Marlin/src/HAL/HAL_DUE/HAL.cpp
  10. 9
    9
      Marlin/src/HAL/HAL_DUE/HAL.h
  11. 1
    1
      Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp
  12. 1
    1
      Marlin/src/HAL/HAL_DUE/InterruptVectors.h
  13. 8
    8
      Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp
  14. 8
    8
      Marlin/src/HAL/HAL_DUE/MarlinSerial.h
  15. 11
    11
      Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp
  16. 6
    6
      Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h
  17. 5
    5
      Marlin/src/HAL/HAL_DUE/Servo.cpp
  18. 2
    2
      Marlin/src/HAL/HAL_DUE/endstop_interrupts.h
  19. 1
    1
      Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
  20. 2
    2
      Marlin/src/HAL/HAL_DUE/usb/compiler.h
  21. 7
    7
      Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c
  22. 3
    3
      Marlin/src/HAL/HAL_DUE/usb/ctrl_access.h
  23. 4
    4
      Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp
  24. 4
    4
      Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h
  25. 2
    2
      Marlin/src/HAL/HAL_DUE/usb/sysclk.c
  26. 2
    2
      Marlin/src/HAL/HAL_DUE/usb/sysclk.h
  27. 26
    26
      Marlin/src/HAL/HAL_DUE/usb/udc.c
  28. 24
    24
      Marlin/src/HAL/HAL_DUE/usb/udc.h
  29. 20
    20
      Marlin/src/HAL/HAL_DUE/usb/udd.h
  30. 5
    5
      Marlin/src/HAL/HAL_DUE/usb/udi.h
  31. 28
    28
      Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c
  32. 16
    16
      Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h
  33. 49
    49
      Marlin/src/HAL/HAL_DUE/usb/udi_msc.c
  34. 10
    10
      Marlin/src/HAL/HAL_DUE/usb/udi_msc.h
  35. 46
    46
      Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c
  36. 2
    2
      Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h
  37. 9
    9
      Marlin/src/HAL/HAL_DUE/usb/usb_task.c
  38. 10
    10
      Marlin/src/HAL/HAL_DUE/usb/usb_task.h
  39. 2
    2
      Marlin/src/HAL/HAL_DUE/watchdog.cpp
  40. 1
    1
      Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h
  41. 5
    5
      Marlin/src/HAL/HAL_ESP32/HAL.cpp
  42. 7
    7
      Marlin/src/HAL/HAL_ESP32/HAL.h
  43. 1
    1
      Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp
  44. 9
    9
      Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp
  45. 9
    9
      Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h
  46. 2
    2
      Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h
  47. 7
    7
      Marlin/src/HAL/HAL_ESP32/timers.h
  48. 2
    2
      Marlin/src/HAL/HAL_ESP32/watchdog.cpp
  49. 6
    6
      Marlin/src/HAL/HAL_LINUX/HAL.cpp
  50. 4
    4
      Marlin/src/HAL/HAL_LINUX/HAL.h
  51. 2
    2
      Marlin/src/HAL/HAL_LINUX/arduino.cpp
  52. 3
    3
      Marlin/src/HAL/HAL_LINUX/include/Arduino.h
  53. 3
    3
      Marlin/src/HAL/HAL_LINUX/include/serial.h
  54. 1
    1
      Marlin/src/HAL/HAL_LINUX/main.cpp
  55. 1
    1
      Marlin/src/HAL/HAL_LINUX/timers.cpp
  56. 4
    4
      Marlin/src/HAL/HAL_LINUX/timers.h
  57. 5
    5
      Marlin/src/HAL/HAL_LINUX/watchdog.cpp
  58. 4
    4
      Marlin/src/HAL/HAL_LINUX/watchdog.h
  59. 9
    9
      Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp
  60. 2
    2
      Marlin/src/HAL/HAL_LPC1768/HAL.cpp
  61. 3
    3
      Marlin/src/HAL/HAL_LPC1768/HAL.h
  62. 4
    4
      Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp
  63. 2
    2
      Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h
  64. 1
    1
      Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c
  65. 1
    1
      Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h
  66. 3
    3
      Marlin/src/HAL/HAL_LPC1768/main.cpp
  67. 1
    1
      Marlin/src/HAL/HAL_LPC1768/timers.cpp
  68. 2
    2
      Marlin/src/HAL/HAL_LPC1768/timers.h
  69. 1
    1
      Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c
  70. 1
    1
      Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h
  71. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h
  72. 1
    1
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction
  73. 7
    7
      Marlin/src/HAL/HAL_LPC1768/watchdog.cpp
  74. 4
    4
      Marlin/src/HAL/HAL_LPC1768/watchdog.h
  75. 6
    6
      Marlin/src/HAL/HAL_SAMD51/HAL.cpp
  76. 7
    7
      Marlin/src/HAL/HAL_SAMD51/HAL.h
  77. 2
    2
      Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp
  78. 2
    2
      Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h
  79. 1
    1
      Marlin/src/HAL/HAL_SAMD51/watchdog.cpp
  80. 4
    4
      Marlin/src/HAL/HAL_STM32/HAL.cpp
  81. 5
    5
      Marlin/src/HAL/HAL_STM32/HAL.h
  82. 2
    2
      Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp
  83. 2
    2
      Marlin/src/HAL/HAL_STM32/endstop_interrupts.h
  84. 10
    10
      Marlin/src/HAL/HAL_STM32F1/HAL.cpp
  85. 7
    7
      Marlin/src/HAL/HAL_STM32F1/HAL.h
  86. 1
    1
      Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp
  87. 2
    2
      Marlin/src/HAL/HAL_STM32F1/SPI.cpp
  88. 5
    5
      Marlin/src/HAL/HAL_STM32F1/SPI.h
  89. 1
    1
      Marlin/src/HAL/HAL_STM32F1/Servo.cpp
  90. 1
    1
      Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp
  91. 2
    2
      Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h
  92. 4
    4
      Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp
  93. 10
    10
      Marlin/src/HAL/HAL_STM32F1/sdio.cpp
  94. 9
    9
      Marlin/src/HAL/HAL_STM32F1/sdio.h
  95. 4
    4
      Marlin/src/HAL/HAL_STM32F1/timers.h
  96. 2
    2
      Marlin/src/HAL/HAL_STM32F1/watchdog.cpp
  97. 5
    5
      Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp
  98. 7
    7
      Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h
  99. 2
    2
      Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp
  100. 0
    0
      Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp

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

35
 // Public functions
35
 // Public functions
36
 // ------------------------
36
 // ------------------------
37
 
37
 
38
-void HAL_init(void) {
38
+void HAL_init() {
39
   // Init Servo Pins
39
   // Init Servo Pins
40
   #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
40
   #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
41
   #if HAS_SERVO_0
41
   #if HAS_SERVO_0

+ 14
- 14
Marlin/src/HAL/HAL_AVR/HAL.h View File

105
 // Public functions
105
 // Public functions
106
 // ------------------------
106
 // ------------------------
107
 
107
 
108
-void HAL_init(void);
108
+void HAL_init();
109
 
109
 
110
-//void cli(void);
110
+//void cli();
111
 
111
 
112
 //void _delay_ms(const int delay);
112
 //void _delay_ms(const int delay);
113
 
113
 
114
-inline void HAL_clear_reset_source(void) { MCUSR = 0; }
115
-inline uint8_t HAL_get_reset_source(void) { return MCUSR; }
114
+inline void HAL_clear_reset_source() { MCUSR = 0; }
115
+inline uint8_t HAL_get_reset_source() { return MCUSR; }
116
 
116
 
117
 #pragma GCC diagnostic push
117
 #pragma GCC diagnostic push
118
 #pragma GCC diagnostic ignored "-Wunused-function"
118
 #pragma GCC diagnostic ignored "-Wunused-function"
119
 extern "C" {
119
 extern "C" {
120
-  int freeMemory(void);
120
+  int freeMemory();
121
 }
121
 }
122
 #pragma GCC diagnostic pop
122
 #pragma GCC diagnostic pop
123
 
123
 
199
 
199
 
200
 /* 18 cycles maximum latency */
200
 /* 18 cycles maximum latency */
201
 #define HAL_STEP_TIMER_ISR() \
201
 #define HAL_STEP_TIMER_ISR() \
202
-extern "C" void TIMER1_COMPA_vect(void) __attribute__ ((signal, naked, used, externally_visible)); \
203
-extern "C" void TIMER1_COMPA_vect_bottom(void) asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
204
-void TIMER1_COMPA_vect(void) { \
202
+extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
203
+extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
204
+void TIMER1_COMPA_vect() { \
205
   __asm__ __volatile__ ( \
205
   __asm__ __volatile__ ( \
206
     A("push r16")                      /* 2 Save R16 */ \
206
     A("push r16")                      /* 2 Save R16 */ \
207
     A("in r16, __SREG__")              /* 1 Get SREG */ \
207
     A("in r16, __SREG__")              /* 1 Get SREG */ \
268
     : \
268
     : \
269
   ); \
269
   ); \
270
 } \
270
 } \
271
-void TIMER1_COMPA_vect_bottom(void)
271
+void TIMER1_COMPA_vect_bottom()
272
 
272
 
273
 /* 14 cycles maximum latency */
273
 /* 14 cycles maximum latency */
274
 #define HAL_TEMP_TIMER_ISR() \
274
 #define HAL_TEMP_TIMER_ISR() \
275
-extern "C" void TIMER0_COMPB_vect(void) __attribute__ ((signal, naked, used, externally_visible)); \
276
-extern "C" void TIMER0_COMPB_vect_bottom(void)  asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
277
-void TIMER0_COMPB_vect(void) { \
275
+extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
276
+extern "C" void TIMER0_COMPB_vect_bottom()  asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
277
+void TIMER0_COMPB_vect() { \
278
   __asm__ __volatile__ ( \
278
   __asm__ __volatile__ ( \
279
     A("push r16")                       /* 2 Save R16 */ \
279
     A("push r16")                       /* 2 Save R16 */ \
280
     A("in r16, __SREG__")               /* 1 Get SREG */ \
280
     A("in r16, __SREG__")               /* 1 Get SREG */ \
334
     : \
334
     : \
335
   ); \
335
   ); \
336
 } \
336
 } \
337
-void TIMER0_COMPB_vect_bottom(void)
337
+void TIMER0_COMPB_vect_bottom()
338
 
338
 
339
 // ADC
339
 // ADC
340
 #ifdef DIDR2
340
 #ifdef DIDR2
343
   #define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0)
343
   #define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0)
344
 #endif
344
 #endif
345
 
345
 
346
-inline void HAL_adc_init(void) {
346
+inline void HAL_adc_init() {
347
   ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07;
347
   ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07;
348
   DIDR0 = 0;
348
   DIDR0 = 0;
349
   #ifdef DIDR2
349
   #ifdef DIDR2

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

33
 
33
 
34
 #include "../../inc/MarlinConfig.h"
34
 #include "../../inc/MarlinConfig.h"
35
 
35
 
36
-void spiBegin(void) {
36
+void spiBegin() {
37
   OUT_WRITE(SS_PIN, HIGH);
37
   OUT_WRITE(SS_PIN, HIGH);
38
   SET_OUTPUT(SCK_PIN);
38
   SET_OUTPUT(SCK_PIN);
39
   SET_INPUT(MISO_PIN);
39
   SET_INPUT(MISO_PIN);
81
   }
81
   }
82
 
82
 
83
   /** SPI receive a byte */
83
   /** SPI receive a byte */
84
-  uint8_t spiRec(void) {
84
+  uint8_t spiRec() {
85
     SPDR = 0xFF;
85
     SPDR = 0xFF;
86
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
86
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
87
     return SPDR;
87
     return SPDR;

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

271
 
271
 
272
   // (called with TX irqs disabled)
272
   // (called with TX irqs disabled)
273
   template<typename Cfg>
273
   template<typename Cfg>
274
-  FORCE_INLINE void MarlinSerial<Cfg>::_tx_udr_empty_irq(void) {
274
+  FORCE_INLINE void MarlinSerial<Cfg>::_tx_udr_empty_irq() {
275
     if (Cfg::TX_SIZE > 0) {
275
     if (Cfg::TX_SIZE > 0) {
276
       // Read positions
276
       // Read positions
277
       uint8_t t = tx_buffer.tail;
277
       uint8_t t = tx_buffer.tail;
363
   }
363
   }
364
 
364
 
365
   template<typename Cfg>
365
   template<typename Cfg>
366
-  int MarlinSerial<Cfg>::peek(void) {
366
+  int MarlinSerial<Cfg>::peek() {
367
     const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
367
     const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
368
     return h == t ? -1 : rx_buffer.buffer[t];
368
     return h == t ? -1 : rx_buffer.buffer[t];
369
   }
369
   }
370
 
370
 
371
   template<typename Cfg>
371
   template<typename Cfg>
372
-  int MarlinSerial<Cfg>::read(void) {
372
+  int MarlinSerial<Cfg>::read() {
373
     const ring_buffer_pos_t h = atomic_read_rx_head();
373
     const ring_buffer_pos_t h = atomic_read_rx_head();
374
 
374
 
375
     // Read the tail. Main thread owns it, so it is safe to directly read it
375
     // Read the tail. Main thread owns it, so it is safe to directly read it
412
   }
412
   }
413
 
413
 
414
   template<typename Cfg>
414
   template<typename Cfg>
415
-  typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available(void) {
415
+  typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available() {
416
     const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
416
     const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
417
     return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
417
     return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
418
   }
418
   }
419
 
419
 
420
   template<typename Cfg>
420
   template<typename Cfg>
421
-  void MarlinSerial<Cfg>::flush(void) {
421
+  void MarlinSerial<Cfg>::flush() {
422
 
422
 
423
     // Set the tail to the head:
423
     // Set the tail to the head:
424
     //  - Read the RX head index in a safe way. (See atomic_read_rx_head.)
424
     //  - Read the RX head index in a safe way. (See atomic_read_rx_head.)
505
   }
505
   }
506
 
506
 
507
   template<typename Cfg>
507
   template<typename Cfg>
508
-  void MarlinSerial<Cfg>::flushTX(void) {
508
+  void MarlinSerial<Cfg>::flushTX() {
509
 
509
 
510
     if (Cfg::TX_SIZE == 0) {
510
     if (Cfg::TX_SIZE == 0) {
511
       // No bytes written, no need to flush. This special case is needed since there's
511
       // No bytes written, no need to flush. This special case is needed since there's
595
   }
595
   }
596
 
596
 
597
   template<typename Cfg>
597
   template<typename Cfg>
598
-  void MarlinSerial<Cfg>::println(void) {
598
+  void MarlinSerial<Cfg>::println() {
599
     print('\r');
599
     print('\r');
600
     print('\n');
600
     print('\n');
601
   }
601
   }

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

205
     public:
205
     public:
206
 
206
 
207
     FORCE_INLINE static void store_rxd_char();
207
     FORCE_INLINE static void store_rxd_char();
208
-    FORCE_INLINE static void _tx_udr_empty_irq(void);
208
+    FORCE_INLINE static void _tx_udr_empty_irq();
209
 
209
 
210
     public:
210
     public:
211
       MarlinSerial() {};
211
       MarlinSerial() {};
212
       static void begin(const long);
212
       static void begin(const long);
213
       static void end();
213
       static void end();
214
-      static int peek(void);
215
-      static int read(void);
216
-      static void flush(void);
217
-      static ring_buffer_pos_t available(void);
214
+      static int peek();
215
+      static int read();
216
+      static void flush();
217
+      static ring_buffer_pos_t available();
218
       static void write(const uint8_t c);
218
       static void write(const uint8_t c);
219
-      static void flushTX(void);
219
+      static void flushTX();
220
 
220
 
221
       FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
221
       FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
222
       FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
222
       FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
245
       static void println(long, int = DEC);
245
       static void println(long, int = DEC);
246
       static void println(unsigned long, int = DEC);
246
       static void println(unsigned long, int = DEC);
247
       static void println(double, int = 2);
247
       static void println(double, int = 2);
248
-      static void println(void);
248
+      static void println();
249
       operator bool() { return true; }
249
       operator bool() { return true; }
250
 
250
 
251
     private:
251
     private:

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

41
 #include <stdint.h>
41
 #include <stdint.h>
42
 
42
 
43
 // One ISR for all EXT-Interrupts
43
 // One ISR for all EXT-Interrupts
44
-void endstop_ISR(void) { endstops.update(); }
44
+void endstop_ISR() { endstops.update(); }
45
 
45
 
46
 /**
46
 /**
47
  * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h)
47
  * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h)
102
   ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect));
102
   ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect));
103
 #endif
103
 #endif
104
 
104
 
105
-void setup_endstop_interrupts(void) {
105
+void setup_endstop_interrupts() {
106
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
106
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
107
   #if HAS_X_MAX
107
   #if HAS_X_MAX
108
     #if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT)
108
     #if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT)

+ 9
- 9
Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp View File

42
 #define sw_barrier() __asm__ volatile("": : :"memory");
42
 #define sw_barrier() __asm__ volatile("": : :"memory");
43
 
43
 
44
 // (re)initialize UART0 as a monitor output to 250000,n,8,1
44
 // (re)initialize UART0 as a monitor output to 250000,n,8,1
45
-static void TXBegin(void) {
45
+static void TXBegin() {
46
 
46
 
47
   // Disable UART interrupt in NVIC
47
   // Disable UART interrupt in NVIC
48
   NVIC_DisableIRQ( UART_IRQn );
48
   NVIC_DisableIRQ( UART_IRQn );
235
   for (;;) WDT_Restart(WDT);
235
   for (;;) WDT_Restart(WDT);
236
 }
236
 }
237
 
237
 
238
-__attribute__((naked)) void NMI_Handler(void) {
238
+__attribute__((naked)) void NMI_Handler() {
239
   __asm__ __volatile__ (
239
   __asm__ __volatile__ (
240
     ".syntax unified" "\n\t"
240
     ".syntax unified" "\n\t"
241
     A("tst lr, #4")
241
     A("tst lr, #4")
248
   );
248
   );
249
 }
249
 }
250
 
250
 
251
-__attribute__((naked)) void HardFault_Handler(void) {
251
+__attribute__((naked)) void HardFault_Handler() {
252
   __asm__ __volatile__ (
252
   __asm__ __volatile__ (
253
     ".syntax unified" "\n\t"
253
     ".syntax unified" "\n\t"
254
     A("tst lr, #4")
254
     A("tst lr, #4")
261
   );
261
   );
262
 }
262
 }
263
 
263
 
264
-__attribute__((naked)) void MemManage_Handler(void) {
264
+__attribute__((naked)) void MemManage_Handler() {
265
   __asm__ __volatile__ (
265
   __asm__ __volatile__ (
266
     ".syntax unified" "\n\t"
266
     ".syntax unified" "\n\t"
267
     A("tst lr, #4")
267
     A("tst lr, #4")
274
   );
274
   );
275
 }
275
 }
276
 
276
 
277
-__attribute__((naked)) void BusFault_Handler(void) {
277
+__attribute__((naked)) void BusFault_Handler() {
278
   __asm__ __volatile__ (
278
   __asm__ __volatile__ (
279
     ".syntax unified" "\n\t"
279
     ".syntax unified" "\n\t"
280
     A("tst lr, #4")
280
     A("tst lr, #4")
287
   );
287
   );
288
 }
288
 }
289
 
289
 
290
-__attribute__((naked)) void UsageFault_Handler(void) {
290
+__attribute__((naked)) void UsageFault_Handler() {
291
   __asm__ __volatile__ (
291
   __asm__ __volatile__ (
292
     ".syntax unified" "\n\t"
292
     ".syntax unified" "\n\t"
293
     A("tst lr, #4")
293
     A("tst lr, #4")
300
   );
300
   );
301
 }
301
 }
302
 
302
 
303
-__attribute__((naked)) void DebugMon_Handler(void) {
303
+__attribute__((naked)) void DebugMon_Handler() {
304
   __asm__ __volatile__ (
304
   __asm__ __volatile__ (
305
     ".syntax unified" "\n\t"
305
     ".syntax unified" "\n\t"
306
     A("tst lr, #4")
306
     A("tst lr, #4")
314
 }
314
 }
315
 
315
 
316
 /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
316
 /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
317
-__attribute__((naked)) void WDT_Handler(void) {
317
+__attribute__((naked)) void WDT_Handler() {
318
   __asm__ __volatile__ (
318
   __asm__ __volatile__ (
319
     ".syntax unified" "\n\t"
319
     ".syntax unified" "\n\t"
320
     A("tst lr, #4")
320
     A("tst lr, #4")
327
   );
327
   );
328
 }
328
 }
329
 
329
 
330
-__attribute__((naked)) void RSTC_Handler(void) {
330
+__attribute__((naked)) void RSTC_Handler() {
331
   __asm__ __volatile__ (
331
   __asm__ __volatile__ (
332
     ".syntax unified" "\n\t"
332
     ".syntax unified" "\n\t"
333
     A("tst lr, #4")
333
     A("tst lr, #4")

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

993
   }
993
   }
994
 }
994
 }
995
 
995
 
996
-void eeprom_flush(void) {
996
+void eeprom_flush() {
997
   ee_Flush();
997
   ee_Flush();
998
 }
998
 }
999
 
999
 

+ 7
- 7
Marlin/src/HAL/HAL_DUE/HAL.cpp View File

42
 // ------------------------
42
 // ------------------------
43
 
43
 
44
 // HAL initialization task
44
 // HAL initialization task
45
-void HAL_init(void) {
45
+void HAL_init() {
46
   // Initialize the USB stack
46
   // Initialize the USB stack
47
   #if ENABLED(SDSUPPORT)
47
   #if ENABLED(SDSUPPORT)
48
     OUT_WRITE(SDSS, HIGH);  // Try to set SDSS inactive before any other SPI users start up
48
     OUT_WRITE(SDSS, HIGH);  // Try to set SDSS inactive before any other SPI users start up
51
 }
51
 }
52
 
52
 
53
 // HAL idle task
53
 // HAL idle task
54
-void HAL_idletask(void) {
54
+void HAL_idletask() {
55
   // Perform USB stack housekeeping
55
   // Perform USB stack housekeeping
56
   usb_task_idle();
56
   usb_task_idle();
57
 }
57
 }
58
 
58
 
59
 // Disable interrupts
59
 // Disable interrupts
60
-void cli(void) { noInterrupts(); }
60
+void cli() { noInterrupts(); }
61
 
61
 
62
 // Enable interrupts
62
 // Enable interrupts
63
-void sei(void) { interrupts(); }
63
+void sei() { interrupts(); }
64
 
64
 
65
-void HAL_clear_reset_source(void) { }
65
+void HAL_clear_reset_source() { }
66
 
66
 
67
-uint8_t HAL_get_reset_source(void) {
67
+uint8_t HAL_get_reset_source() {
68
   switch ((RSTC->RSTC_SR >> 8) & 0x07) {
68
   switch ((RSTC->RSTC_SR >> 8) & 0x07) {
69
     case 0: return RST_POWER_ON;
69
     case 0: return RST_POWER_ON;
70
     case 1: return RST_BACKUP;
70
     case 1: return RST_BACKUP;
98
   HAL_adc_result = analogRead(adc_pin);
98
   HAL_adc_result = analogRead(adc_pin);
99
 }
99
 }
100
 
100
 
101
-uint16_t HAL_adc_get_result(void) {
101
+uint16_t HAL_adc_get_result() {
102
   // nop
102
   // nop
103
   return HAL_adc_result;
103
   return HAL_adc_result;
104
 }
104
 }

+ 9
- 9
Marlin/src/HAL/HAL_DUE/HAL.h View File

88
 #define ENABLE_ISRS()  __enable_irq()
88
 #define ENABLE_ISRS()  __enable_irq()
89
 #define DISABLE_ISRS() __disable_irq()
89
 #define DISABLE_ISRS() __disable_irq()
90
 
90
 
91
-void cli(void);                     // Disable interrupts
92
-void sei(void);                     // Enable interrupts
91
+void cli();                     // Disable interrupts
92
+void sei();                     // Enable interrupts
93
 
93
 
94
-void HAL_clear_reset_source(void);  // clear reset reason
95
-uint8_t HAL_get_reset_source(void); // get reset reason
94
+void HAL_clear_reset_source();  // clear reset reason
95
+uint8_t HAL_get_reset_source(); // get reset reason
96
 
96
 
97
 //
97
 //
98
 // EEPROM
98
 // EEPROM
113
 
113
 
114
 #define HAL_ANALOG_SELECT(pin)
114
 #define HAL_ANALOG_SELECT(pin)
115
 
115
 
116
-inline void HAL_adc_init(void) {}//todo
116
+inline void HAL_adc_init() {}//todo
117
 
117
 
118
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
118
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
119
 #define HAL_READ_ADC()      HAL_adc_result
119
 #define HAL_READ_ADC()      HAL_adc_result
120
 #define HAL_ADC_READY()     true
120
 #define HAL_ADC_READY()     true
121
 
121
 
122
 void HAL_adc_start_conversion(const uint8_t adc_pin);
122
 void HAL_adc_start_conversion(const uint8_t adc_pin);
123
-uint16_t HAL_adc_get_result(void);
123
+uint16_t HAL_adc_get_result();
124
 
124
 
125
 //
125
 //
126
 // Pin Map
126
 // Pin Map
138
 
138
 
139
 // Enable hooks into idle and setup for HAL
139
 // Enable hooks into idle and setup for HAL
140
 #define HAL_IDLETASK 1
140
 #define HAL_IDLETASK 1
141
-void HAL_idletask(void);
142
-void HAL_init(void);
141
+void HAL_idletask();
142
+void HAL_init();
143
 
143
 
144
 //
144
 //
145
 // Utility functions
145
 // Utility functions
148
 
148
 
149
 #pragma GCC diagnostic push
149
 #pragma GCC diagnostic push
150
 #pragma GCC diagnostic ignored "-Wunused-function"
150
 #pragma GCC diagnostic ignored "-Wunused-function"
151
-int freeMemory(void);
151
+int freeMemory();
152
 #pragma GCC diagnostic pop
152
 #pragma GCC diagnostic pop
153
 
153
 
154
 #ifdef __cplusplus
154
 #ifdef __cplusplus

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

48
  * If it is not, then it copies the ROM table to the SRAM and relocates the table
48
  * If it is not, then it copies the ROM table to the SRAM and relocates the table
49
  * by reprogramming the NVIC registers
49
  * by reprogramming the NVIC registers
50
  */
50
  */
51
-static pfnISR_Handler* get_relocated_table_addr(void) {
51
+static pfnISR_Handler* get_relocated_table_addr() {
52
   // Get the address of the interrupt/exception table
52
   // Get the address of the interrupt/exception table
53
   uint32_t isrtab = SCB->VTOR;
53
   uint32_t isrtab = SCB->VTOR;
54
 
54
 

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

37
 #ifdef ARDUINO_ARCH_SAM
37
 #ifdef ARDUINO_ARCH_SAM
38
 
38
 
39
 // ISR handler type
39
 // ISR handler type
40
-typedef void (*pfnISR_Handler)(void);
40
+typedef void (*pfnISR_Handler)();
41
 
41
 
42
 // Install a new interrupt vector handler for the given irq, returning the old one
42
 // Install a new interrupt vector handler for the given irq, returning the old one
43
 pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler);
43
 pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler);

+ 8
- 8
Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp View File

178
 }
178
 }
179
 
179
 
180
 template<typename Cfg>
180
 template<typename Cfg>
181
-FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq(void) {
181
+FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq() {
182
   if (Cfg::TX_SIZE > 0) {
182
   if (Cfg::TX_SIZE > 0) {
183
     // Read positions
183
     // Read positions
184
     uint8_t t = tx_buffer.tail;
184
     uint8_t t = tx_buffer.tail;
221
 }
221
 }
222
 
222
 
223
 template<typename Cfg>
223
 template<typename Cfg>
224
-void MarlinSerial<Cfg>::UART_ISR(void) {
224
+void MarlinSerial<Cfg>::UART_ISR() {
225
   const uint32_t status = HWUART->UART_SR;
225
   const uint32_t status = HWUART->UART_SR;
226
 
226
 
227
   // Data received?
227
   // Data received?
308
 }
308
 }
309
 
309
 
310
 template<typename Cfg>
310
 template<typename Cfg>
311
-int MarlinSerial<Cfg>::peek(void) {
311
+int MarlinSerial<Cfg>::peek() {
312
   const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];
312
   const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];
313
   return v;
313
   return v;
314
 }
314
 }
315
 
315
 
316
 template<typename Cfg>
316
 template<typename Cfg>
317
-int MarlinSerial<Cfg>::read(void) {
317
+int MarlinSerial<Cfg>::read() {
318
 
318
 
319
   const ring_buffer_pos_t h = rx_buffer.head;
319
   const ring_buffer_pos_t h = rx_buffer.head;
320
   ring_buffer_pos_t t = rx_buffer.tail;
320
   ring_buffer_pos_t t = rx_buffer.tail;
354
 }
354
 }
355
 
355
 
356
 template<typename Cfg>
356
 template<typename Cfg>
357
-typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available(void) {
357
+typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available() {
358
   const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
358
   const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
359
   return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
359
   return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
360
 }
360
 }
361
 
361
 
362
 template<typename Cfg>
362
 template<typename Cfg>
363
-void MarlinSerial<Cfg>::flush(void) {
363
+void MarlinSerial<Cfg>::flush() {
364
   rx_buffer.tail = rx_buffer.head;
364
   rx_buffer.tail = rx_buffer.head;
365
 
365
 
366
   if (Cfg::XONOFF) {
366
   if (Cfg::XONOFF) {
431
 }
431
 }
432
 
432
 
433
 template<typename Cfg>
433
 template<typename Cfg>
434
-void MarlinSerial<Cfg>::flushTX(void) {
434
+void MarlinSerial<Cfg>::flushTX() {
435
   // TX
435
   // TX
436
 
436
 
437
   if (Cfg::TX_SIZE == 0) {
437
   if (Cfg::TX_SIZE == 0) {
520
 }
520
 }
521
 
521
 
522
 template<typename Cfg>
522
 template<typename Cfg>
523
-void MarlinSerial<Cfg>::println(void) {
523
+void MarlinSerial<Cfg>::println() {
524
   print('\r');
524
   print('\r');
525
   print('\n');
525
   print('\n');
526
 }
526
 }

+ 8
- 8
Marlin/src/HAL/HAL_DUE/MarlinSerial.h View File

108
   static ring_buffer_pos_t rx_max_enqueued;
108
   static ring_buffer_pos_t rx_max_enqueued;
109
 
109
 
110
   FORCE_INLINE static void store_rxd_char();
110
   FORCE_INLINE static void store_rxd_char();
111
-  FORCE_INLINE static void _tx_thr_empty_irq(void);
112
-  static void UART_ISR(void);
111
+  FORCE_INLINE static void _tx_thr_empty_irq();
112
+  static void UART_ISR();
113
 
113
 
114
 public:
114
 public:
115
   MarlinSerial() {};
115
   MarlinSerial() {};
116
   static void begin(const long);
116
   static void begin(const long);
117
   static void end();
117
   static void end();
118
-  static int peek(void);
119
-  static int read(void);
120
-  static void flush(void);
121
-  static ring_buffer_pos_t available(void);
118
+  static int peek();
119
+  static int read();
120
+  static void flush();
121
+  static ring_buffer_pos_t available();
122
   static void write(const uint8_t c);
122
   static void write(const uint8_t c);
123
-  static void flushTX(void);
123
+  static void flushTX();
124
 
124
 
125
   FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
125
   FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
126
   FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
126
   FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
149
   static void println(long, int = DEC);
149
   static void println(long, int = DEC);
150
   static void println(unsigned long, int = DEC);
150
   static void println(unsigned long, int = DEC);
151
   static void println(double, int = 2);
151
   static void println(double, int = 2);
152
-  static void println(void);
152
+  static void println();
153
   operator bool() { return true; }
153
   operator bool() { return true; }
154
 
154
 
155
 private:
155
 private:

+ 11
- 11
Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp View File

39
 
39
 
40
 // Imports from Atmel USB Stack/CDC implementation
40
 // Imports from Atmel USB Stack/CDC implementation
41
 extern "C" {
41
 extern "C" {
42
-  bool usb_task_cdc_isenabled(void);
43
-  bool usb_task_cdc_dtr_active(void);
44
-  bool udi_cdc_is_rx_ready(void);
45
-  int udi_cdc_getc(void);
46
-  bool udi_cdc_is_tx_ready(void);
42
+  bool usb_task_cdc_isenabled();
43
+  bool usb_task_cdc_dtr_active();
44
+  bool udi_cdc_is_rx_ready();
45
+  int udi_cdc_getc();
46
+  bool udi_cdc_is_tx_ready();
47
   int udi_cdc_putc(int value);
47
   int udi_cdc_putc(int value);
48
 };
48
 };
49
 
49
 
62
 void MarlinSerialUSB::end() {
62
 void MarlinSerialUSB::end() {
63
 }
63
 }
64
 
64
 
65
-int MarlinSerialUSB::peek(void) {
65
+int MarlinSerialUSB::peek() {
66
   if (pending_char >= 0)
66
   if (pending_char >= 0)
67
     return pending_char;
67
     return pending_char;
68
 
68
 
83
   return pending_char;
83
   return pending_char;
84
 }
84
 }
85
 
85
 
86
-int MarlinSerialUSB::read(void) {
86
+int MarlinSerialUSB::read() {
87
   if (pending_char >= 0) {
87
   if (pending_char >= 0) {
88
     int ret = pending_char;
88
     int ret = pending_char;
89
     pending_char = -1;
89
     pending_char = -1;
107
   return c;
107
   return c;
108
 }
108
 }
109
 
109
 
110
-bool MarlinSerialUSB::available(void) {
110
+bool MarlinSerialUSB::available() {
111
     /* If Pending chars */
111
     /* If Pending chars */
112
   return pending_char >= 0 ||
112
   return pending_char >= 0 ||
113
     /* or USB CDC enumerated and configured on the PC side and some
113
     /* or USB CDC enumerated and configured on the PC side and some
115
       (usb_task_cdc_isenabled() && udi_cdc_is_rx_ready());
115
       (usb_task_cdc_isenabled() && udi_cdc_is_rx_ready());
116
 }
116
 }
117
 
117
 
118
-void MarlinSerialUSB::flush(void) { }
119
-void MarlinSerialUSB::flushTX(void) { }
118
+void MarlinSerialUSB::flush() { }
119
+void MarlinSerialUSB::flushTX() { }
120
 
120
 
121
 void MarlinSerialUSB::write(const uint8_t c) {
121
 void MarlinSerialUSB::write(const uint8_t c) {
122
 
122
 
186
   printFloat(n, digits);
186
   printFloat(n, digits);
187
 }
187
 }
188
 
188
 
189
-void MarlinSerialUSB::println(void) {
189
+void MarlinSerialUSB::println() {
190
   print('\r');
190
   print('\r');
191
   print('\n');
191
   print('\n');
192
 }
192
 }

+ 6
- 6
Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h View File

43
   MarlinSerialUSB() {};
43
   MarlinSerialUSB() {};
44
   static void begin(const long);
44
   static void begin(const long);
45
   static void end();
45
   static void end();
46
-  static int peek(void);
47
-  static int read(void);
48
-  static void flush(void);
49
-  static void flushTX(void);
50
-  static bool available(void);
46
+  static int peek();
47
+  static int read();
48
+  static void flush();
49
+  static void flushTX();
50
+  static bool available();
51
   static void write(const uint8_t c);
51
   static void write(const uint8_t c);
52
 
52
 
53
   #if ENABLED(SERIAL_STATS_DROPPED_RX)
53
   #if ENABLED(SERIAL_STATS_DROPPED_RX)
80
   static void println(long, int = DEC);
80
   static void println(long, int = DEC);
81
   static void println(unsigned long, int = DEC);
81
   static void println(unsigned long, int = DEC);
82
   static void println(double, int = 2);
82
   static void println(double, int = 2);
83
-  static void println(void);
83
+  static void println();
84
   operator bool() { return true; }
84
   operator bool() { return true; }
85
 
85
 
86
 private:
86
 private:

+ 5
- 5
Marlin/src/HAL/HAL_DUE/Servo.cpp View File

56
 void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel);
56
 void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel);
57
 
57
 
58
 #ifdef _useTimer1
58
 #ifdef _useTimer1
59
-  void HANDLER_FOR_TIMER1(void) { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); }
59
+  void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); }
60
 #endif
60
 #endif
61
 #ifdef _useTimer2
61
 #ifdef _useTimer2
62
-  void HANDLER_FOR_TIMER2(void) { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); }
62
+  void HANDLER_FOR_TIMER2() { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); }
63
 #endif
63
 #endif
64
 #ifdef _useTimer3
64
 #ifdef _useTimer3
65
-  void HANDLER_FOR_TIMER3(void) { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); }
65
+  void HANDLER_FOR_TIMER3() { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); }
66
 #endif
66
 #endif
67
 #ifdef _useTimer4
67
 #ifdef _useTimer4
68
-  void HANDLER_FOR_TIMER4(void) { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); }
68
+  void HANDLER_FOR_TIMER4() { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); }
69
 #endif
69
 #endif
70
 #ifdef _useTimer5
70
 #ifdef _useTimer5
71
-  void HANDLER_FOR_TIMER5(void) { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); }
71
+  void HANDLER_FOR_TIMER5() { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); }
72
 #endif
72
 #endif
73
 
73
 
74
 void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) {
74
 void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) {

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

38
 #include "../../module/endstops.h"
38
 #include "../../module/endstops.h"
39
 
39
 
40
 // One ISR for all EXT-Interrupts
40
 // One ISR for all EXT-Interrupts
41
-void endstop_ISR(void) { endstops.update(); }
41
+void endstop_ISR() { endstops.update(); }
42
 
42
 
43
 /**
43
 /**
44
  *  Endstop interrupts for Due based targets.
44
  *  Endstop interrupts for Due based targets.
45
  *  On Due, all pins support external interrupt capability.
45
  *  On Due, all pins support external interrupt capability.
46
  */
46
  */
47
 
47
 
48
-void setup_endstop_interrupts(void) {
48
+void setup_endstop_interrupts() {
49
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
49
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
50
   #if HAS_X_MAX
50
   #if HAS_X_MAX
51
     _ATTACH(X_MAX_PIN);
51
     _ATTACH(X_MAX_PIN);

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

33
   #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
33
   #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
34
 #endif
34
 #endif
35
 
35
 
36
-extern void eeprom_flush(void);
36
+extern void eeprom_flush();
37
 
37
 
38
 bool PersistentStore::access_start() { return true; }
38
 bool PersistentStore::access_start() { return true; }
39
 
39
 

+ 2
- 2
Marlin/src/HAL/HAL_DUE/usb/compiler.h View File

216
 	}
216
 	}
217
 #  endif
217
 #  endif
218
 #else
218
 #else
219
-#  define Assert(expr) ((void) 0)
219
+#  define Assert(expr) (() 0)
220
 #endif
220
 #endif
221
 
221
 
222
 /* Define WEAK attribute */
222
 /* Define WEAK attribute */
796
  *
796
  *
797
  * \note It may be used as a long jump opcode in some special cases.
797
  * \note It may be used as a long jump opcode in some special cases.
798
  */
798
  */
799
-#define Long_call(addr)                   ((*(void (*)(void))(addr))())
799
+#define Long_call(addr)                   ((*(void (*)())(addr))())
800
 
800
 
801
 
801
 
802
 /*! \name MCU Endianism Handling
802
 /*! \name MCU Endianism Handling

+ 7
- 7
Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c View File

174
 //! LUN descriptor table.
174
 //! LUN descriptor table.
175
 static const struct
175
 static const struct
176
 {
176
 {
177
-  Ctrl_status (*test_unit_ready)(void);
177
+  Ctrl_status (*test_unit_ready)();
178
   Ctrl_status (*read_capacity)(U32 *);
178
   Ctrl_status (*read_capacity)(U32 *);
179
   bool (*unload)(bool);
179
   bool (*unload)(bool);
180
-  bool (*wr_protect)(void);
181
-  bool (*removal)(void);
180
+  bool (*wr_protect)();
181
+  bool (*removal)();
182
 #if ACCESS_USB == true
182
 #if ACCESS_USB == true
183
   Ctrl_status (*usb_read_10)(U32, U16);
183
   Ctrl_status (*usb_read_10)(U32, U16);
184
   Ctrl_status (*usb_write_10)(U32, U16);
184
   Ctrl_status (*usb_write_10)(U32, U16);
255
 
255
 
256
 #ifdef FREERTOS_USED
256
 #ifdef FREERTOS_USED
257
 
257
 
258
-bool ctrl_access_init(void)
258
+bool ctrl_access_init()
259
 {
259
 {
260
   // If the handle to the protecting semaphore is not valid,
260
   // If the handle to the protecting semaphore is not valid,
261
   if (!ctrl_access_semphr)
261
   if (!ctrl_access_semphr)
275
  *
275
  *
276
  * \return \c true if the access was successfully locked, else \c false.
276
  * \return \c true if the access was successfully locked, else \c false.
277
  */
277
  */
278
-static bool ctrl_access_lock(void)
278
+static bool ctrl_access_lock()
279
 {
279
 {
280
   // If the semaphore could not be created, there is no backup solution.
280
   // If the semaphore could not be created, there is no backup solution.
281
   if (!ctrl_access_semphr) return false;
281
   if (!ctrl_access_semphr) return false;
289
 #endif  // FREERTOS_USED
289
 #endif  // FREERTOS_USED
290
 
290
 
291
 
291
 
292
-U8 get_nb_lun(void)
292
+U8 get_nb_lun()
293
 {
293
 {
294
 #if MEM_USB == ENABLE
294
 #if MEM_USB == ENABLE
295
 #  ifndef Lun_usb_get_lun
295
 #  ifndef Lun_usb_get_lun
310
 }
310
 }
311
 
311
 
312
 
312
 
313
-U8 get_cur_lun(void)
313
+U8 get_cur_lun()
314
 {
314
 {
315
   return LUN_ID_0;
315
   return LUN_ID_0;
316
 }
316
 }

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

191
  *
191
  *
192
  * \return \c true if the locker was successfully initialized, else \c false.
192
  * \return \c true if the locker was successfully initialized, else \c false.
193
  */
193
  */
194
-extern bool ctrl_access_init(void);
194
+extern bool ctrl_access_init();
195
 
195
 
196
 #endif  // FREERTOS_USED
196
 #endif  // FREERTOS_USED
197
 
197
 
199
  *
199
  *
200
  * \return Number of LUNs in the system.
200
  * \return Number of LUNs in the system.
201
  */
201
  */
202
-extern U8 get_nb_lun(void);
202
+extern U8 get_nb_lun();
203
 
203
 
204
 /*! \brief Returns the current LUN.
204
 /*! \brief Returns the current LUN.
205
  *
205
  *
207
  *
207
  *
208
  * \todo Implement.
208
  * \todo Implement.
209
  */
209
  */
210
-extern U8 get_cur_lun(void);
210
+extern U8 get_cur_lun();
211
 
211
 
212
 /*! \brief Tests the memory state and initializes the memory if required.
212
 /*! \brief Tests the memory state and initializes the memory if required.
213
  *
213
  *

+ 4
- 4
Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp View File

15
 
15
 
16
 #define SD_MMC_BLOCK_SIZE 512
16
 #define SD_MMC_BLOCK_SIZE 512
17
 
17
 
18
-void sd_mmc_spi_mem_init(void) {
18
+void sd_mmc_spi_mem_init() {
19
 }
19
 }
20
 
20
 
21
-Ctrl_status sd_mmc_spi_test_unit_ready(void) {
21
+Ctrl_status sd_mmc_spi_test_unit_ready() {
22
   if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
22
   if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
23
     return CTRL_NO_PRESENT;
23
     return CTRL_NO_PRESENT;
24
   return CTRL_GOOD;
24
   return CTRL_GOOD;
38
   return true;
38
   return true;
39
 }
39
 }
40
 
40
 
41
-bool sd_mmc_spi_wr_protect(void) {
41
+bool sd_mmc_spi_wr_protect() {
42
   return false;
42
   return false;
43
 }
43
 }
44
 
44
 
45
-bool sd_mmc_spi_removal(void) {
45
+bool sd_mmc_spi_removal() {
46
   if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
46
   if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
47
     return true;
47
     return true;
48
   return false;
48
   return false;

+ 4
- 4
Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h View File

78
 //!
78
 //!
79
 //! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
79
 //! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
80
 //!/
80
 //!/
81
-extern void           sd_mmc_spi_mem_init(void);
81
+extern void           sd_mmc_spi_mem_init();
82
 
82
 
83
 //!
83
 //!
84
 //! @brief This function tests the state of the SD_MMC memory and sends it to the Host.
84
 //! @brief This function tests the state of the SD_MMC memory and sends it to the Host.
91
 //!   Media not present    ->    CTRL_NO_PRESENT
91
 //!   Media not present    ->    CTRL_NO_PRESENT
92
 //!   Media has changed    ->    CTRL_BUSY
92
 //!   Media has changed    ->    CTRL_BUSY
93
 //!/
93
 //!/
94
-extern Ctrl_status    sd_mmc_spi_test_unit_ready(void);
94
+extern Ctrl_status    sd_mmc_spi_test_unit_ready();
95
 
95
 
96
 //!
96
 //!
97
 //! @brief This function gives the address of the last valid sector.
97
 //! @brief This function gives the address of the last valid sector.
124
 //!
124
 //!
125
 //! @return false  -> the memory is not write-protected (always)
125
 //! @return false  -> the memory is not write-protected (always)
126
 //!/
126
 //!/
127
-extern bool           sd_mmc_spi_wr_protect(void);
127
+extern bool           sd_mmc_spi_wr_protect();
128
 
128
 
129
 //!
129
 //!
130
 //! @brief This function tells if the memory has been removed or not.
130
 //! @brief This function tells if the memory has been removed or not.
131
 //!
131
 //!
132
 //! @return false  -> The memory isn't removed
132
 //! @return false  -> The memory isn't removed
133
 //!
133
 //!
134
-extern bool           sd_mmc_spi_removal(void);
134
+extern bool           sd_mmc_spi_removal();
135
 
135
 
136
 
136
 
137
 //---- ACCESS DATA FONCTIONS ----
137
 //---- ACCESS DATA FONCTIONS ----

+ 2
- 2
Marlin/src/HAL/HAL_DUE/usb/sysclk.c View File

71
  * \param pll_id Source of the USB clock.
71
  * \param pll_id Source of the USB clock.
72
  * \param div Actual clock divisor. Must be superior to 0.
72
  * \param div Actual clock divisor. Must be superior to 0.
73
  */
73
  */
74
-void sysclk_enable_usb(void)
74
+void sysclk_enable_usb()
75
 {
75
 {
76
 	Assert(CONFIG_USBCLK_DIV > 0);
76
 	Assert(CONFIG_USBCLK_DIV > 0);
77
 
77
 
103
  *
103
  *
104
  * \note This implementation does not switch off the PLL, it just turns off the USB clock.
104
  * \note This implementation does not switch off the PLL, it just turns off the USB clock.
105
  */
105
  */
106
-void sysclk_disable_usb(void)
106
+void sysclk_disable_usb()
107
 {
107
 {
108
 	pmc_disable_udpck();
108
 	pmc_disable_udpck();
109
 }
109
 }

+ 2
- 2
Marlin/src/HAL/HAL_DUE/usb/sysclk.h View File

213
 #endif
213
 #endif
214
 
214
 
215
 
215
 
216
-extern void sysclk_enable_usb(void);
217
-extern void sysclk_disable_usb(void);
216
+extern void sysclk_enable_usb();
217
+extern void sysclk_disable_usb();
218
 
218
 
219
 //! @}
219
 //! @}
220
 
220
 

+ 26
- 26
Marlin/src/HAL/HAL_DUE/usb/udc.c View File

132
  * define USB_DEVICE_GET_SERIAL_NAME_LENGTH.
132
  * define USB_DEVICE_GET_SERIAL_NAME_LENGTH.
133
  */
133
  */
134
 #if defined USB_DEVICE_GET_SERIAL_NAME_POINTER
134
 #if defined USB_DEVICE_GET_SERIAL_NAME_POINTER
135
-	static const uint8_t *udc_get_string_serial_name(void)
135
+	static const uint8_t *udc_get_string_serial_name()
136
 	{
136
 	{
137
 		return (const uint8_t *)USB_DEVICE_GET_SERIAL_NAME_POINTER;
137
 		return (const uint8_t *)USB_DEVICE_GET_SERIAL_NAME_POINTER;
138
 	}
138
 	}
139
 #  define USB_DEVICE_SERIAL_NAME_SIZE \
139
 #  define USB_DEVICE_SERIAL_NAME_SIZE \
140
 	USB_DEVICE_GET_SERIAL_NAME_LENGTH
140
 	USB_DEVICE_GET_SERIAL_NAME_LENGTH
141
 #elif defined USB_DEVICE_SERIAL_NAME
141
 #elif defined USB_DEVICE_SERIAL_NAME
142
-	static const uint8_t *udc_get_string_serial_name(void)
142
+	static const uint8_t *udc_get_string_serial_name()
143
 	{
143
 	{
144
 		return (const uint8_t *)USB_DEVICE_SERIAL_NAME;
144
 		return (const uint8_t *)USB_DEVICE_SERIAL_NAME;
145
 	}
145
 	}
164
 };
164
 };
165
 //! @}
165
 //! @}
166
 
166
 
167
-usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void)
167
+usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc()
168
 {
168
 {
169
 	return udc_ptr_iface;
169
 	return udc_ptr_iface;
170
 }
170
 }
174
  *
174
  *
175
  * \return address after the last byte of USB Configuration descriptor
175
  * \return address after the last byte of USB Configuration descriptor
176
  */
176
  */
177
-static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void)
177
+static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf()
178
 {
178
 {
179
 	return (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *)
179
 	return (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *)
180
 			udc_ptr_conf->desc +
180
 			udc_ptr_conf->desc +
360
 
360
 
361
 /*! \brief Start the USB Device stack
361
 /*! \brief Start the USB Device stack
362
  */
362
  */
363
-void udc_start(void)
363
+void udc_start()
364
 {
364
 {
365
 	udd_enable();
365
 	udd_enable();
366
 }
366
 }
367
 
367
 
368
 /*! \brief Stop the USB Device stack
368
 /*! \brief Stop the USB Device stack
369
  */
369
  */
370
-void udc_stop(void)
370
+void udc_stop()
371
 {
371
 {
372
 	udd_disable();
372
 	udd_disable();
373
 	udc_reset();
373
 	udc_reset();
377
  * \brief Reset the current configuration of the USB device,
377
  * \brief Reset the current configuration of the USB device,
378
  * This routines can be called by UDD when a RESET on the USB line occurs.
378
  * This routines can be called by UDD when a RESET on the USB line occurs.
379
  */
379
  */
380
-void udc_reset(void)
380
+void udc_reset()
381
 {
381
 {
382
 	uint8_t iface_num;
382
 	uint8_t iface_num;
383
 
383
 
404
 #endif
404
 #endif
405
 }
405
 }
406
 
406
 
407
-void udc_sof_notify(void)
407
+void udc_sof_notify()
408
 {
408
 {
409
 	uint8_t iface_num;
409
 	uint8_t iface_num;
410
 
410
 
424
  *
424
  *
425
  * \return true if success
425
  * \return true if success
426
  */
426
  */
427
-static bool udc_req_std_dev_get_status(void)
427
+static bool udc_req_std_dev_get_status()
428
 {
428
 {
429
 	if (udd_g_ctrlreq.req.wLength != sizeof(udc_device_status)) {
429
 	if (udd_g_ctrlreq.req.wLength != sizeof(udc_device_status)) {
430
 		return false;
430
 		return false;
441
  *
441
  *
442
  * \return true if success
442
  * \return true if success
443
  */
443
  */
444
-static bool udc_req_std_ep_get_status(void)
444
+static bool udc_req_std_ep_get_status()
445
 {
445
 {
446
 	static le16_t udc_ep_status;
446
 	static le16_t udc_ep_status;
447
 
447
 
463
  *
463
  *
464
  * \return true if success
464
  * \return true if success
465
  */
465
  */
466
-static bool udc_req_std_dev_clear_feature(void)
466
+static bool udc_req_std_dev_clear_feature()
467
 {
467
 {
468
 	if (udd_g_ctrlreq.req.wLength) {
468
 	if (udd_g_ctrlreq.req.wLength) {
469
 		return false;
469
 		return false;
486
  *
486
  *
487
  * \return true if success
487
  * \return true if success
488
  */
488
  */
489
-static bool udc_req_std_ep_clear_feature(void)
489
+static bool udc_req_std_ep_clear_feature()
490
 {
490
 {
491
 	if (udd_g_ctrlreq.req.wLength) {
491
 	if (udd_g_ctrlreq.req.wLength) {
492
 		return false;
492
 		return false;
504
  *
504
  *
505
  * \return true if success
505
  * \return true if success
506
  */
506
  */
507
-static bool udc_req_std_dev_set_feature(void)
507
+static bool udc_req_std_dev_set_feature()
508
 {
508
 {
509
 	if (udd_g_ctrlreq.req.wLength) {
509
 	if (udd_g_ctrlreq.req.wLength) {
510
 		return false;
510
 		return false;
567
  * \return true if success
567
  * \return true if success
568
  */
568
  */
569
 #if (0!=USB_DEVICE_MAX_EP)
569
 #if (0!=USB_DEVICE_MAX_EP)
570
-static bool udc_req_std_ep_set_feature(void)
570
+static bool udc_req_std_ep_set_feature()
571
 {
571
 {
572
 	if (udd_g_ctrlreq.req.wLength) {
572
 	if (udd_g_ctrlreq.req.wLength) {
573
 		return false;
573
 		return false;
584
  * \brief Change the address of device
584
  * \brief Change the address of device
585
  * Callback called at the end of request set address
585
  * Callback called at the end of request set address
586
  */
586
  */
587
-static void udc_valid_address(void)
587
+static void udc_valid_address()
588
 {
588
 {
589
 	udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F);
589
 	udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F);
590
 }
590
 }
594
  *
594
  *
595
  * \return true if success
595
  * \return true if success
596
  */
596
  */
597
-static bool udc_req_std_dev_set_address(void)
597
+static bool udc_req_std_dev_set_address()
598
 {
598
 {
599
 	if (udd_g_ctrlreq.req.wLength) {
599
 	if (udd_g_ctrlreq.req.wLength) {
600
 		return false;
600
 		return false;
611
  *
611
  *
612
  * \return true if success
612
  * \return true if success
613
  */
613
  */
614
-static bool udc_req_std_dev_get_str_desc(void)
614
+static bool udc_req_std_dev_get_str_desc()
615
 {
615
 {
616
 	uint8_t i;
616
 	uint8_t i;
617
 	const uint8_t *str;
617
 	const uint8_t *str;
670
  *
670
  *
671
  * \return true if success
671
  * \return true if success
672
  */
672
  */
673
-static bool udc_req_std_dev_get_descriptor(void)
673
+static bool udc_req_std_dev_get_descriptor()
674
 {
674
 {
675
 	uint8_t conf_num;
675
 	uint8_t conf_num;
676
 
676
 
787
  *
787
  *
788
  * \return true if success
788
  * \return true if success
789
  */
789
  */
790
-static bool udc_req_std_dev_get_configuration(void)
790
+static bool udc_req_std_dev_get_configuration()
791
 {
791
 {
792
 	if (udd_g_ctrlreq.req.wLength != 1) {
792
 	if (udd_g_ctrlreq.req.wLength != 1) {
793
 		return false;
793
 		return false;
802
  *
802
  *
803
  * \return true if success
803
  * \return true if success
804
  */
804
  */
805
-static bool udc_req_std_dev_set_configuration(void)
805
+static bool udc_req_std_dev_set_configuration()
806
 {
806
 {
807
 	uint8_t iface_num;
807
 	uint8_t iface_num;
808
 
808
 
867
  *
867
  *
868
  * \return true if success
868
  * \return true if success
869
  */
869
  */
870
-static bool udc_req_std_iface_get_setting(void)
870
+static bool udc_req_std_iface_get_setting()
871
 {
871
 {
872
 	uint8_t iface_num;
872
 	uint8_t iface_num;
873
 	udi_api_t UDC_DESC_STORAGE *udi_api;
873
 	udi_api_t UDC_DESC_STORAGE *udi_api;
905
  *
905
  *
906
  * \return true if success
906
  * \return true if success
907
  */
907
  */
908
-static bool udc_req_std_iface_set_setting(void)
908
+static bool udc_req_std_iface_set_setting()
909
 {
909
 {
910
 	uint8_t iface_num, setting_num;
910
 	uint8_t iface_num, setting_num;
911
 
911
 
933
  *
933
  *
934
  * \return true if the request is supported
934
  * \return true if the request is supported
935
  */
935
  */
936
-static bool udc_reqstd(void)
936
+static bool udc_reqstd()
937
 {
937
 {
938
 	if (Udd_setup_is_in()) {
938
 	if (Udd_setup_is_in()) {
939
 		// GET Standard Requests
939
 		// GET Standard Requests
1027
  *
1027
  *
1028
  * \return true if the request is supported
1028
  * \return true if the request is supported
1029
  */
1029
  */
1030
-static bool udc_req_iface(void)
1030
+static bool udc_req_iface()
1031
 {
1031
 {
1032
 	uint8_t iface_num;
1032
 	uint8_t iface_num;
1033
 	udi_api_t UDC_DESC_STORAGE *udi_api;
1033
 	udi_api_t UDC_DESC_STORAGE *udi_api;
1062
  *
1062
  *
1063
  * \return true if the request is supported
1063
  * \return true if the request is supported
1064
  */
1064
  */
1065
-static bool udc_req_ep(void)
1065
+static bool udc_req_ep()
1066
 {
1066
 {
1067
 	uint8_t iface_num;
1067
 	uint8_t iface_num;
1068
 	udi_api_t UDC_DESC_STORAGE *udi_api;
1068
 	udi_api_t UDC_DESC_STORAGE *udi_api;
1101
  *
1101
  *
1102
  * \return true if the request is supported, else the request is stalled by UDD
1102
  * \return true if the request is supported, else the request is stalled by UDD
1103
  */
1103
  */
1104
-bool udc_process_setup(void)
1104
+bool udc_process_setup()
1105
 {
1105
 {
1106
 	// By default no data (receive/send) and no callbacks registered
1106
 	// By default no data (receive/send) and no callbacks registered
1107
 	udd_g_ctrlreq.payload_size = 0;
1107
 	udd_g_ctrlreq.payload_size = 0;

+ 24
- 24
Marlin/src/HAL/HAL_DUE/usb/udc.h View File

172
 	}
172
 	}
173
 \endcode
173
 \endcode
174
  */
174
  */
175
-static inline bool udc_include_vbus_monitoring(void)
175
+static inline bool udc_include_vbus_monitoring()
176
 {
176
 {
177
 	return udd_include_vbus_monitoring();
177
 	return udd_include_vbus_monitoring();
178
 }
178
 }
179
 
179
 
180
 /*! \brief Start the USB Device stack
180
 /*! \brief Start the USB Device stack
181
  */
181
  */
182
-void udc_start(void);
182
+void udc_start();
183
 
183
 
184
 /*! \brief Stop the USB Device stack
184
 /*! \brief Stop the USB Device stack
185
  */
185
  */
186
-void udc_stop(void);
186
+void udc_stop();
187
 
187
 
188
 /**
188
 /**
189
  * \brief Attach device to the bus when possible
189
  * \brief Attach device to the bus when possible
192
  * then it will attach device when an acceptable Vbus
192
  * then it will attach device when an acceptable Vbus
193
  * level from the host is detected.
193
  * level from the host is detected.
194
  */
194
  */
195
-static inline void udc_attach(void)
195
+static inline void udc_attach()
196
 {
196
 {
197
 	udd_attach();
197
 	udd_attach();
198
 }
198
 }
203
  *
203
  *
204
  * The driver must remove pull-up on USB line D- or D+.
204
  * The driver must remove pull-up on USB line D- or D+.
205
  */
205
  */
206
-static inline void udc_detach(void)
206
+static inline void udc_detach()
207
 {
207
 {
208
 	udd_detach();
208
 	udd_detach();
209
 }
209
 }
212
 /*! \brief The USB driver sends a resume signal called \e "Upstream Resume"
212
 /*! \brief The USB driver sends a resume signal called \e "Upstream Resume"
213
  * This is authorized only when the remote wakeup feature is enabled by host.
213
  * This is authorized only when the remote wakeup feature is enabled by host.
214
  */
214
  */
215
-static inline void udc_remotewakeup(void)
215
+static inline void udc_remotewakeup()
216
 {
216
 {
217
 	udd_send_remotewakeup();
217
 	udd_send_remotewakeup();
218
 }
218
 }
223
  *
223
  *
224
  * \return pointer on the current interface descriptor.
224
  * \return pointer on the current interface descriptor.
225
  */
225
  */
226
-usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
226
+usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc();
227
 
227
 
228
 //@}
228
 //@}
229
 
229
 
334
  *
334
  *
335
  * Add to application C-file:
335
  * Add to application C-file:
336
  * \code
336
  * \code
337
-	void usb_init(void)
337
+	void usb_init()
338
 	{
338
 	{
339
 	  udc_start();
339
 	  udc_start();
340
 	}
340
 	}
551
 	#define  USB_DEVICE_ATTR \
551
 	#define  USB_DEVICE_ATTR \
552
 	  (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED)
552
 	  (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED)
553
 	#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
553
 	#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
554
-	extern void my_callback_remotewakeup_enable(void);
554
+	extern void my_callback_remotewakeup_enable();
555
 	#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
555
 	#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
556
-	extern void my_callback_remotewakeup_disable(void);
556
+	extern void my_callback_remotewakeup_disable();
557
 \endcode
557
 \endcode
558
  *
558
  *
559
  * Add to application C-file:
559
  * Add to application C-file:
560
  * \code
560
  * \code
561
-	 void my_callback_remotewakeup_enable(void)
561
+	 void my_callback_remotewakeup_enable()
562
 	 {
562
 	 {
563
 	    // Enable application wakeup events (e.g. enable GPIO interrupt)
563
 	    // Enable application wakeup events (e.g. enable GPIO interrupt)
564
 	 }
564
 	 }
565
-	 void my_callback_remotewakeup_disable(void)
565
+	 void my_callback_remotewakeup_disable()
566
 	 {
566
 	 {
567
 	    // Disable application wakeup events (e.g. disable GPIO interrupt)
567
 	    // Disable application wakeup events (e.g. disable GPIO interrupt)
568
 	 }
568
 	 }
569
 
569
 
570
-	 void my_interrupt_event(void)
570
+	 void my_interrupt_event()
571
 	 {
571
 	 {
572
 	    udc_remotewakeup();
572
 	    udc_remotewakeup();
573
 	 }
573
 	 }
580
 	     #define  USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED) \endcode
580
 	     #define  USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED) \endcode
581
  *   - \code // Define callback called when the host enables the remotewakeup feature
581
  *   - \code // Define callback called when the host enables the remotewakeup feature
582
 	#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
582
 	#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
583
-	extern void my_callback_remotewakeup_enable(void); \endcode
583
+	extern void my_callback_remotewakeup_enable(); \endcode
584
  *   - \code // Define callback called when the host disables the remotewakeup feature
584
  *   - \code // Define callback called when the host disables the remotewakeup feature
585
 	#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
585
 	#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
586
-	extern void my_callback_remotewakeup_disable(void); \endcode
586
+	extern void my_callback_remotewakeup_disable(); \endcode
587
  * -# Send a remote wakeup (USB upstream):
587
  * -# Send a remote wakeup (USB upstream):
588
  *   - \code udc_remotewakeup(); \endcode
588
  *   - \code udc_remotewakeup(); \endcode
589
  */
589
  */
605
  * \code
605
  * \code
606
 	#define  USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED)
606
 	#define  USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED)
607
 	#define  UDC_SUSPEND_EVENT()         user_callback_suspend_action()
607
 	#define  UDC_SUSPEND_EVENT()         user_callback_suspend_action()
608
-	extern void user_callback_suspend_action(void)
608
+	extern void user_callback_suspend_action()
609
 	#define  UDC_RESUME_EVENT()          user_callback_resume_action()
609
 	#define  UDC_RESUME_EVENT()          user_callback_resume_action()
610
-	extern void user_callback_resume_action(void)
610
+	extern void user_callback_resume_action()
611
 \endcode
611
 \endcode
612
  *
612
  *
613
  * Add to application C-file:
613
  * Add to application C-file:
614
  * \code
614
  * \code
615
-	void user_callback_suspend_action(void)
615
+	void user_callback_suspend_action()
616
 	{
616
 	{
617
 	   // Disable hardware component to reduce power consumption
617
 	   // Disable hardware component to reduce power consumption
618
 	}
618
 	}
619
-	void user_callback_resume_action(void)
619
+	void user_callback_resume_action()
620
 	{
620
 	{
621
 	   // Re-enable hardware component
621
 	   // Re-enable hardware component
622
 	}
622
 	}
628
 	#define  USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED) \endcode
628
 	#define  USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED) \endcode
629
  *   - \code // Define callback called when the host suspend the USB line
629
  *   - \code // Define callback called when the host suspend the USB line
630
 	#define UDC_SUSPEND_EVENT() user_callback_suspend_action()
630
 	#define UDC_SUSPEND_EVENT() user_callback_suspend_action()
631
-	extern void user_callback_suspend_action(void); \endcode
631
+	extern void user_callback_suspend_action(); \endcode
632
  *   - \code // Define callback called when the host or device resume the USB line
632
  *   - \code // Define callback called when the host or device resume the USB line
633
 	#define UDC_RESUME_EVENT() user_callback_resume_action()
633
 	#define UDC_RESUME_EVENT() user_callback_resume_action()
634
-	extern void user_callback_resume_action(void); \endcode
634
+	extern void user_callback_resume_action(); \endcode
635
  * -# Reduce power consumption in suspend mode (max. 2.5mA on Vbus):
635
  * -# Reduce power consumption in suspend mode (max. 2.5mA on Vbus):
636
- *   - \code void user_callback_suspend_action(void)
636
+ *   - \code void user_callback_suspend_action()
637
 	{
637
 	{
638
 	turn_off_components();
638
 	turn_off_components();
639
 	} \endcode
639
 	} \endcode
664
  * \code
664
  * \code
665
 	 uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH];
665
 	 uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH];
666
 
666
 
667
-	 void init_build_usb_serial_number(void)
667
+	 void init_build_usb_serial_number()
668
 	 {
668
 	 {
669
 	 serial_number[0] = 'A';
669
 	 serial_number[0] = 'A';
670
 	 serial_number[1] = 'B';
670
 	 serial_number[1] = 'B';
683
  *   - \code
683
  *   - \code
684
 	 uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH];
684
 	 uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH];
685
 
685
 
686
-	 void init_build_usb_serial_number(void)
686
+	 void init_build_usb_serial_number()
687
 	 {
687
 	 {
688
 	 serial_number[0] = 'A';
688
 	 serial_number[0] = 'A';
689
 	 serial_number[1] = 'B';
689
 	 serial_number[1] = 'B';

+ 20
- 20
Marlin/src/HAL/HAL_DUE/usb/udd.h View File

94
 	uint16_t payload_size;
94
 	uint16_t payload_size;
95
 
95
 
96
 	//! Callback called after reception of ZLP from setup request
96
 	//! Callback called after reception of ZLP from setup request
97
-	void (*callback)(void);
97
+	void (*callback)();
98
 
98
 
99
 	//! Callback called when the buffer given (.payload) is full or empty.
99
 	//! Callback called when the buffer given (.payload) is full or empty.
100
 	//! This one return false to abort data transfer, or true with a new buffer in .payload.
100
 	//! This one return false to abort data transfer, or true with a new buffer in .payload.
101
-	bool (*over_under_run)(void);
101
+	bool (*over_under_run)();
102
 } udd_ctrl_request_t;
102
 } udd_ctrl_request_t;
103
 extern udd_ctrl_request_t udd_g_ctrlreq;
103
 extern udd_ctrl_request_t udd_g_ctrlreq;
104
 
104
 
123
  * Registered by routine udd_ep_wait_stall_clear()
123
  * Registered by routine udd_ep_wait_stall_clear()
124
  * Callback called when endpoint stall is cleared.
124
  * Callback called when endpoint stall is cleared.
125
  */
125
  */
126
-typedef void (*udd_callback_halt_cleared_t)(void);
126
+typedef void (*udd_callback_halt_cleared_t)();
127
 
127
 
128
 /**
128
 /**
129
  * \brief End of transfer callback function type.
129
  * \brief End of transfer callback function type.
142
  *
142
  *
143
  * \return true, if the VBUS monitoring is possible.
143
  * \return true, if the VBUS monitoring is possible.
144
  */
144
  */
145
-bool udd_include_vbus_monitoring(void);
145
+bool udd_include_vbus_monitoring();
146
 
146
 
147
 /**
147
 /**
148
  * \brief Enables the USB Device mode
148
  * \brief Enables the USB Device mode
149
  */
149
  */
150
-void udd_enable(void);
150
+void udd_enable();
151
 
151
 
152
 /**
152
 /**
153
  * \brief Disables the USB Device mode
153
  * \brief Disables the USB Device mode
154
  */
154
  */
155
-void udd_disable(void);
155
+void udd_disable();
156
 
156
 
157
 /**
157
 /**
158
  * \brief Attach device to the bus when possible
158
  * \brief Attach device to the bus when possible
161
  * then it will attach device when an acceptable Vbus
161
  * then it will attach device when an acceptable Vbus
162
  * level from the host is detected.
162
  * level from the host is detected.
163
  */
163
  */
164
-void udd_attach(void);
164
+void udd_attach();
165
 
165
 
166
 /**
166
 /**
167
  * \brief Detaches the device from the bus
167
  * \brief Detaches the device from the bus
168
  *
168
  *
169
  * The driver must remove pull-up on USB line D- or D+.
169
  * The driver must remove pull-up on USB line D- or D+.
170
  */
170
  */
171
-void udd_detach(void);
171
+void udd_detach();
172
 
172
 
173
 /**
173
 /**
174
  * \brief Test whether the USB Device Controller is running at high
174
  * \brief Test whether the USB Device Controller is running at high
176
  *
176
  *
177
  * \return \c true if the Device is running at high speed mode, otherwise \c false.
177
  * \return \c true if the Device is running at high speed mode, otherwise \c false.
178
  */
178
  */
179
-bool udd_is_high_speed(void);
179
+bool udd_is_high_speed();
180
 
180
 
181
 /**
181
 /**
182
  * \brief Changes the USB address of device
182
  * \brief Changes the USB address of device
190
  *
190
  *
191
  * \return USB address
191
  * \return USB address
192
  */
192
  */
193
-uint8_t udd_getaddress(void);
193
+uint8_t udd_getaddress();
194
 
194
 
195
 /**
195
 /**
196
  * \brief Returns the current start of frame number
196
  * \brief Returns the current start of frame number
197
  *
197
  *
198
  * \return current start of frame number.
198
  * \return current start of frame number.
199
  */
199
  */
200
-uint16_t udd_get_frame_number(void);
200
+uint16_t udd_get_frame_number();
201
 
201
 
202
 /**
202
 /**
203
  * \brief Returns the current micro start of frame number
203
  * \brief Returns the current micro start of frame number
204
  *
204
  *
205
  * \return current micro start of frame number required in high speed mode.
205
  * \return current micro start of frame number required in high speed mode.
206
  */
206
  */
207
-uint16_t udd_get_micro_frame_number(void);
207
+uint16_t udd_get_micro_frame_number();
208
 
208
 
209
 /*! \brief The USB driver sends a resume signal called Upstream Resume
209
 /*! \brief The USB driver sends a resume signal called Upstream Resume
210
  */
210
  */
211
-void udd_send_remotewakeup(void);
211
+void udd_send_remotewakeup();
212
 
212
 
213
 /**
213
 /**
214
  * \brief Load setup payload
214
  * \brief Load setup payload
346
  * The following functions allow the device to jump to a specific test mode required in high speed mode.
346
  * The following functions allow the device to jump to a specific test mode required in high speed mode.
347
  */
347
  */
348
 //@{
348
 //@{
349
-void udd_test_mode_j(void);
350
-void udd_test_mode_k(void);
351
-void udd_test_mode_se0_nak(void);
352
-void udd_test_mode_packet(void);
349
+void udd_test_mode_j();
350
+void udd_test_mode_k();
351
+void udd_test_mode_se0_nak();
352
+void udd_test_mode_packet();
353
 //@}
353
 //@}
354
 
354
 
355
 
355
 
370
  *
370
  *
371
  * \return \c 1 if the request is accepted, otherwise \c 0.
371
  * \return \c 1 if the request is accepted, otherwise \c 0.
372
  */
372
  */
373
-extern bool udc_process_setup(void);
373
+extern bool udc_process_setup();
374
 
374
 
375
 /**
375
 /**
376
  * \brief Reset the UDC
376
  * \brief Reset the UDC
377
  *
377
  *
378
  * The UDC must reset all configuration.
378
  * The UDC must reset all configuration.
379
  */
379
  */
380
-extern void udc_reset(void);
380
+extern void udc_reset();
381
 
381
 
382
 /**
382
 /**
383
  * \brief To signal that a SOF is occurred
383
  * \brief To signal that a SOF is occurred
384
  *
384
  *
385
  * The UDC must send the signal to all UDIs enabled
385
  * The UDC must send the signal to all UDIs enabled
386
  */
386
  */
387
-extern void udc_sof_notify(void);
387
+extern void udc_sof_notify();
388
 
388
 
389
 //@}
389
 //@}
390
 
390
 

+ 5
- 5
Marlin/src/HAL/HAL_DUE/usb/udi.h View File

82
 	 *
82
 	 *
83
 	 * \return \c 1 if function was successfully done, otherwise \c 0.
83
 	 * \return \c 1 if function was successfully done, otherwise \c 0.
84
 	 */
84
 	 */
85
-	bool (*enable)(void);
85
+	bool (*enable)();
86
 
86
 
87
 	/**
87
 	/**
88
 	 * \brief Disable the interface.
88
 	 * \brief Disable the interface.
95
 	 * - the device is detached from the host (i.e. Vbus is no
95
 	 * - the device is detached from the host (i.e. Vbus is no
96
 	 *   longer present)
96
 	 *   longer present)
97
 	 */
97
 	 */
98
-	void (*disable)(void);
98
+	void (*disable)();
99
 
99
 
100
 	/**
100
 	/**
101
 	 * \brief Handle a control request directed at an interface.
101
 	 * \brief Handle a control request directed at an interface.
108
 	 *
108
 	 *
109
 	 * \return \c 1 if this interface supports the SETUP request, otherwise \c 0.
109
 	 * \return \c 1 if this interface supports the SETUP request, otherwise \c 0.
110
 	 */
110
 	 */
111
-	bool (*setup)(void);
111
+	bool (*setup)();
112
 
112
 
113
 	/**
113
 	/**
114
 	 * \brief Returns the current setting of the selected interface.
114
 	 * \brief Returns the current setting of the selected interface.
117
 	 *
117
 	 *
118
 	 * \return alternate setting of selected interface
118
 	 * \return alternate setting of selected interface
119
 	 */
119
 	 */
120
-	uint8_t (*getsetting)(void);
120
+	uint8_t (*getsetting)();
121
 
121
 
122
 	/**
122
 	/**
123
 	 * \brief To signal that a SOF is occurred
123
 	 * \brief To signal that a SOF is occurred
124
 	 */
124
 	 */
125
-	void (*sof_notify)(void);
125
+	void (*sof_notify)();
126
 } udi_api_t;
126
 } udi_api_t;
127
 
127
 
128
 //@}
128
 //@}

+ 28
- 28
Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c View File

84
  *
84
  *
85
  * @{
85
  * @{
86
  */
86
  */
87
-bool udi_cdc_comm_enable(void);
88
-void udi_cdc_comm_disable(void);
89
-bool udi_cdc_comm_setup(void);
90
-bool udi_cdc_data_enable(void);
91
-void udi_cdc_data_disable(void);
92
-bool udi_cdc_data_setup(void);
93
-uint8_t udi_cdc_getsetting(void);
94
-void udi_cdc_data_sof_notify(void);
87
+bool udi_cdc_comm_enable();
88
+void udi_cdc_comm_disable();
89
+bool udi_cdc_comm_setup();
90
+bool udi_cdc_data_enable();
91
+void udi_cdc_data_disable();
92
+bool udi_cdc_data_setup();
93
+uint8_t udi_cdc_getsetting();
94
+void udi_cdc_data_sof_notify();
95
 UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm = {
95
 UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm = {
96
 	.enable = udi_cdc_comm_enable,
96
 	.enable = udi_cdc_comm_enable,
97
 	.disable = udi_cdc_comm_disable,
97
 	.disable = udi_cdc_comm_disable,
130
  *
130
  *
131
  * \return port number
131
  * \return port number
132
  */
132
  */
133
-static uint8_t udi_cdc_setup_to_port(void);
133
+static uint8_t udi_cdc_setup_to_port();
134
 
134
 
135
 /**
135
 /**
136
  * \brief Sends line coding to application
136
  * \brief Sends line coding to application
137
  *
137
  *
138
  * Called after SETUP request when line coding data is received.
138
  * Called after SETUP request when line coding data is received.
139
  */
139
  */
140
-static void udi_cdc_line_coding_received(void);
140
+static void udi_cdc_line_coding_received();
141
 
141
 
142
 /**
142
 /**
143
  * \brief Records new state
143
  * \brief Records new state
267
 
267
 
268
 //@}
268
 //@}
269
 
269
 
270
-bool udi_cdc_comm_enable(void)
270
+bool udi_cdc_comm_enable()
271
 {
271
 {
272
 	uint8_t port;
272
 	uint8_t port;
273
 	uint8_t iface_comm_num;
273
 	uint8_t iface_comm_num;
321
 	return true;
321
 	return true;
322
 }
322
 }
323
 
323
 
324
-bool udi_cdc_data_enable(void)
324
+bool udi_cdc_data_enable()
325
 {
325
 {
326
 	uint8_t port;
326
 	uint8_t port;
327
 
327
 
360
 	return true;
360
 	return true;
361
 }
361
 }
362
 
362
 
363
-void udi_cdc_comm_disable(void)
363
+void udi_cdc_comm_disable()
364
 {
364
 {
365
 	Assert(udi_cdc_nb_comm_enabled != 0);
365
 	Assert(udi_cdc_nb_comm_enabled != 0);
366
 	udi_cdc_nb_comm_enabled--;
366
 	udi_cdc_nb_comm_enabled--;
367
 }
367
 }
368
 
368
 
369
-void udi_cdc_data_disable(void)
369
+void udi_cdc_data_disable()
370
 {
370
 {
371
 	uint8_t port;
371
 	uint8_t port;
372
 
372
 
377
 	udi_cdc_data_running = false;
377
 	udi_cdc_data_running = false;
378
 }
378
 }
379
 
379
 
380
-bool udi_cdc_comm_setup(void)
380
+bool udi_cdc_comm_setup()
381
 {
381
 {
382
 	uint8_t port = udi_cdc_setup_to_port();
382
 	uint8_t port = udi_cdc_setup_to_port();
383
 
383
 
433
 	return false;  // request Not supported
433
 	return false;  // request Not supported
434
 }
434
 }
435
 
435
 
436
-bool udi_cdc_data_setup(void)
436
+bool udi_cdc_data_setup()
437
 {
437
 {
438
 	return false;  // request Not supported
438
 	return false;  // request Not supported
439
 }
439
 }
440
 
440
 
441
-uint8_t udi_cdc_getsetting(void)
441
+uint8_t udi_cdc_getsetting()
442
 {
442
 {
443
 	return 0;      // CDC don't have multiple alternate setting
443
 	return 0;      // CDC don't have multiple alternate setting
444
 }
444
 }
445
 
445
 
446
-void udi_cdc_data_sof_notify(void)
446
+void udi_cdc_data_sof_notify()
447
 {
447
 {
448
 	static uint8_t port_notify = 0;
448
 	static uint8_t port_notify = 0;
449
 
449
 
461
 // ------------------------
461
 // ------------------------
462
 //------- Internal routines to control serial line
462
 //------- Internal routines to control serial line
463
 
463
 
464
-static uint8_t udi_cdc_setup_to_port(void)
464
+static uint8_t udi_cdc_setup_to_port()
465
 {
465
 {
466
 	uint8_t port;
466
 	uint8_t port;
467
 
467
 
479
 	return port;
479
 	return port;
480
 }
480
 }
481
 
481
 
482
-static void udi_cdc_line_coding_received(void)
482
+static void udi_cdc_line_coding_received()
483
 {
483
 {
484
 	uint8_t port = udi_cdc_setup_to_port();
484
 	uint8_t port = udi_cdc_setup_to_port();
485
 	UNUSED(port);
485
 	UNUSED(port);
797
 	udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR);
797
 	udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR);
798
 }
798
 }
799
 
799
 
800
-void udi_cdc_signal_framing_error(void)
800
+void udi_cdc_signal_framing_error()
801
 {
801
 {
802
 	udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING);
802
 	udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING);
803
 }
803
 }
804
 
804
 
805
-void udi_cdc_signal_parity_error(void)
805
+void udi_cdc_signal_parity_error()
806
 {
806
 {
807
 	udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY);
807
 	udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY);
808
 }
808
 }
809
 
809
 
810
-void udi_cdc_signal_overrun(void)
810
+void udi_cdc_signal_overrun()
811
 {
811
 {
812
 	udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN);
812
 	udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN);
813
 }
813
 }
853
 	return nb_received;
853
 	return nb_received;
854
 }
854
 }
855
 
855
 
856
-iram_size_t udi_cdc_get_nb_received_data(void)
856
+iram_size_t udi_cdc_get_nb_received_data()
857
 {
857
 {
858
 	return udi_cdc_multi_get_nb_received_data(0);
858
 	return udi_cdc_multi_get_nb_received_data(0);
859
 }
859
 }
863
 	return (udi_cdc_multi_get_nb_received_data(port) > 0);
863
 	return (udi_cdc_multi_get_nb_received_data(port) > 0);
864
 }
864
 }
865
 
865
 
866
-bool udi_cdc_is_rx_ready(void)
866
+bool udi_cdc_is_rx_ready()
867
 {
867
 {
868
 	return udi_cdc_multi_is_rx_ready(0);
868
 	return udi_cdc_multi_is_rx_ready(0);
869
 }
869
 }
912
 	return rx_data;
912
 	return rx_data;
913
 }
913
 }
914
 
914
 
915
-int udi_cdc_getc(void)
915
+int udi_cdc_getc()
916
 {
916
 {
917
 	return udi_cdc_multi_getc(0);
917
 	return udi_cdc_multi_getc(0);
918
 }
918
 }
1041
 	return retval;
1041
 	return retval;
1042
 }
1042
 }
1043
 
1043
 
1044
-iram_size_t udi_cdc_get_free_tx_buffer(void)
1044
+iram_size_t udi_cdc_get_free_tx_buffer()
1045
 {
1045
 {
1046
 	return udi_cdc_multi_get_free_tx_buffer(0);
1046
 	return udi_cdc_multi_get_free_tx_buffer(0);
1047
 }
1047
 }
1051
 	return (udi_cdc_multi_get_free_tx_buffer(port) != 0);
1051
 	return (udi_cdc_multi_get_free_tx_buffer(port) != 0);
1052
 }
1052
 }
1053
 
1053
 
1054
-bool udi_cdc_is_tx_ready(void)
1054
+bool udi_cdc_is_tx_ready()
1055
 {
1055
 {
1056
 	return udi_cdc_multi_is_tx_ready(0);
1056
 	return udi_cdc_multi_is_tx_ready(0);
1057
 }
1057
 }

+ 16
- 16
Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h View File

366
 /**
366
 /**
367
  * \brief Notify a framing error
367
  * \brief Notify a framing error
368
  */
368
  */
369
-void udi_cdc_signal_framing_error(void);
369
+void udi_cdc_signal_framing_error();
370
 
370
 
371
 /**
371
 /**
372
  * \brief Notify a parity error
372
  * \brief Notify a parity error
373
  */
373
  */
374
-void udi_cdc_signal_parity_error(void);
374
+void udi_cdc_signal_parity_error();
375
 
375
 
376
 /**
376
 /**
377
  * \brief Notify a overrun
377
  * \brief Notify a overrun
378
  */
378
  */
379
-void udi_cdc_signal_overrun(void);
379
+void udi_cdc_signal_overrun();
380
 
380
 
381
 /**
381
 /**
382
  * \brief Gets the number of byte received
382
  * \brief Gets the number of byte received
383
  *
383
  *
384
  * \return the number of data available
384
  * \return the number of data available
385
  */
385
  */
386
-iram_size_t udi_cdc_get_nb_received_data(void);
386
+iram_size_t udi_cdc_get_nb_received_data();
387
 
387
 
388
 /**
388
 /**
389
  * \brief This function checks if a character has been received on the CDC line
389
  * \brief This function checks if a character has been received on the CDC line
390
  *
390
  *
391
  * \return \c 1 if a byte is ready to be read.
391
  * \return \c 1 if a byte is ready to be read.
392
  */
392
  */
393
-bool udi_cdc_is_rx_ready(void);
393
+bool udi_cdc_is_rx_ready();
394
 
394
 
395
 /**
395
 /**
396
  * \brief Waits and gets a value on CDC line
396
  * \brief Waits and gets a value on CDC line
397
  *
397
  *
398
  * \return value read on CDC line
398
  * \return value read on CDC line
399
  */
399
  */
400
-int udi_cdc_getc(void);
400
+int udi_cdc_getc();
401
 
401
 
402
 /**
402
 /**
403
  * \brief Reads a RAM buffer on CDC line
403
  * \brief Reads a RAM buffer on CDC line
425
  *
425
  *
426
  * \return the number of free byte in TX buffer
426
  * \return the number of free byte in TX buffer
427
  */
427
  */
428
-iram_size_t udi_cdc_get_free_tx_buffer(void);
428
+iram_size_t udi_cdc_get_free_tx_buffer();
429
 
429
 
430
 /**
430
 /**
431
  * \brief This function checks if a new character sent is possible
431
  * \brief This function checks if a new character sent is possible
433
  *
433
  *
434
  * \return \c 1 if a new character can be sent
434
  * \return \c 1 if a new character can be sent
435
  */
435
  */
436
-bool udi_cdc_is_tx_ready(void);
436
+bool udi_cdc_is_tx_ready();
437
 
437
 
438
 /**
438
 /**
439
  * \brief Puts a byte on CDC line
439
  * \brief Puts a byte on CDC line
611
  * Content of conf_usb.h:
611
  * Content of conf_usb.h:
612
  * \code
612
  * \code
613
 	 #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable()
613
 	 #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable()
614
-	 extern bool my_callback_cdc_enable(void);
614
+	 extern bool my_callback_cdc_enable();
615
 	 #define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable()
615
 	 #define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable()
616
-	 extern void my_callback_cdc_disable(void);
616
+	 extern void my_callback_cdc_disable();
617
 	 #define  UDI_CDC_LOW_RATE
617
 	 #define  UDI_CDC_LOW_RATE
618
 
618
 
619
 	 #define  UDI_CDC_DEFAULT_RATE             115200
619
 	 #define  UDI_CDC_DEFAULT_RATE             115200
627
  * Add to application C-file:
627
  * Add to application C-file:
628
  * \code
628
  * \code
629
 	 static bool my_flag_autorize_cdc_transfert = false;
629
 	 static bool my_flag_autorize_cdc_transfert = false;
630
-	 bool my_callback_cdc_enable(void)
630
+	 bool my_callback_cdc_enable()
631
 	 {
631
 	 {
632
 	    my_flag_autorize_cdc_transfert = true;
632
 	    my_flag_autorize_cdc_transfert = true;
633
 	    return true;
633
 	    return true;
634
 	 }
634
 	 }
635
-	 void my_callback_cdc_disable(void)
635
+	 void my_callback_cdc_disable()
636
 	 {
636
 	 {
637
 	    my_flag_autorize_cdc_transfert = false;
637
 	    my_flag_autorize_cdc_transfert = false;
638
 	 }
638
 	 }
639
 
639
 
640
-	 void task(void)
640
+	 void task()
641
 	 {
641
 	 {
642
 	    if (my_flag_autorize_cdc_transfert) {
642
 	    if (my_flag_autorize_cdc_transfert) {
643
 	        udi_cdc_putc('A');
643
 	        udi_cdc_putc('A');
652
  *   - \code #define USB_DEVICE_SERIAL_NAME  "12...EF" // Disk SN for CDC \endcode
652
  *   - \code #define USB_DEVICE_SERIAL_NAME  "12...EF" // Disk SN for CDC \endcode
653
  *     \note The USB serial number is mandatory when a CDC interface is used.
653
  *     \note The USB serial number is mandatory when a CDC interface is used.
654
  *   - \code #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable()
654
  *   - \code #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable()
655
-	 extern bool my_callback_cdc_enable(void); \endcode
655
+	 extern bool my_callback_cdc_enable(); \endcode
656
  *     \note After the device enumeration (detecting and identifying USB devices),
656
  *     \note After the device enumeration (detecting and identifying USB devices),
657
  *     the USB host starts the device configuration. When the USB CDC interface
657
  *     the USB host starts the device configuration. When the USB CDC interface
658
  *     from the device is accepted by the host, the USB host enables this interface and the
658
  *     from the device is accepted by the host, the USB host enables this interface and the
659
  *     UDI_CDC_ENABLE_EXT() callback function is called and return true.
659
  *     UDI_CDC_ENABLE_EXT() callback function is called and return true.
660
  *     Thus, when this event is received, the data transfer on CDC interface are authorized.
660
  *     Thus, when this event is received, the data transfer on CDC interface are authorized.
661
  *   - \code #define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable()
661
  *   - \code #define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable()
662
-	 extern void my_callback_cdc_disable(void); \endcode
662
+	 extern void my_callback_cdc_disable(); \endcode
663
  *     \note When the USB device is unplugged or is reset by the USB host, the USB
663
  *     \note When the USB device is unplugged or is reset by the USB host, the USB
664
  *     interface is disabled and the UDI_CDC_DISABLE_EXT() callback function
664
  *     interface is disabled and the UDI_CDC_DISABLE_EXT() callback function
665
  *     is called. Thus, the data transfer must be stopped on CDC interface.
665
  *     is called. Thus, the data transfer must be stopped on CDC interface.
673
  *     \note Default configuration of communication port at startup.
673
  *     \note Default configuration of communication port at startup.
674
  * -# Send or wait data on CDC line:
674
  * -# Send or wait data on CDC line:
675
  *   - \code // Waits and gets a value on CDC line
675
  *   - \code // Waits and gets a value on CDC line
676
-	int udi_cdc_getc(void);
676
+	int udi_cdc_getc();
677
 	// Reads a RAM buffer on CDC line
677
 	// Reads a RAM buffer on CDC line
678
 	iram_size_t udi_cdc_read_buf(int* buf, iram_size_t size);
678
 	iram_size_t udi_cdc_read_buf(int* buf, iram_size_t size);
679
 	// Puts a byte on CDC line
679
 	// Puts a byte on CDC line

+ 49
- 49
Marlin/src/HAL/HAL_DUE/usb/udi_msc.c View File

71
  *
71
  *
72
  * @{
72
  * @{
73
  */
73
  */
74
-bool udi_msc_enable(void);
75
-void udi_msc_disable(void);
76
-bool udi_msc_setup(void);
77
-uint8_t udi_msc_getsetting(void);
74
+bool udi_msc_enable();
75
+void udi_msc_disable();
76
+bool udi_msc_setup();
77
+uint8_t udi_msc_getsetting();
78
 
78
 
79
 //! Global structure which contains standard UDI API for UDC
79
 //! Global structure which contains standard UDI API for UDC
80
 UDC_DESC_STORAGE udi_api_t udi_api_msc = {
80
 UDC_DESC_STORAGE udi_api_t udi_api_msc = {
151
 /**
151
 /**
152
  * \brief Stall CBW request
152
  * \brief Stall CBW request
153
  */
153
  */
154
-static void udi_msc_cbw_invalid(void);
154
+static void udi_msc_cbw_invalid();
155
 
155
 
156
 /**
156
 /**
157
  * \brief Stall CSW request
157
  * \brief Stall CSW request
158
  */
158
  */
159
-static void udi_msc_csw_invalid(void);
159
+static void udi_msc_csw_invalid();
160
 
160
 
161
 /**
161
 /**
162
  * \brief Links a callback and buffer on endpoint OUT reception
162
  * \brief Links a callback and buffer on endpoint OUT reception
165
  * - enable interface
165
  * - enable interface
166
  * - at the end of previous command after sending the CSW
166
  * - at the end of previous command after sending the CSW
167
  */
167
  */
168
-static void udi_msc_cbw_wait(void);
168
+static void udi_msc_cbw_wait();
169
 
169
 
170
 /**
170
 /**
171
  * \brief Callback called after CBW reception
171
  * \brief Callback called after CBW reception
228
  *
228
  *
229
  * Called at the end of SCSI command
229
  * Called at the end of SCSI command
230
  */
230
  */
231
-static void udi_msc_csw_process(void);
231
+static void udi_msc_csw_process();
232
 
232
 
233
 /**
233
 /**
234
  * \brief Sends CSW
234
  * \brief Sends CSW
236
  * Called by #udi_msc_csw_process()
236
  * Called by #udi_msc_csw_process()
237
  * or UDD callback when endpoint halt is cleared
237
  * or UDD callback when endpoint halt is cleared
238
  */
238
  */
239
-void udi_msc_csw_send(void);
239
+void udi_msc_csw_send();
240
 
240
 
241
 /**
241
 /**
242
  * \brief Callback called after CSW sent
242
  * \brief Callback called after CSW sent
259
 /**
259
 /**
260
  * \brief Reinitialize sense data.
260
  * \brief Reinitialize sense data.
261
  */
261
  */
262
-static void udi_msc_clear_sense(void);
262
+static void udi_msc_clear_sense();
263
 
263
 
264
 /**
264
 /**
265
  * \brief Update sense data with new value to signal a fail
265
  * \brief Update sense data with new value to signal a fail
274
 /**
274
 /**
275
  * \brief Update sense data with new value to signal success
275
  * \brief Update sense data with new value to signal success
276
  */
276
  */
277
-static void udi_msc_sense_pass(void);
277
+static void udi_msc_sense_pass();
278
 
278
 
279
 /**
279
 /**
280
  * \brief Update sense data to signal that memory is not present
280
  * \brief Update sense data to signal that memory is not present
281
  */
281
  */
282
-static void udi_msc_sense_fail_not_present(void);
282
+static void udi_msc_sense_fail_not_present();
283
 
283
 
284
 /**
284
 /**
285
  * \brief Update sense data to signal that memory is busy
285
  * \brief Update sense data to signal that memory is busy
286
  */
286
  */
287
-static void udi_msc_sense_fail_busy_or_change(void);
287
+static void udi_msc_sense_fail_busy_or_change();
288
 
288
 
289
 /**
289
 /**
290
  * \brief Update sense data to signal a hardware error on memory
290
  * \brief Update sense data to signal a hardware error on memory
291
  */
291
  */
292
-static void udi_msc_sense_fail_hardware(void);
292
+static void udi_msc_sense_fail_hardware();
293
 
293
 
294
 /**
294
 /**
295
  * \brief Update sense data to signal that memory is protected
295
  * \brief Update sense data to signal that memory is protected
296
  */
296
  */
297
-static void udi_msc_sense_fail_protected(void);
297
+static void udi_msc_sense_fail_protected();
298
 
298
 
299
 /**
299
 /**
300
  * \brief Update sense data to signal that CDB fields are not valid
300
  * \brief Update sense data to signal that CDB fields are not valid
301
  */
301
  */
302
-static void udi_msc_sense_fail_cdb_invalid(void);
302
+static void udi_msc_sense_fail_cdb_invalid();
303
 
303
 
304
 /**
304
 /**
305
  * \brief Update sense data to signal that command is not supported
305
  * \brief Update sense data to signal that command is not supported
306
  */
306
  */
307
-static void udi_msc_sense_command_invalid(void);
307
+static void udi_msc_sense_command_invalid();
308
 //@}
308
 //@}
309
 
309
 
310
 
310
 
317
  * \brief Process SPC Request Sense command
317
  * \brief Process SPC Request Sense command
318
  * Returns error information about last command
318
  * Returns error information about last command
319
  */
319
  */
320
-static void udi_msc_spc_requestsense(void);
320
+static void udi_msc_spc_requestsense();
321
 
321
 
322
 /**
322
 /**
323
  * \brief Process SPC Inquiry command
323
  * \brief Process SPC Inquiry command
324
  * Returns information (name,version) about disk
324
  * Returns information (name,version) about disk
325
  */
325
  */
326
-static void udi_msc_spc_inquiry(void);
326
+static void udi_msc_spc_inquiry();
327
 
327
 
328
 /**
328
 /**
329
  * \brief Checks state of disk
329
  * \brief Checks state of disk
330
  *
330
  *
331
  * \retval true if disk is ready, otherwise false and updates sense data
331
  * \retval true if disk is ready, otherwise false and updates sense data
332
  */
332
  */
333
-static bool udi_msc_spc_testunitready_global(void);
333
+static bool udi_msc_spc_testunitready_global();
334
 
334
 
335
 /**
335
 /**
336
  * \brief Process test unit ready command
336
  * \brief Process test unit ready command
337
  * Returns state of logical unit
337
  * Returns state of logical unit
338
  */
338
  */
339
-static void udi_msc_spc_testunitready(void);
339
+static void udi_msc_spc_testunitready();
340
 
340
 
341
 /**
341
 /**
342
  * \brief Process prevent allow medium removal command
342
  * \brief Process prevent allow medium removal command
343
  */
343
  */
344
-static void udi_msc_spc_prevent_allow_medium_removal(void);
344
+static void udi_msc_spc_prevent_allow_medium_removal();
345
 
345
 
346
 /**
346
 /**
347
  * \brief Process mode sense command
347
  * \brief Process mode sense command
354
 /**
354
 /**
355
  * \brief Process start stop command
355
  * \brief Process start stop command
356
  */
356
  */
357
-static void udi_msc_sbc_start_stop(void);
357
+static void udi_msc_sbc_start_stop();
358
 
358
 
359
 /**
359
 /**
360
  * \brief Process read capacity command
360
  * \brief Process read capacity command
361
  */
361
  */
362
-static void udi_msc_sbc_read_capacity(void);
362
+static void udi_msc_sbc_read_capacity();
363
 
363
 
364
 /**
364
 /**
365
  * \brief Process read10 or write10 command
365
  * \brief Process read10 or write10 command
373
 //@}
373
 //@}
374
 
374
 
375
 
375
 
376
-bool udi_msc_enable(void)
376
+bool udi_msc_enable()
377
 {
377
 {
378
   uint8_t lun;
378
   uint8_t lun;
379
   udi_msc_b_trans_req = false;
379
   udi_msc_b_trans_req = false;
398
 }
398
 }
399
 
399
 
400
 
400
 
401
-void udi_msc_disable(void)
401
+void udi_msc_disable()
402
 {
402
 {
403
   udi_msc_b_trans_req = false;
403
   udi_msc_b_trans_req = false;
404
   udi_msc_b_ack_trans = true;
404
   udi_msc_b_ack_trans = true;
407
 }
407
 }
408
 
408
 
409
 
409
 
410
-bool udi_msc_setup(void)
410
+bool udi_msc_setup()
411
 {
411
 {
412
   if (Udd_setup_is_in()) {
412
   if (Udd_setup_is_in()) {
413
     // Requests Interface GET
413
     // Requests Interface GET
451
   return false; // Not supported request
451
   return false; // Not supported request
452
 }
452
 }
453
 
453
 
454
-uint8_t udi_msc_getsetting(void)
454
+uint8_t udi_msc_getsetting()
455
 {
455
 {
456
   return 0; // MSC don't have multiple alternate setting
456
   return 0; // MSC don't have multiple alternate setting
457
 }
457
 }
460
 // ------------------------
460
 // ------------------------
461
 //------- Routines to process CBW packet
461
 //------- Routines to process CBW packet
462
 
462
 
463
-static void udi_msc_cbw_invalid(void)
463
+static void udi_msc_cbw_invalid()
464
 {
464
 {
465
   if (!udi_msc_b_cbw_invalid)
465
   if (!udi_msc_b_cbw_invalid)
466
     return; // Don't re-stall endpoint if error reseted by setup
466
     return; // Don't re-stall endpoint if error reseted by setup
469
   udd_ep_wait_stall_clear(UDI_MSC_EP_OUT, udi_msc_cbw_invalid);
469
   udd_ep_wait_stall_clear(UDI_MSC_EP_OUT, udi_msc_cbw_invalid);
470
 }
470
 }
471
 
471
 
472
-static void udi_msc_csw_invalid(void)
472
+static void udi_msc_csw_invalid()
473
 {
473
 {
474
   if (!udi_msc_b_cbw_invalid)
474
   if (!udi_msc_b_cbw_invalid)
475
     return; // Don't re-stall endpoint if error reseted by setup
475
     return; // Don't re-stall endpoint if error reseted by setup
478
   udd_ep_wait_stall_clear(UDI_MSC_EP_IN, udi_msc_csw_invalid);
478
   udd_ep_wait_stall_clear(UDI_MSC_EP_IN, udi_msc_csw_invalid);
479
 }
479
 }
480
 
480
 
481
-static void udi_msc_cbw_wait(void)
481
+static void udi_msc_cbw_wait()
482
 {
482
 {
483
   // Register buffer and callback on OUT endpoint
483
   // Register buffer and callback on OUT endpoint
484
   if (!udd_ep_run(UDI_MSC_EP_OUT, true,
484
   if (!udd_ep_run(UDI_MSC_EP_OUT, true,
648
 // ------------------------
648
 // ------------------------
649
 //------- Routines to process CSW packet
649
 //------- Routines to process CSW packet
650
 
650
 
651
-static void udi_msc_csw_process(void)
651
+static void udi_msc_csw_process()
652
 {
652
 {
653
   if (0 != udi_msc_csw.dCSWDataResidue) {
653
   if (0 != udi_msc_csw.dCSWDataResidue) {
654
     // Residue not NULL
654
     // Residue not NULL
665
 }
665
 }
666
 
666
 
667
 
667
 
668
-void udi_msc_csw_send(void)
668
+void udi_msc_csw_send()
669
 {
669
 {
670
   // Sends CSW on IN endpoint
670
   // Sends CSW on IN endpoint
671
   if (!udd_ep_run(UDI_MSC_EP_IN, false,
671
   if (!udd_ep_run(UDI_MSC_EP_IN, false,
694
 // ------------------------
694
 // ------------------------
695
 //------- Routines manage sense data
695
 //------- Routines manage sense data
696
 
696
 
697
-static void udi_msc_clear_sense(void)
697
+static void udi_msc_clear_sense()
698
 {
698
 {
699
   memset((uint8_t*)&udi_msc_sense, 0, sizeof(struct scsi_request_sense_data));
699
   memset((uint8_t*)&udi_msc_sense, 0, sizeof(struct scsi_request_sense_data));
700
   udi_msc_sense.valid_reponse_code = SCSI_SENSE_VALID | SCSI_SENSE_CURRENT;
700
   udi_msc_sense.valid_reponse_code = SCSI_SENSE_VALID | SCSI_SENSE_CURRENT;
715
   udi_msc_sense.AddSnsCodeQlfr = add_sense;
715
   udi_msc_sense.AddSnsCodeQlfr = add_sense;
716
 }
716
 }
717
 
717
 
718
-static void udi_msc_sense_pass(void)
718
+static void udi_msc_sense_pass()
719
 {
719
 {
720
   udi_msc_clear_sense();
720
   udi_msc_clear_sense();
721
   udi_msc_csw.bCSWStatus = USB_CSW_STATUS_PASS;
721
   udi_msc_csw.bCSWStatus = USB_CSW_STATUS_PASS;
722
 }
722
 }
723
 
723
 
724
 
724
 
725
-static void udi_msc_sense_fail_not_present(void)
725
+static void udi_msc_sense_fail_not_present()
726
 {
726
 {
727
   udi_msc_sense_fail(SCSI_SK_NOT_READY, SCSI_ASC_MEDIUM_NOT_PRESENT, 0);
727
   udi_msc_sense_fail(SCSI_SK_NOT_READY, SCSI_ASC_MEDIUM_NOT_PRESENT, 0);
728
 }
728
 }
729
 
729
 
730
-static void udi_msc_sense_fail_busy_or_change(void)
730
+static void udi_msc_sense_fail_busy_or_change()
731
 {
731
 {
732
   udi_msc_sense_fail(SCSI_SK_UNIT_ATTENTION,
732
   udi_msc_sense_fail(SCSI_SK_UNIT_ATTENTION,
733
       SCSI_ASC_NOT_READY_TO_READY_CHANGE, 0);
733
       SCSI_ASC_NOT_READY_TO_READY_CHANGE, 0);
734
 }
734
 }
735
 
735
 
736
-static void udi_msc_sense_fail_hardware(void)
736
+static void udi_msc_sense_fail_hardware()
737
 {
737
 {
738
   udi_msc_sense_fail(SCSI_SK_HARDWARE_ERROR,
738
   udi_msc_sense_fail(SCSI_SK_HARDWARE_ERROR,
739
       SCSI_ASC_NO_ADDITIONAL_SENSE_INFO, 0);
739
       SCSI_ASC_NO_ADDITIONAL_SENSE_INFO, 0);
740
 }
740
 }
741
 
741
 
742
-static void udi_msc_sense_fail_protected(void)
742
+static void udi_msc_sense_fail_protected()
743
 {
743
 {
744
   udi_msc_sense_fail(SCSI_SK_DATA_PROTECT, SCSI_ASC_WRITE_PROTECTED, 0);
744
   udi_msc_sense_fail(SCSI_SK_DATA_PROTECT, SCSI_ASC_WRITE_PROTECTED, 0);
745
 }
745
 }
746
 
746
 
747
-static void udi_msc_sense_fail_cdb_invalid(void)
747
+static void udi_msc_sense_fail_cdb_invalid()
748
 {
748
 {
749
   udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST,
749
   udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST,
750
       SCSI_ASC_INVALID_FIELD_IN_CDB, 0);
750
       SCSI_ASC_INVALID_FIELD_IN_CDB, 0);
751
 }
751
 }
752
 
752
 
753
-static void udi_msc_sense_command_invalid(void)
753
+static void udi_msc_sense_command_invalid()
754
 {
754
 {
755
   udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST,
755
   udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST,
756
       SCSI_ASC_INVALID_COMMAND_OPERATION_CODE, 0);
756
       SCSI_ASC_INVALID_COMMAND_OPERATION_CODE, 0);
760
 // ------------------------
760
 // ------------------------
761
 //------- Routines manage SCSI Commands
761
 //------- Routines manage SCSI Commands
762
 
762
 
763
-static void udi_msc_spc_requestsense(void)
763
+static void udi_msc_spc_requestsense()
764
 {
764
 {
765
   uint8_t length = udi_msc_cbw.CDB[4];
765
   uint8_t length = udi_msc_cbw.CDB[4];
766
 
766
 
775
 }
775
 }
776
 
776
 
777
 
777
 
778
-static void udi_msc_spc_inquiry(void)
778
+static void udi_msc_spc_inquiry()
779
 {
779
 {
780
   uint8_t length, i;
780
   uint8_t length, i;
781
   UDC_DATA(4)
781
   UDC_DATA(4)
836
 }
836
 }
837
 
837
 
838
 
838
 
839
-static bool udi_msc_spc_testunitready_global(void)
839
+static bool udi_msc_spc_testunitready_global()
840
 {
840
 {
841
   switch (mem_test_unit_ready(udi_msc_cbw.bCBWLUN)) {
841
   switch (mem_test_unit_ready(udi_msc_cbw.bCBWLUN)) {
842
   case CTRL_GOOD:
842
   case CTRL_GOOD:
856
 }
856
 }
857
 
857
 
858
 
858
 
859
-static void udi_msc_spc_testunitready(void)
859
+static void udi_msc_spc_testunitready()
860
 {
860
 {
861
   if (udi_msc_spc_testunitready_global()) {
861
   if (udi_msc_spc_testunitready_global()) {
862
     // LUN ready, then update sense data with status pass
862
     // LUN ready, then update sense data with status pass
944
 }
944
 }
945
 
945
 
946
 
946
 
947
-static void udi_msc_spc_prevent_allow_medium_removal(void)
947
+static void udi_msc_spc_prevent_allow_medium_removal()
948
 {
948
 {
949
   uint8_t prevent = udi_msc_cbw.CDB[4];
949
   uint8_t prevent = udi_msc_cbw.CDB[4];
950
   if (0 == prevent) {
950
   if (0 == prevent) {
956
 }
956
 }
957
 
957
 
958
 
958
 
959
-static void udi_msc_sbc_start_stop(void)
959
+static void udi_msc_sbc_start_stop()
960
 {
960
 {
961
   bool start = 0x1 & udi_msc_cbw.CDB[4];
961
   bool start = 0x1 & udi_msc_cbw.CDB[4];
962
   bool loej = 0x2 & udi_msc_cbw.CDB[4];
962
   bool loej = 0x2 & udi_msc_cbw.CDB[4];
968
 }
968
 }
969
 
969
 
970
 
970
 
971
-static void udi_msc_sbc_read_capacity(void)
971
+static void udi_msc_sbc_read_capacity()
972
 {
972
 {
973
   UDC_BSS(4) static struct sbc_read_capacity10_data udi_msc_capacity;
973
   UDC_BSS(4) static struct sbc_read_capacity10_data udi_msc_capacity;
974
 
974
 
1039
 }
1039
 }
1040
 
1040
 
1041
 
1041
 
1042
-bool udi_msc_process_trans(void)
1042
+bool udi_msc_process_trans()
1043
 {
1043
 {
1044
   Ctrl_status status;
1044
   Ctrl_status status;
1045
 
1045
 

+ 10
- 10
Marlin/src/HAL/HAL_DUE/usb/udi_msc.h View File

148
  *
148
  *
149
  * Routine called by the main loop
149
  * Routine called by the main loop
150
  */
150
  */
151
-bool udi_msc_process_trans(void);
151
+bool udi_msc_process_trans();
152
 
152
 
153
 /**
153
 /**
154
  * \brief Transfers data to/from USB MSC endpoints
154
  * \brief Transfers data to/from USB MSC endpoints
206
 	#define UDI_MSC_GLOBAL_PRODUCT_VERSION \
206
 	#define UDI_MSC_GLOBAL_PRODUCT_VERSION \
207
 	   '1', '.', '0', '0'
207
 	   '1', '.', '0', '0'
208
 	#define UDI_MSC_ENABLE_EXT() my_callback_msc_enable()
208
 	#define UDI_MSC_ENABLE_EXT() my_callback_msc_enable()
209
-	extern bool my_callback_msc_enable(void);
209
+	extern bool my_callback_msc_enable();
210
 	#define UDI_MSC_DISABLE_EXT() my_callback_msc_disable()
210
 	#define UDI_MSC_DISABLE_EXT() my_callback_msc_disable()
211
-	extern void my_callback_msc_disable(void);
211
+	extern void my_callback_msc_disable();
212
 	#include "udi_msc_conf.h" // At the end of conf_usb.h file
212
 	#include "udi_msc_conf.h" // At the end of conf_usb.h file
213
 \endcode
213
 \endcode
214
  *
214
  *
215
  * Add to application C-file:
215
  * Add to application C-file:
216
  * \code
216
  * \code
217
 	 static bool my_flag_autorize_msc_transfert = false;
217
 	 static bool my_flag_autorize_msc_transfert = false;
218
-	 bool my_callback_msc_enable(void)
218
+	 bool my_callback_msc_enable()
219
 	 {
219
 	 {
220
 	    my_flag_autorize_msc_transfert = true;
220
 	    my_flag_autorize_msc_transfert = true;
221
 	    return true;
221
 	    return true;
222
 	 }
222
 	 }
223
-	 void my_callback_msc_disable(void)
223
+	 void my_callback_msc_disable()
224
 	 {
224
 	 {
225
 	    my_flag_autorize_msc_transfert = false;
225
 	    my_flag_autorize_msc_transfert = false;
226
 	 }
226
 	 }
227
 
227
 
228
-	 void task(void)
228
+	 void task()
229
 	 {
229
 	 {
230
 	    udi_msc_process_trans();
230
 	    udi_msc_process_trans();
231
 	 }
231
 	 }
244
  *     \note The USB MSC interface requires a vendor ID (8 ASCII characters)
244
  *     \note The USB MSC interface requires a vendor ID (8 ASCII characters)
245
  *     and a product version (4 ASCII characters).
245
  *     and a product version (4 ASCII characters).
246
  *   - \code #define UDI_MSC_ENABLE_EXT() my_callback_msc_enable()
246
  *   - \code #define UDI_MSC_ENABLE_EXT() my_callback_msc_enable()
247
-	extern bool my_callback_msc_enable(void); \endcode
247
+	extern bool my_callback_msc_enable(); \endcode
248
  *     \note After the device enumeration (detecting and identifying USB devices),
248
  *     \note After the device enumeration (detecting and identifying USB devices),
249
  *     the USB host starts the device configuration. When the USB MSC interface
249
  *     the USB host starts the device configuration. When the USB MSC interface
250
  *     from the device is accepted by the host, the USB host enables this interface and the
250
  *     from the device is accepted by the host, the USB host enables this interface and the
252
  *     Thus, when this event is received, the tasks which call
252
  *     Thus, when this event is received, the tasks which call
253
  *     udi_msc_process_trans() must be enabled.
253
  *     udi_msc_process_trans() must be enabled.
254
  *   - \code #define UDI_MSC_DISABLE_EXT() my_callback_msc_disable()
254
  *   - \code #define UDI_MSC_DISABLE_EXT() my_callback_msc_disable()
255
-	extern void my_callback_msc_disable(void); \endcode
255
+	extern void my_callback_msc_disable(); \endcode
256
  *     \note When the USB device is unplugged or is reset by the USB host, the USB
256
  *     \note When the USB device is unplugged or is reset by the USB host, the USB
257
  *     interface is disabled and the UDI_MSC_DISABLE_EXT() callback function
257
  *     interface is disabled and the UDI_MSC_DISABLE_EXT() callback function
258
  *     is called. Thus, it is recommended to disable the task which is called udi_msc_process_trans().
258
  *     is called. Thus, it is recommended to disable the task which is called udi_msc_process_trans().
260
  * which provides the memories interfaces. However, the memory data transfers
260
  * which provides the memories interfaces. However, the memory data transfers
261
  * must be done outside USB interrupt routine. This is done in the MSC process
261
  * must be done outside USB interrupt routine. This is done in the MSC process
262
  * ("udi_msc_process_trans()") called by main loop:
262
  * ("udi_msc_process_trans()") called by main loop:
263
- *   - \code  * void task(void) {
263
+ *   - \code  * void task() {
264
 	udi_msc_process_trans();
264
 	udi_msc_process_trans();
265
 	} \endcode
265
 	} \endcode
266
  * -# The MSC speed depends on task periodicity. To get the best speed
266
  * -# The MSC speed depends on task periodicity. To get the best speed
267
  * the notification callback "UDI_MSC_NOTIFY_TRANS_EXT" can be used to wakeup
267
  * the notification callback "UDI_MSC_NOTIFY_TRANS_EXT" can be used to wakeup
268
  * this task (Example, through a mutex):
268
  * this task (Example, through a mutex):
269
  *   - \code #define  UDI_MSC_NOTIFY_TRANS_EXT()    msc_notify_trans()
269
  *   - \code #define  UDI_MSC_NOTIFY_TRANS_EXT()    msc_notify_trans()
270
-	void msc_notify_trans(void) {
270
+	void msc_notify_trans() {
271
 	wakeup_my_task();
271
 	wakeup_my_task();
272
 	} \endcode
272
 	} \endcode
273
  *
273
  *

+ 46
- 46
Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c View File

357
  *
357
  *
358
  * Called after a USB line reset or when UDD is enabled
358
  * Called after a USB line reset or when UDD is enabled
359
  */
359
  */
360
-static void udd_reset_ep_ctrl(void);
360
+static void udd_reset_ep_ctrl();
361
 
361
 
362
 /**
362
 /**
363
  * \brief Reset control endpoint management
363
  * \brief Reset control endpoint management
364
  *
364
  *
365
  * Called after a USB line reset or at the end of SETUP request (after ZLP)
365
  * Called after a USB line reset or at the end of SETUP request (after ZLP)
366
  */
366
  */
367
-static void udd_ctrl_init(void);
367
+static void udd_ctrl_init();
368
 
368
 
369
 //! \brief Managed reception of SETUP packet on control endpoint
369
 //! \brief Managed reception of SETUP packet on control endpoint
370
-static void udd_ctrl_setup_received(void);
370
+static void udd_ctrl_setup_received();
371
 
371
 
372
 //! \brief Managed reception of IN packet on control endpoint
372
 //! \brief Managed reception of IN packet on control endpoint
373
-static void udd_ctrl_in_sent(void);
373
+static void udd_ctrl_in_sent();
374
 
374
 
375
 //! \brief Managed reception of OUT packet on control endpoint
375
 //! \brief Managed reception of OUT packet on control endpoint
376
-static void udd_ctrl_out_received(void);
376
+static void udd_ctrl_out_received();
377
 
377
 
378
 //! \brief Managed underflow event of IN packet on control endpoint
378
 //! \brief Managed underflow event of IN packet on control endpoint
379
-static void udd_ctrl_underflow(void);
379
+static void udd_ctrl_underflow();
380
 
380
 
381
 //! \brief Managed overflow event of OUT packet on control endpoint
381
 //! \brief Managed overflow event of OUT packet on control endpoint
382
-static void udd_ctrl_overflow(void);
382
+static void udd_ctrl_overflow();
383
 
383
 
384
 //! \brief Managed stall event of IN/OUT packet on control endpoint
384
 //! \brief Managed stall event of IN/OUT packet on control endpoint
385
-static void udd_ctrl_stall_data(void);
385
+static void udd_ctrl_stall_data();
386
 
386
 
387
 //! \brief Send a ZLP IN on control endpoint
387
 //! \brief Send a ZLP IN on control endpoint
388
-static void udd_ctrl_send_zlp_in(void);
388
+static void udd_ctrl_send_zlp_in();
389
 
389
 
390
 //! \brief Send a ZLP OUT on control endpoint
390
 //! \brief Send a ZLP OUT on control endpoint
391
-static void udd_ctrl_send_zlp_out(void);
391
+static void udd_ctrl_send_zlp_out();
392
 
392
 
393
 //! \brief Call callback associated to setup request
393
 //! \brief Call callback associated to setup request
394
-static void udd_ctrl_endofrequest(void);
394
+static void udd_ctrl_endofrequest();
395
 
395
 
396
 
396
 
397
 /**
397
 /**
401
  *
401
  *
402
  * \return \c 1 if an event about control endpoint is occured, otherwise \c 0.
402
  * \return \c 1 if an event about control endpoint is occured, otherwise \c 0.
403
  */
403
  */
404
-static bool udd_ctrl_interrupt(void);
404
+static bool udd_ctrl_interrupt();
405
 
405
 
406
 //@}
406
 //@}
407
 
407
 
448
 static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP];
448
 static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP];
449
 
449
 
450
 //! \brief Reset all job table
450
 //! \brief Reset all job table
451
-static void udd_ep_job_table_reset(void);
451
+static void udd_ep_job_table_reset();
452
 
452
 
453
 //! \brief Abort all endpoint jobs on going
453
 //! \brief Abort all endpoint jobs on going
454
-static void udd_ep_job_table_kill(void);
454
+static void udd_ep_job_table_kill();
455
 
455
 
456
 #ifdef UDD_EP_FIFO_SUPPORTED
456
 #ifdef UDD_EP_FIFO_SUPPORTED
457
 	/**
457
 	/**
500
  *
500
  *
501
  * \return \c 1 if an event about bulk/interrupt/isochronous endpoints has occured, otherwise \c 0.
501
  * \return \c 1 if an event about bulk/interrupt/isochronous endpoints has occured, otherwise \c 0.
502
  */
502
  */
503
-static bool udd_ep_interrupt(void);
503
+static bool udd_ep_interrupt();
504
 
504
 
505
 #endif // (0!=USB_DEVICE_MAX_EP)
505
 #endif // (0!=USB_DEVICE_MAX_EP)
506
 //@}
506
 //@}
524
  * See Technical reference $3.8.3 Masking interrupt requests in peripheral modules.
524
  * See Technical reference $3.8.3 Masking interrupt requests in peripheral modules.
525
  */
525
  */
526
 #ifdef UHD_ENABLE
526
 #ifdef UHD_ENABLE
527
-void udd_interrupt(void);
528
-void udd_interrupt(void)
527
+void udd_interrupt();
528
+void udd_interrupt()
529
 #else
529
 #else
530
 ISR(UDD_USB_INT_FUN)
530
 ISR(UDD_USB_INT_FUN)
531
 #endif
531
 #endif
643
 }
643
 }
644
 
644
 
645
 
645
 
646
-bool udd_include_vbus_monitoring(void)
646
+bool udd_include_vbus_monitoring()
647
 {
647
 {
648
 	return true;
648
 	return true;
649
 }
649
 }
650
 
650
 
651
 
651
 
652
-void udd_enable(void)
652
+void udd_enable()
653
 {
653
 {
654
 	irqflags_t flags;
654
 	irqflags_t flags;
655
 
655
 
736
 }
736
 }
737
 
737
 
738
 
738
 
739
-void udd_disable(void)
739
+void udd_disable()
740
 {
740
 {
741
 	irqflags_t flags;
741
 	irqflags_t flags;
742
 
742
 
777
 }
777
 }
778
 
778
 
779
 
779
 
780
-void udd_attach(void)
780
+void udd_attach()
781
 {
781
 {
782
 	irqflags_t flags;
782
 	irqflags_t flags;
783
 	flags = cpu_irq_save();
783
 	flags = cpu_irq_save();
818
 }
818
 }
819
 
819
 
820
 
820
 
821
-void udd_detach(void)
821
+void udd_detach()
822
 {
822
 {
823
 	otg_unfreeze_clock();
823
 	otg_unfreeze_clock();
824
 
824
 
829
 }
829
 }
830
 
830
 
831
 
831
 
832
-bool udd_is_high_speed(void)
832
+bool udd_is_high_speed()
833
 {
833
 {
834
 #ifdef USB_DEVICE_HS_SUPPORT
834
 #ifdef USB_DEVICE_HS_SUPPORT
835
 	return !Is_udd_full_speed_mode();
835
 	return !Is_udd_full_speed_mode();
847
 }
847
 }
848
 
848
 
849
 
849
 
850
-uint8_t udd_getaddress(void)
850
+uint8_t udd_getaddress()
851
 {
851
 {
852
 	return udd_get_configured_address();
852
 	return udd_get_configured_address();
853
 }
853
 }
854
 
854
 
855
 
855
 
856
-uint16_t udd_get_frame_number(void)
856
+uint16_t udd_get_frame_number()
857
 {
857
 {
858
 	return udd_frame_number();
858
 	return udd_frame_number();
859
 }
859
 }
860
 
860
 
861
-uint16_t udd_get_micro_frame_number(void)
861
+uint16_t udd_get_micro_frame_number()
862
 {
862
 {
863
 	return udd_micro_frame_number();
863
 	return udd_micro_frame_number();
864
 }
864
 }
865
 
865
 
866
-void udd_send_remotewakeup(void)
866
+void udd_send_remotewakeup()
867
 {
867
 {
868
 #ifndef UDD_NO_SLEEP_MGR
868
 #ifndef UDD_NO_SLEEP_MGR
869
 	if (!udd_b_idle)
869
 	if (!udd_b_idle)
1242
 
1242
 
1243
 #ifdef USB_DEVICE_HS_SUPPORT
1243
 #ifdef USB_DEVICE_HS_SUPPORT
1244
 
1244
 
1245
-void udd_test_mode_j(void)
1245
+void udd_test_mode_j()
1246
 {
1246
 {
1247
 	udd_enable_hs_test_mode();
1247
 	udd_enable_hs_test_mode();
1248
 	udd_enable_hs_test_mode_j();
1248
 	udd_enable_hs_test_mode_j();
1249
 }
1249
 }
1250
 
1250
 
1251
 
1251
 
1252
-void udd_test_mode_k(void)
1252
+void udd_test_mode_k()
1253
 {
1253
 {
1254
 	udd_enable_hs_test_mode();
1254
 	udd_enable_hs_test_mode();
1255
 	udd_enable_hs_test_mode_k();
1255
 	udd_enable_hs_test_mode_k();
1256
 }
1256
 }
1257
 
1257
 
1258
 
1258
 
1259
-void udd_test_mode_se0_nak(void)
1259
+void udd_test_mode_se0_nak()
1260
 {
1260
 {
1261
 	udd_enable_hs_test_mode();
1261
 	udd_enable_hs_test_mode();
1262
 }
1262
 }
1263
 
1263
 
1264
 
1264
 
1265
-void udd_test_mode_packet(void)
1265
+void udd_test_mode_packet()
1266
 {
1266
 {
1267
 	uint8_t i;
1267
 	uint8_t i;
1268
 	uint8_t *ptr_dest;
1268
 	uint8_t *ptr_dest;
1310
 // ------------------------
1310
 // ------------------------
1311
 //--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT
1311
 //--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT
1312
 
1312
 
1313
-static void udd_reset_ep_ctrl(void)
1313
+static void udd_reset_ep_ctrl()
1314
 {
1314
 {
1315
 	irqflags_t flags;
1315
 	irqflags_t flags;
1316
 
1316
 
1334
 	cpu_irq_restore(flags);
1334
 	cpu_irq_restore(flags);
1335
 }
1335
 }
1336
 
1336
 
1337
-static void udd_ctrl_init(void)
1337
+static void udd_ctrl_init()
1338
 {
1338
 {
1339
 	irqflags_t flags;
1339
 	irqflags_t flags;
1340
 	flags = cpu_irq_save();
1340
 	flags = cpu_irq_save();
1357
 }
1357
 }
1358
 
1358
 
1359
 
1359
 
1360
-static void udd_ctrl_setup_received(void)
1360
+static void udd_ctrl_setup_received()
1361
 {
1361
 {
1362
 	irqflags_t flags;
1362
 	irqflags_t flags;
1363
 	uint8_t i;
1363
 	uint8_t i;
1419
 }
1419
 }
1420
 
1420
 
1421
 
1421
 
1422
-static void udd_ctrl_in_sent(void)
1422
+static void udd_ctrl_in_sent()
1423
 {
1423
 {
1424
 	static bool b_shortpacket = false;
1424
 	static bool b_shortpacket = false;
1425
 	uint16_t nb_remain;
1425
 	uint16_t nb_remain;
1503
 }
1503
 }
1504
 
1504
 
1505
 
1505
 
1506
-static void udd_ctrl_out_received(void)
1506
+static void udd_ctrl_out_received()
1507
 {
1507
 {
1508
 	irqflags_t flags;
1508
 	irqflags_t flags;
1509
 	uint8_t i;
1509
 	uint8_t i;
1594
 }
1594
 }
1595
 
1595
 
1596
 
1596
 
1597
-static void udd_ctrl_underflow(void)
1597
+static void udd_ctrl_underflow()
1598
 {
1598
 {
1599
 	if (Is_udd_out_received(0))
1599
 	if (Is_udd_out_received(0))
1600
 		return; // Underflow ignored if OUT data is received
1600
 		return; // Underflow ignored if OUT data is received
1611
 }
1611
 }
1612
 
1612
 
1613
 
1613
 
1614
-static void udd_ctrl_overflow(void)
1614
+static void udd_ctrl_overflow()
1615
 {
1615
 {
1616
 	if (Is_udd_in_send(0))
1616
 	if (Is_udd_in_send(0))
1617
 		return; // Overflow ignored if IN data is received
1617
 		return; // Overflow ignored if IN data is received
1627
 }
1627
 }
1628
 
1628
 
1629
 
1629
 
1630
-static void udd_ctrl_stall_data(void)
1630
+static void udd_ctrl_stall_data()
1631
 {
1631
 {
1632
 	// Stall all packets on IN & OUT control endpoint
1632
 	// Stall all packets on IN & OUT control endpoint
1633
 	udd_ep_control_state = UDD_EPCTRL_STALL_REQ;
1633
 	udd_ep_control_state = UDD_EPCTRL_STALL_REQ;
1635
 }
1635
 }
1636
 
1636
 
1637
 
1637
 
1638
-static void udd_ctrl_send_zlp_in(void)
1638
+static void udd_ctrl_send_zlp_in()
1639
 {
1639
 {
1640
 	irqflags_t flags;
1640
 	irqflags_t flags;
1641
 
1641
 
1653
 }
1653
 }
1654
 
1654
 
1655
 
1655
 
1656
-static void udd_ctrl_send_zlp_out(void)
1656
+static void udd_ctrl_send_zlp_out()
1657
 {
1657
 {
1658
 	irqflags_t flags;
1658
 	irqflags_t flags;
1659
 
1659
 
1669
 }
1669
 }
1670
 
1670
 
1671
 
1671
 
1672
-static void udd_ctrl_endofrequest(void)
1672
+static void udd_ctrl_endofrequest()
1673
 {
1673
 {
1674
 	// If a callback is registered then call it
1674
 	// If a callback is registered then call it
1675
 	if (udd_g_ctrlreq.callback) {
1675
 	if (udd_g_ctrlreq.callback) {
1678
 }
1678
 }
1679
 
1679
 
1680
 
1680
 
1681
-static bool udd_ctrl_interrupt(void)
1681
+static bool udd_ctrl_interrupt()
1682
 {
1682
 {
1683
 
1683
 
1684
 	if (!Is_udd_endpoint_interrupt(0)) {
1684
 	if (!Is_udd_endpoint_interrupt(0)) {
1734
 
1734
 
1735
 #if (0 != USB_DEVICE_MAX_EP)
1735
 #if (0 != USB_DEVICE_MAX_EP)
1736
 
1736
 
1737
-static void udd_ep_job_table_reset(void)
1737
+static void udd_ep_job_table_reset()
1738
 {
1738
 {
1739
 	uint8_t i;
1739
 	uint8_t i;
1740
 	for (i = 0; i < USB_DEVICE_MAX_EP; i++) {
1740
 	for (i = 0; i < USB_DEVICE_MAX_EP; i++) {
1744
 }
1744
 }
1745
 
1745
 
1746
 
1746
 
1747
-static void udd_ep_job_table_kill(void)
1747
+static void udd_ep_job_table_kill()
1748
 {
1748
 {
1749
 	uint8_t i;
1749
 	uint8_t i;
1750
 
1750
 
1970
 }
1970
 }
1971
 #endif // #ifdef UDD_EP_FIFO_SUPPORTED
1971
 #endif // #ifdef UDD_EP_FIFO_SUPPORTED
1972
 
1972
 
1973
-static bool udd_ep_interrupt(void)
1973
+static bool udd_ep_interrupt()
1974
 {
1974
 {
1975
 	udd_ep_id_t ep;
1975
 	udd_ep_id_t ep;
1976
 	udd_ep_job_t *ptr_job;
1976
 	udd_ep_job_t *ptr_job;

+ 2
- 2
Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h View File

66
  *
66
  *
67
  * \return \c true if the ID pin management has been started, otherwise \c false.
67
  * \return \c true if the ID pin management has been started, otherwise \c false.
68
  */
68
  */
69
-bool otg_dual_enable(void);
69
+bool otg_dual_enable();
70
 
70
 
71
 /**
71
 /**
72
  * \brief Uninitialize the dual role
72
  * \brief Uninitialize the dual role
73
  * This function is implemented in uotghs_host.c file.
73
  * This function is implemented in uotghs_host.c file.
74
  */
74
  */
75
-void otg_dual_disable(void);
75
+void otg_dual_disable();
76
 
76
 
77
 
77
 
78
 //! @name UOTGHS OTG ID pin management
78
 //! @name UOTGHS OTG ID pin management

+ 9
- 9
Marlin/src/HAL/HAL_DUE/usb/usb_task.c View File

56
 static volatile bool main_b_cdc_enable = false;
56
 static volatile bool main_b_cdc_enable = false;
57
 static volatile bool main_b_dtr_active = false;
57
 static volatile bool main_b_dtr_active = false;
58
 
58
 
59
-void usb_task_idle(void) {
59
+void usb_task_idle() {
60
   #if ENABLED(SDSUPPORT)
60
   #if ENABLED(SDSUPPORT)
61
     // Attend SD card access from the USB MSD -- Prioritize access to improve speed
61
     // Attend SD card access from the USB MSD -- Prioritize access to improve speed
62
     int delay = 2;
62
     int delay = 2;
70
 }
70
 }
71
 
71
 
72
 #if ENABLED(SDSUPPORT)
72
 #if ENABLED(SDSUPPORT)
73
-  bool usb_task_msc_enable(void)                { return ((main_b_msc_enable = true)); }
74
-  void usb_task_msc_disable(void)               { main_b_msc_enable = false; }
75
-  bool usb_task_msc_isenabled(void)             { return main_b_msc_enable; }
73
+  bool usb_task_msc_enable()                { return ((main_b_msc_enable = true)); }
74
+  void usb_task_msc_disable()               { main_b_msc_enable = false; }
75
+  bool usb_task_msc_isenabled()             { return main_b_msc_enable; }
76
 #endif
76
 #endif
77
 
77
 
78
 bool usb_task_cdc_enable(const uint8_t port)  { UNUSED(port); return ((main_b_cdc_enable = true)); }
78
 bool usb_task_cdc_enable(const uint8_t port)  { UNUSED(port); return ((main_b_cdc_enable = true)); }
79
 void usb_task_cdc_disable(const uint8_t port) { UNUSED(port); main_b_cdc_enable = false; main_b_dtr_active = false; }
79
 void usb_task_cdc_disable(const uint8_t port) { UNUSED(port); main_b_cdc_enable = false; main_b_dtr_active = false; }
80
-bool usb_task_cdc_isenabled(void)             { return main_b_cdc_enable; }
80
+bool usb_task_cdc_isenabled()             { return main_b_cdc_enable; }
81
 
81
 
82
 /*! \brief Called by CDC interface
82
 /*! \brief Called by CDC interface
83
  * Callback running when CDC device have received data
83
  * Callback running when CDC device have received data
121
   }
121
   }
122
 }
122
 }
123
 
123
 
124
-bool usb_task_cdc_dtr_active(void)             { return main_b_dtr_active; }
124
+bool usb_task_cdc_dtr_active()             { return main_b_dtr_active; }
125
 
125
 
126
 /// Microsoft WCID descriptor
126
 /// Microsoft WCID descriptor
127
 typedef struct USB_MicrosoftCompatibleDescriptor_Interface {
127
 typedef struct USB_MicrosoftCompatibleDescriptor_Interface {
202
 ** WCID configuration information
202
 ** WCID configuration information
203
 ** Hooked into UDC via UDC_GET_EXTRA_STRING #define.
203
 ** Hooked into UDC via UDC_GET_EXTRA_STRING #define.
204
 */
204
 */
205
-bool usb_task_extra_string(void) {
205
+bool usb_task_extra_string() {
206
   static uint8_t udi_msft_magic[] = "MSFT100\xEE";
206
   static uint8_t udi_msft_magic[] = "MSFT100\xEE";
207
   static uint8_t udi_cdc_name[] = "CDC interface";
207
   static uint8_t udi_cdc_name[] = "CDC interface";
208
   #if ENABLED(SDSUPPORT)
208
   #if ENABLED(SDSUPPORT)
262
 /**************************************************************************************************
262
 /**************************************************************************************************
263
 ** Handle device requests that the ASF stack doesn't
263
 ** Handle device requests that the ASF stack doesn't
264
 */
264
 */
265
-bool usb_task_other_requests(void) {
265
+bool usb_task_other_requests() {
266
   uint8_t* ptr = 0;
266
   uint8_t* ptr = 0;
267
   uint16_t size = 0;
267
   uint16_t size = 0;
268
 
268
 
297
   return true;
297
   return true;
298
 }
298
 }
299
 
299
 
300
-void usb_task_init(void) {
300
+void usb_task_init() {
301
 
301
 
302
   uint16_t *ptr;
302
   uint16_t *ptr;
303
 
303
 

+ 10
- 10
Marlin/src/HAL/HAL_DUE/usb/usb_task.h View File

58
  *
58
  *
59
  * \retval true if MSC startup is ok
59
  * \retval true if MSC startup is ok
60
  */
60
  */
61
-bool usb_task_msc_enable(void);
61
+bool usb_task_msc_enable();
62
 
62
 
63
 /*! \brief Called by MSC interface
63
 /*! \brief Called by MSC interface
64
  * Callback running when USB Host disable MSC interface
64
  * Callback running when USB Host disable MSC interface
65
  */
65
  */
66
-void usb_task_msc_disable(void);
66
+void usb_task_msc_disable();
67
 
67
 
68
 /*! \brief Opens the communication port
68
 /*! \brief Opens the communication port
69
  * This is called by CDC interface when USB Host enable it.
69
  * This is called by CDC interface when USB Host enable it.
84
 
84
 
85
 /*! \brief Check if MSC is enumerated and configured on the PC side
85
 /*! \brief Check if MSC is enumerated and configured on the PC side
86
  */
86
  */
87
-bool usb_task_msc_isenabled(void);
87
+bool usb_task_msc_isenabled();
88
 
88
 
89
 /*! \brief Check if CDC is enumerated and configured on the PC side
89
 /*! \brief Check if CDC is enumerated and configured on the PC side
90
  */
90
  */
91
-bool usb_task_cdc_isenabled(void);
91
+bool usb_task_cdc_isenabled();
92
 
92
 
93
 /*! \brief Check if CDC is actually OPEN by an application on the PC side
93
 /*! \brief Check if CDC is actually OPEN by an application on the PC side
94
  *  assuming DTR signal means a program is listening to messages
94
  *  assuming DTR signal means a program is listening to messages
95
  */
95
  */
96
-bool usb_task_cdc_dtr_active(void);
96
+bool usb_task_cdc_dtr_active();
97
 
97
 
98
 /*! \brief Called by UDC when USB Host request a extra string different
98
 /*! \brief Called by UDC when USB Host request a extra string different
99
  * of this specified in USB device descriptor
99
  * of this specified in USB device descriptor
100
  */
100
  */
101
-bool usb_task_extra_string(void);
101
+bool usb_task_extra_string();
102
 
102
 
103
 /*! \brief Called by UDC when USB Host performs unknown requests
103
 /*! \brief Called by UDC when USB Host performs unknown requests
104
  */
104
  */
105
-bool usb_task_other_requests(void);
105
+bool usb_task_other_requests();
106
 
106
 
107
 /*! \brief Called by CDC interface
107
 /*! \brief Called by CDC interface
108
  * Callback running when CDC device have received data
108
  * Callback running when CDC device have received data
117
 
117
 
118
 /*! \brief The USB device interrupt
118
 /*! \brief The USB device interrupt
119
  */
119
  */
120
-void USBD_ISR(void);
120
+void USBD_ISR();
121
 
121
 
122
 /*! \brief USB task init
122
 /*! \brief USB task init
123
  */
123
  */
124
-void usb_task_init(void);
124
+void usb_task_init();
125
 
125
 
126
 /*! \brief USB task idle
126
 /*! \brief USB task idle
127
  */
127
  */
128
-void usb_task_idle(void);
128
+void usb_task_idle();
129
 
129
 
130
 #ifdef __cplusplus
130
 #ifdef __cplusplus
131
 }
131
 }

+ 2
- 2
Marlin/src/HAL/HAL_DUE/watchdog.cpp View File

32
 // process, because watchdog initialization at hardware reset on SAM3X8E
32
 // process, because watchdog initialization at hardware reset on SAM3X8E
33
 // is unreliable, and there is risk of unintended resets if we delay
33
 // is unreliable, and there is risk of unintended resets if we delay
34
 // that initialization to a later time.
34
 // that initialization to a later time.
35
-void watchdogSetup(void) {
35
+void watchdogSetup() {
36
 
36
 
37
   #if ENABLED(USE_WATCHDOG)
37
   #if ENABLED(USE_WATCHDOG)
38
 
38
 
106
   // Initialize watchdog - On SAM3X, Watchdog was already configured
106
   // Initialize watchdog - On SAM3X, Watchdog was already configured
107
   //  and enabled or disabled at startup, so no need to reconfigure it
107
   //  and enabled or disabled at startup, so no need to reconfigure it
108
   //  here.
108
   //  here.
109
-  void watchdog_init(void) {
109
+  void watchdog_init() {
110
     // Reset watchdog to start clean
110
     // Reset watchdog to start clean
111
     WDT_Restart(WDT);
111
     WDT_Restart(WDT);
112
   }
112
   }

+ 1
- 1
Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h View File

29
 public:
29
 public:
30
   FlushableHardwareSerial(int uart_nr);
30
   FlushableHardwareSerial(int uart_nr);
31
 
31
 
32
-  inline void flushTX(void) { /* No need to flush the hardware serial, but defined here for compatibility. */ }
32
+  inline void flushTX() { /* No need to flush the hardware serial, but defined here for compatibility. */ }
33
 };
33
 };
34
 
34
 
35
 extern FlushableHardwareSerial flushableSerial;
35
 extern FlushableHardwareSerial flushableSerial;

+ 5
- 5
Marlin/src/HAL/HAL_ESP32/HAL.cpp View File

78
 // Public functions
78
 // Public functions
79
 // ------------------------
79
 // ------------------------
80
 
80
 
81
-void HAL_init(void) {
81
+void HAL_init() {
82
   i2s_init();
82
   i2s_init();
83
 }
83
 }
84
 
84
 
85
-void HAL_init_board(void) {
85
+void HAL_init_board() {
86
   #if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
86
   #if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
87
     spiffs_init();
87
     spiffs_init();
88
   #endif
88
   #endif
99
   #endif
99
   #endif
100
 }
100
 }
101
 
101
 
102
-void HAL_idletask(void) {
102
+void HAL_idletask() {
103
   #if ENABLED(OTASUPPORT)
103
   #if ENABLED(OTASUPPORT)
104
     OTA_handle();
104
     OTA_handle();
105
   #endif
105
   #endif
106
 }
106
 }
107
 
107
 
108
-void HAL_clear_reset_source(void) { }
108
+void HAL_clear_reset_source() { }
109
 
109
 
110
-uint8_t HAL_get_reset_source(void) { return rtc_get_reset_reason(1); }
110
+uint8_t HAL_get_reset_source() { return rtc_get_reset_reason(1); }
111
 
111
 
112
 void _delay_ms(int delay_ms) { delay(delay_ms); }
112
 void _delay_ms(int delay_ms) { delay(delay_ms); }
113
 
113
 

+ 7
- 7
Marlin/src/HAL/HAL_ESP32/HAL.h View File

85
 // ------------------------
85
 // ------------------------
86
 
86
 
87
 // clear reset reason
87
 // clear reset reason
88
-void HAL_clear_reset_source(void);
88
+void HAL_clear_reset_source();
89
 
89
 
90
 // reset reason
90
 // reset reason
91
-uint8_t HAL_get_reset_source(void);
91
+uint8_t HAL_get_reset_source();
92
 
92
 
93
 void _delay_ms(int delay);
93
 void _delay_ms(int delay);
94
 
94
 
95
 #pragma GCC diagnostic push
95
 #pragma GCC diagnostic push
96
 #pragma GCC diagnostic ignored "-Wunused-function"
96
 #pragma GCC diagnostic ignored "-Wunused-function"
97
-int freeMemory(void);
97
+int freeMemory();
98
 #pragma GCC diagnostic pop
98
 #pragma GCC diagnostic pop
99
 
99
 
100
 void analogWrite(pin_t pin, int value);
100
 void analogWrite(pin_t pin, int value);
108
 // ADC
108
 // ADC
109
 #define HAL_ANALOG_SELECT(pin)
109
 #define HAL_ANALOG_SELECT(pin)
110
 
110
 
111
-void HAL_adc_init(void);
111
+void HAL_adc_init();
112
 
112
 
113
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
113
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
114
 #define HAL_READ_ADC()      HAL_adc_result
114
 #define HAL_READ_ADC()      HAL_adc_result
123
 // Enable hooks into idle and setup for HAL
123
 // Enable hooks into idle and setup for HAL
124
 #define HAL_IDLETASK 1
124
 #define HAL_IDLETASK 1
125
 #define BOARD_INIT() HAL_init_board();
125
 #define BOARD_INIT() HAL_init_board();
126
-void HAL_idletask(void);
127
-void HAL_init(void);
128
-void HAL_init_board(void);
126
+void HAL_idletask();
127
+void HAL_init();
128
+void HAL_init_board();

+ 1
- 1
Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp View File

80
   SPI.begin();
80
   SPI.begin();
81
 }
81
 }
82
 
82
 
83
-uint8_t spiRec(void) {
83
+uint8_t spiRec() {
84
   SPI.beginTransaction(spiConfig);
84
   SPI.beginTransaction(spiConfig);
85
   uint8_t returnByte = SPI.transfer(0xFF);
85
   uint8_t returnByte = SPI.transfer(0xFF);
86
   SPI.endTransaction();
86
   SPI.endTransaction();

+ 9
- 9
Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp View File

66
   return written;
66
   return written;
67
 }
67
 }
68
 
68
 
69
-int RingBuffer::available(void) {
69
+int RingBuffer::available() {
70
   return (size - read_index + write_index) & (size - 1);
70
   return (size - read_index + write_index) & (size - 1);
71
 }
71
 }
72
 
72
 
73
-int RingBuffer::peek(void) {
73
+int RingBuffer::peek() {
74
   return available() ? data[read_index] : -1;
74
   return available() ? data[read_index] : -1;
75
 }
75
 }
76
 
76
 
77
-int RingBuffer::read(void) {
77
+int RingBuffer::read() {
78
   if (available()) {
78
   if (available()) {
79
     const int ret = data[read_index];
79
     const int ret = data[read_index];
80
     read_index = NEXT_INDEX(read_index, size);
80
     read_index = NEXT_INDEX(read_index, size);
94
   return len;
94
   return len;
95
 }
95
 }
96
 
96
 
97
-void RingBuffer::flush(void) { read_index = write_index; }
97
+void RingBuffer::flush() { read_index = write_index; }
98
 
98
 
99
 // WebSocketSerial impl
99
 // WebSocketSerial impl
100
 WebSocketSerial::WebSocketSerial()
100
 WebSocketSerial::WebSocketSerial()
120
 }
120
 }
121
 
121
 
122
 void WebSocketSerial::end() { }
122
 void WebSocketSerial::end() { }
123
-int WebSocketSerial::peek(void) { return rx_buffer.peek(); }
124
-int WebSocketSerial::read(void) { return rx_buffer.read(); }
125
-int WebSocketSerial::available(void) { return rx_buffer.available(); }
126
-void WebSocketSerial::flush(void) { rx_buffer.flush(); }
123
+int WebSocketSerial::peek() { return rx_buffer.peek(); }
124
+int WebSocketSerial::read() { return rx_buffer.read(); }
125
+int WebSocketSerial::available() { return rx_buffer.available(); }
126
+void WebSocketSerial::flush() { rx_buffer.flush(); }
127
 
127
 
128
 size_t WebSocketSerial::write(const uint8_t c) {
128
 size_t WebSocketSerial::write(const uint8_t c) {
129
   size_t ret = tx_buffer.write(c);
129
   size_t ret = tx_buffer.write(c);
145
   return written;
145
   return written;
146
 }
146
 }
147
 
147
 
148
-void WebSocketSerial::flushTX(void) {
148
+void WebSocketSerial::flushTX() {
149
   // No need to do anything as there's no benefit to sending partial lines over the websocket connection.
149
   // No need to do anything as there's no benefit to sending partial lines over the websocket connection.
150
 }
150
 }
151
 
151
 

+ 9
- 9
Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h View File

45
   RingBuffer(ring_buffer_pos_t size);
45
   RingBuffer(ring_buffer_pos_t size);
46
   ~RingBuffer();
46
   ~RingBuffer();
47
 
47
 
48
-  int available(void);
49
-  int peek(void);
50
-  int read(void);
48
+  int available();
49
+  int peek();
50
+  int read();
51
   ring_buffer_pos_t read(uint8_t *buffer);
51
   ring_buffer_pos_t read(uint8_t *buffer);
52
-  void flush(void);
52
+  void flush();
53
   ring_buffer_pos_t write(const uint8_t c);
53
   ring_buffer_pos_t write(const uint8_t c);
54
   ring_buffer_pos_t write(const uint8_t* buffer, ring_buffer_pos_t size);
54
   ring_buffer_pos_t write(const uint8_t* buffer, ring_buffer_pos_t size);
55
 };
55
 };
62
   WebSocketSerial();
62
   WebSocketSerial();
63
   void begin(const long);
63
   void begin(const long);
64
   void end();
64
   void end();
65
-  int available(void);
66
-  int peek(void);
67
-  int read(void);
68
-  void flush(void);
69
-  void flushTX(void);
65
+  int available();
66
+  int peek();
67
+  int read();
68
+  void flush();
69
+  void flushTX();
70
   size_t write(const uint8_t c);
70
   size_t write(const uint8_t c);
71
   size_t write(const uint8_t* buffer, size_t size);
71
   size_t write(const uint8_t* buffer, size_t size);
72
 
72
 

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

38
 #include "../../module/endstops.h"
38
 #include "../../module/endstops.h"
39
 
39
 
40
 // One ISR for all EXT-Interrupts
40
 // One ISR for all EXT-Interrupts
41
-void ICACHE_RAM_ATTR endstop_ISR(void) { endstops.update(); }
41
+void ICACHE_RAM_ATTR endstop_ISR() { endstops.update(); }
42
 
42
 
43
-void setup_endstop_interrupts(void) {
43
+void setup_endstop_interrupts() {
44
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
44
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
45
   #if HAS_X_MAX
45
   #if HAS_X_MAX
46
     _ATTACH(X_MAX_PIN);
46
     _ATTACH(X_MAX_PIN);

+ 7
- 7
Marlin/src/HAL/HAL_ESP32/timers.h View File

79
 #define ENABLE_TEMPERATURE_INTERRUPT()  HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
79
 #define ENABLE_TEMPERATURE_INTERRUPT()  HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
80
 #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
80
 #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
81
 
81
 
82
-#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void)
83
-#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void)
84
-#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler(void)
82
+#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
83
+#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
84
+#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
85
 
85
 
86
-extern "C" void tempTC_Handler(void);
87
-extern "C" void stepTC_Handler(void);
88
-extern "C" void pwmTC_Handler(void);
86
+extern "C" void tempTC_Handler();
87
+extern "C" void stepTC_Handler();
88
+extern "C" void pwmTC_Handler();
89
 
89
 
90
 // ------------------------
90
 // ------------------------
91
 // Types
91
 // Types
95
   timer_group_t  group;
95
   timer_group_t  group;
96
   timer_idx_t    idx;
96
   timer_idx_t    idx;
97
   uint32_t       divider;
97
   uint32_t       divider;
98
-  void           (*fn)(void);
98
+  void           (*fn)();
99
 } tTimerConfig;
99
 } tTimerConfig;
100
 
100
 
101
 // ------------------------
101
 // ------------------------

+ 2
- 2
Marlin/src/HAL/HAL_ESP32/watchdog.cpp View File

28
 
28
 
29
 #include "watchdog.h"
29
 #include "watchdog.h"
30
 
30
 
31
-void watchdogSetup(void) {
31
+void watchdogSetup() {
32
   // do whatever. don't remove this function.
32
   // do whatever. don't remove this function.
33
 }
33
 }
34
 
34
 
35
-void watchdog_init(void) {
35
+void watchdog_init() {
36
   // TODO
36
   // TODO
37
 }
37
 }
38
 
38
 

+ 6
- 6
Marlin/src/HAL/HAL_LINUX/HAL.cpp View File

31
 extern "C" void u8g_xMicroDelay(uint16_t val) {
31
 extern "C" void u8g_xMicroDelay(uint16_t val) {
32
   DELAY_US(val);
32
   DELAY_US(val);
33
 }
33
 }
34
-extern "C" void u8g_MicroDelay(void) {
34
+extern "C" void u8g_MicroDelay() {
35
   u8g_xMicroDelay(1);
35
   u8g_xMicroDelay(1);
36
 }
36
 }
37
-extern "C" void u8g_10MicroDelay(void) {
37
+extern "C" void u8g_10MicroDelay() {
38
   u8g_xMicroDelay(10);
38
   u8g_xMicroDelay(10);
39
 }
39
 }
40
 extern "C" void u8g_Delay(uint16_t val) {
40
 extern "C" void u8g_Delay(uint16_t val) {
51
 // ADC
51
 // ADC
52
 // ------------------------
52
 // ------------------------
53
 
53
 
54
-void HAL_adc_init(void) {
54
+void HAL_adc_init() {
55
 
55
 
56
 }
56
 }
57
 
57
 
64
   active_ch = ch;
64
   active_ch = ch;
65
 }
65
 }
66
 
66
 
67
-bool HAL_adc_finished(void) {
67
+bool HAL_adc_finished() {
68
   return true;
68
   return true;
69
 }
69
 }
70
 
70
 
71
-uint16_t HAL_adc_get_result(void) {
71
+uint16_t HAL_adc_get_result() {
72
   pin_t pin = analogInputToDigitalPin(active_ch);
72
   pin_t pin = analogInputToDigitalPin(active_ch);
73
   if (!VALID_PIN(pin)) return 0;
73
   if (!VALID_PIN(pin)) return 0;
74
   uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF);
74
   uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF);
75
   return data;    // return 10bit value as Marlin expects
75
   return data;    // return 10bit value as Marlin expects
76
 }
76
 }
77
 
77
 
78
-void HAL_pwm_init(void) {
78
+void HAL_pwm_init() {
79
 
79
 
80
 }
80
 }
81
 
81
 

+ 4
- 4
Marlin/src/HAL/HAL_LINUX/HAL.h View File

78
 #define ENABLE_ISRS()
78
 #define ENABLE_ISRS()
79
 #define DISABLE_ISRS()
79
 #define DISABLE_ISRS()
80
 
80
 
81
-inline void HAL_init(void) { }
81
+inline void HAL_init() { }
82
 
82
 
83
 // Utility functions
83
 // Utility functions
84
 #pragma GCC diagnostic push
84
 #pragma GCC diagnostic push
85
 #pragma GCC diagnostic ignored "-Wunused-function"
85
 #pragma GCC diagnostic ignored "-Wunused-function"
86
-int freeMemory(void);
86
+int freeMemory();
87
 #pragma GCC diagnostic pop
87
 #pragma GCC diagnostic pop
88
 
88
 
89
 // ADC
89
 // ADC
92
 #define HAL_READ_ADC()         HAL_adc_get_result()
92
 #define HAL_READ_ADC()         HAL_adc_get_result()
93
 #define HAL_ADC_READY()        true
93
 #define HAL_ADC_READY()        true
94
 
94
 
95
-void HAL_adc_init(void);
95
+void HAL_adc_init();
96
 void HAL_adc_enable_channel(int pin);
96
 void HAL_adc_enable_channel(int pin);
97
 void HAL_adc_start_conversion(const uint8_t adc_pin);
97
 void HAL_adc_start_conversion(const uint8_t adc_pin);
98
-uint16_t HAL_adc_get_result(void);
98
+uint16_t HAL_adc_get_result();
99
 
99
 
100
 /* ---------------- Delay in cycles */
100
 /* ---------------- Delay in cycles */
101
 FORCE_INLINE static void DELAY_CYCLES(uint64_t x) {
101
 FORCE_INLINE static void DELAY_CYCLES(uint64_t x) {

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

28
 #include "../shared/Delay.h"
28
 #include "../shared/Delay.h"
29
 
29
 
30
 // Interrupts
30
 // Interrupts
31
-void cli(void) { } // Disable
32
-void sei(void) { }  // Enable
31
+void cli() { } // Disable
32
+void sei() { }  // Enable
33
 
33
 
34
 // Time functions
34
 // Time functions
35
 void _delay_ms(const int delay_ms) {
35
 void _delay_ms(const int delay_ms) {

+ 3
- 3
Marlin/src/HAL/HAL_LINUX/include/Arduino.h View File

63
 #define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value)))
63
 #define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value)))
64
 
64
 
65
 //Interrupts
65
 //Interrupts
66
-void cli(void); // Disable
67
-void sei(void); // Enable
68
-void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode);
66
+void cli(); // Disable
67
+void sei(); // Enable
68
+void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode);
69
 void detachInterrupt(uint32_t pin);
69
 void detachInterrupt(uint32_t pin);
70
 extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
70
 extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
71
 extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);
71
 extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);

+ 3
- 3
Marlin/src/HAL/HAL_LINUX/include/serial.h View File

108
 
108
 
109
   void flush() { receive_buffer.clear(); }
109
   void flush() { receive_buffer.clear(); }
110
 
110
 
111
-  uint8_t availableForWrite(void) {
111
+  uint8_t availableForWrite() {
112
     return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free();
112
     return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free();
113
   }
113
   }
114
 
114
 
115
-  void flushTX(void) {
115
+  void flushTX() {
116
     if (host_connected)
116
     if (host_connected)
117
       while (transmit_buffer.available()) { /* nada */ }
117
       while (transmit_buffer.available()) { /* nada */ }
118
   }
118
   }
200
   void println(unsigned long value, int nbase = 0) { print(value, nbase); println(); }
200
   void println(unsigned long value, int nbase = 0) { print(value, nbase); println(); }
201
   void println(float value, int round = 6) { printf("%f\n" , value); }
201
   void println(float value, int round = 6) { printf("%f\n" , value); }
202
   void println(double value, int round = 6) { printf("%f\n" , value); }
202
   void println(double value, int round = 6) { printf("%f\n" , value); }
203
-  void println(void) { print('\n'); }
203
+  void println() { print('\n'); }
204
 
204
 
205
   volatile RingBuffer<uint8_t, 128> receive_buffer;
205
   volatile RingBuffer<uint8_t, 128> receive_buffer;
206
   volatile RingBuffer<uint8_t, 128> transmit_buffer;
206
   volatile RingBuffer<uint8_t, 128> transmit_buffer;

+ 1
- 1
Marlin/src/HAL/HAL_LINUX/main.cpp View File

104
   }
104
   }
105
 }
105
 }
106
 
106
 
107
-int main(void) {
107
+int main() {
108
   std::thread write_serial (write_serial_thread);
108
   std::thread write_serial (write_serial_thread);
109
   std::thread read_serial (read_serial_thread);
109
   std::thread read_serial (read_serial_thread);
110
 
110
 

+ 1
- 1
Marlin/src/HAL/HAL_LINUX/timers.cpp View File

37
 
37
 
38
 Timer timers[2];
38
 Timer timers[2];
39
 
39
 
40
-void HAL_timer_init(void) {
40
+void HAL_timer_init() {
41
   timers[0].init(0, STEPPER_TIMER_RATE, TIMER0_IRQHandler);
41
   timers[0].init(0, STEPPER_TIMER_RATE, TIMER0_IRQHandler);
42
   timers[1].init(1, TEMP_TIMER_RATE, TIMER1_IRQHandler);
42
   timers[1].init(1, TEMP_TIMER_RATE, TIMER1_IRQHandler);
43
 }
43
 }

+ 4
- 4
Marlin/src/HAL/HAL_LINUX/timers.h View File

59
 #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
59
 #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
60
 #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
60
 #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
61
 
61
 
62
-#define HAL_STEP_TIMER_ISR()  extern "C" void TIMER0_IRQHandler(void)
63
-#define HAL_TEMP_TIMER_ISR()  extern "C" void TIMER1_IRQHandler(void)
62
+#define HAL_STEP_TIMER_ISR()  extern "C" void TIMER0_IRQHandler()
63
+#define HAL_TEMP_TIMER_ISR()  extern "C" void TIMER1_IRQHandler()
64
 
64
 
65
 // PWM timer
65
 // PWM timer
66
 #define HAL_PWM_TIMER
66
 #define HAL_PWM_TIMER
67
-#define HAL_PWM_TIMER_ISR()   extern "C" void TIMER3_IRQHandler(void)
67
+#define HAL_PWM_TIMER_ISR()   extern "C" void TIMER3_IRQHandler()
68
 #define HAL_PWM_TIMER_IRQn
68
 #define HAL_PWM_TIMER_IRQn
69
 
69
 
70
 
70
 
71
-void HAL_timer_init(void);
71
+void HAL_timer_init();
72
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
72
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
73
 
73
 
74
 void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare);
74
 void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare);

+ 5
- 5
Marlin/src/HAL/HAL_LINUX/watchdog.cpp View File

28
 
28
 
29
 #include "watchdog.h"
29
 #include "watchdog.h"
30
 
30
 
31
-void watchdog_init(void) {}
31
+void watchdog_init() {}
32
 
32
 
33
-void HAL_clear_reset_source(void) {}
33
+void HAL_clear_reset_source() {}
34
 
34
 
35
-uint8_t HAL_get_reset_source(void) {
35
+uint8_t HAL_get_reset_source() {
36
   return RST_POWER_ON;
36
   return RST_POWER_ON;
37
 }
37
 }
38
 
38
 
39
 void watchdog_reset() {}
39
 void watchdog_reset() {}
40
 
40
 
41
 #else
41
 #else
42
-  void HAL_clear_reset_source(void) {}
43
-  uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
42
+  void HAL_clear_reset_source() {}
43
+  uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
44
 #endif // USE_WATCHDOG
44
 #endif // USE_WATCHDOG
45
 
45
 
46
 #endif // __PLAT_LINUX__
46
 #endif // __PLAT_LINUX__

+ 4
- 4
Marlin/src/HAL/HAL_LINUX/watchdog.h View File

23
 
23
 
24
 #define WDT_TIMEOUT   4000000 // 4 second timeout
24
 #define WDT_TIMEOUT   4000000 // 4 second timeout
25
 
25
 
26
-void watchdog_init(void);
27
-void watchdog_reset(void);
28
-void HAL_clear_reset_source(void);
29
-uint8_t HAL_get_reset_source(void);
26
+void watchdog_init();
27
+void watchdog_reset();
28
+void HAL_clear_reset_source();
29
+uint8_t HAL_get_reset_source();

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

44
 #define sw_barrier() __asm__ volatile("": : :"memory");
44
 #define sw_barrier() __asm__ volatile("": : :"memory");
45
 
45
 
46
 // (re)initialize UART0 as a monitor output to 250000,n,8,1
46
 // (re)initialize UART0 as a monitor output to 250000,n,8,1
47
-static void TXBegin(void) {
47
+static void TXBegin() {
48
 }
48
 }
49
 
49
 
50
 // Send character through UART with no interrupts
50
 // Send character through UART with no interrupts
210
 }
210
 }
211
 
211
 
212
 extern "C" {
212
 extern "C" {
213
-__attribute__((naked)) void NMI_Handler(void) {
213
+__attribute__((naked)) void NMI_Handler() {
214
   __asm__ __volatile__ (
214
   __asm__ __volatile__ (
215
     ".syntax unified" "\n\t"
215
     ".syntax unified" "\n\t"
216
     A("tst lr, #4")
216
     A("tst lr, #4")
223
   );
223
   );
224
 }
224
 }
225
 
225
 
226
-__attribute__((naked)) void HardFault_Handler(void) {
226
+__attribute__((naked)) void HardFault_Handler() {
227
   __asm__ __volatile__ (
227
   __asm__ __volatile__ (
228
     ".syntax unified" "\n\t"
228
     ".syntax unified" "\n\t"
229
     A("tst lr, #4")
229
     A("tst lr, #4")
236
   );
236
   );
237
 }
237
 }
238
 
238
 
239
-__attribute__((naked)) void MemManage_Handler(void) {
239
+__attribute__((naked)) void MemManage_Handler() {
240
   __asm__ __volatile__ (
240
   __asm__ __volatile__ (
241
     ".syntax unified" "\n\t"
241
     ".syntax unified" "\n\t"
242
     A("tst lr, #4")
242
     A("tst lr, #4")
249
   );
249
   );
250
 }
250
 }
251
 
251
 
252
-__attribute__((naked)) void BusFault_Handler(void) {
252
+__attribute__((naked)) void BusFault_Handler() {
253
   __asm__ __volatile__ (
253
   __asm__ __volatile__ (
254
     ".syntax unified" "\n\t"
254
     ".syntax unified" "\n\t"
255
     A("tst lr, #4")
255
     A("tst lr, #4")
262
   );
262
   );
263
 }
263
 }
264
 
264
 
265
-__attribute__((naked)) void UsageFault_Handler(void) {
265
+__attribute__((naked)) void UsageFault_Handler() {
266
   __asm__ __volatile__ (
266
   __asm__ __volatile__ (
267
     ".syntax unified" "\n\t"
267
     ".syntax unified" "\n\t"
268
     A("tst lr, #4")
268
     A("tst lr, #4")
275
   );
275
   );
276
 }
276
 }
277
 
277
 
278
-__attribute__((naked)) void DebugMon_Handler(void) {
278
+__attribute__((naked)) void DebugMon_Handler() {
279
   __asm__ __volatile__ (
279
   __asm__ __volatile__ (
280
     ".syntax unified" "\n\t"
280
     ".syntax unified" "\n\t"
281
     A("tst lr, #4")
281
     A("tst lr, #4")
289
 }
289
 }
290
 
290
 
291
 /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
291
 /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
292
-__attribute__((naked)) void WDT_IRQHandler(void) {
292
+__attribute__((naked)) void WDT_IRQHandler() {
293
   __asm__ __volatile__ (
293
   __asm__ __volatile__ (
294
     ".syntax unified" "\n\t"
294
     ".syntax unified" "\n\t"
295
     A("tst lr, #4")
295
     A("tst lr, #4")
302
   );
302
   );
303
 }
303
 }
304
 
304
 
305
-__attribute__((naked)) void RSTC_Handler(void) {
305
+__attribute__((naked)) void RSTC_Handler() {
306
   __asm__ __volatile__ (
306
   __asm__ __volatile__ (
307
     ".syntax unified" "\n\t"
307
     ".syntax unified" "\n\t"
308
     A("tst lr, #4")
308
     A("tst lr, #4")

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

30
 extern "C" void u8g_xMicroDelay(uint16_t val) {
30
 extern "C" void u8g_xMicroDelay(uint16_t val) {
31
   DELAY_US(val);
31
   DELAY_US(val);
32
 }
32
 }
33
-extern "C" void u8g_MicroDelay(void) {
33
+extern "C" void u8g_MicroDelay() {
34
   u8g_xMicroDelay(1);
34
   u8g_xMicroDelay(1);
35
 }
35
 }
36
-extern "C" void u8g_10MicroDelay(void) {
36
+extern "C" void u8g_10MicroDelay() {
37
   u8g_xMicroDelay(10);
37
   u8g_xMicroDelay(10);
38
 }
38
 }
39
 extern "C" void u8g_Delay(uint16_t val) {
39
 extern "C" void u8g_Delay(uint16_t val) {

+ 3
- 3
Marlin/src/HAL/HAL_LPC1768/HAL.h View File

28
 
28
 
29
 #define CPU_32_BIT
29
 #define CPU_32_BIT
30
 
30
 
31
-void HAL_init(void);
31
+void HAL_init();
32
 
32
 
33
 #include <stdint.h>
33
 #include <stdint.h>
34
 #include <stdarg.h>
34
 #include <stdarg.h>
113
 //
113
 //
114
 #pragma GCC diagnostic push
114
 #pragma GCC diagnostic push
115
 #pragma GCC diagnostic ignored "-Wunused-function"
115
 #pragma GCC diagnostic ignored "-Wunused-function"
116
-int freeMemory(void);
116
+int freeMemory();
117
 #pragma GCC diagnostic pop
117
 #pragma GCC diagnostic pop
118
 
118
 
119
 //
119
 //
144
 #define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09
144
 #define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09
145
 
145
 
146
 #define HAL_IDLETASK 1
146
 #define HAL_IDLETASK 1
147
-void HAL_idletask(void);
147
+void HAL_idletask();
148
 
148
 
149
 #define PLATFORM_M997_SUPPORT
149
 #define PLATFORM_M997_SUPPORT
150
 void flashFirmware(int16_t value);
150
 void flashFirmware(int16_t value);

+ 4
- 4
Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp View File

27
 
27
 
28
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0)
28
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0)
29
   MarlinSerial MSerial(LPC_UART0);
29
   MarlinSerial MSerial(LPC_UART0);
30
-  extern "C" void UART0_IRQHandler(void) {
30
+  extern "C" void UART0_IRQHandler() {
31
     MSerial.IRQHandler();
31
     MSerial.IRQHandler();
32
   }
32
   }
33
 #endif
33
 #endif
34
 
34
 
35
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1)
35
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1)
36
   MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1);
36
   MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1);
37
-  extern "C" void UART1_IRQHandler(void) {
37
+  extern "C" void UART1_IRQHandler() {
38
     MSerial1.IRQHandler();
38
     MSerial1.IRQHandler();
39
   }
39
   }
40
 #endif
40
 #endif
41
 
41
 
42
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2)
42
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2)
43
   MarlinSerial MSerial2(LPC_UART2);
43
   MarlinSerial MSerial2(LPC_UART2);
44
-  extern "C" void UART2_IRQHandler(void) {
44
+  extern "C" void UART2_IRQHandler() {
45
     MSerial2.IRQHandler();
45
     MSerial2.IRQHandler();
46
   }
46
   }
47
 #endif
47
 #endif
48
 
48
 
49
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3)
49
 #if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3)
50
   MarlinSerial MSerial3(LPC_UART3);
50
   MarlinSerial MSerial3(LPC_UART3);
51
-  extern "C" void UART3_IRQHandler(void) {
51
+  extern "C" void UART3_IRQHandler() {
52
     MSerial3.IRQHandler();
52
     MSerial3.IRQHandler();
53
   }
53
   }
54
 #endif
54
 #endif

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

38
 #include "../../module/endstops.h"
38
 #include "../../module/endstops.h"
39
 
39
 
40
 // One ISR for all EXT-Interrupts
40
 // One ISR for all EXT-Interrupts
41
-void endstop_ISR(void) { endstops.update(); }
41
+void endstop_ISR() { endstops.update(); }
42
 
42
 
43
-void setup_endstop_interrupts(void) {
43
+void setup_endstop_interrupts() {
44
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
44
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
45
   #if HAS_X_MAX
45
   #if HAS_X_MAX
46
     #if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN)
46
     #if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN)

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c View File

89
   return 1;
89
   return 1;
90
 }
90
 }
91
 
91
 
92
-void digipot_mcp4451_init(void) {
92
+void digipot_mcp4451_init() {
93
   /**
93
   /**
94
    * Init I2C pin connect
94
    * Init I2C pin connect
95
    */
95
    */

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

45
 #include <lpc17xx_libcfg_default.h>
45
 #include <lpc17xx_libcfg_default.h>
46
 
46
 
47
 uint8_t digipot_mcp4451_start(uint8_t sla);
47
 uint8_t digipot_mcp4451_start(uint8_t sla);
48
-void digipot_mcp4451_init(void);
48
+void digipot_mcp4451_init();
49
 uint8_t digipot_mcp4451_send_byte(uint8_t data);
49
 uint8_t digipot_mcp4451_send_byte(uint8_t data);
50
 
50
 
51
 #ifdef __cplusplus
51
 #ifdef __cplusplus

+ 3
- 3
Marlin/src/HAL/HAL_LPC1768/main.cpp View File

42
 
42
 
43
 extern uint32_t MSC_SD_Init(uint8_t pdrv);
43
 extern uint32_t MSC_SD_Init(uint8_t pdrv);
44
 extern "C" int isLPC1769();
44
 extern "C" int isLPC1769();
45
-extern "C" void disk_timerproc(void);
45
+extern "C" void disk_timerproc();
46
 
46
 
47
 void SysTick_Callback() { disk_timerproc(); }
47
 void SysTick_Callback() { disk_timerproc(); }
48
 
48
 
49
-void HAL_init(void) {
49
+void HAL_init() {
50
 
50
 
51
   // Init LEDs
51
   // Init LEDs
52
   #if PIN_EXISTS(LED)
52
   #if PIN_EXISTS(LED)
149
 }
149
 }
150
 
150
 
151
 // HAL idle task
151
 // HAL idle task
152
-void HAL_idletask(void) {
152
+void HAL_idletask() {
153
   #if ENABLED(SHARED_SD_CARD)
153
   #if ENABLED(SHARED_SD_CARD)
154
     // If Marlin is using the SD card we need to lock it to prevent access from
154
     // If Marlin is using the SD card we need to lock it to prevent access from
155
     // a PC via USB.
155
     // a PC via USB.

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

31
 #include "../../inc/MarlinConfig.h"
31
 #include "../../inc/MarlinConfig.h"
32
 #include "timers.h"
32
 #include "timers.h"
33
 
33
 
34
-void HAL_timer_init(void) {
34
+void HAL_timer_init() {
35
   SBI(LPC_SC->PCONP, SBIT_TIMER0);  // Power ON Timer 0
35
   SBI(LPC_SC->PCONP, SBIT_TIMER0);  // Power ON Timer 0
36
   LPC_TIM0->PR = (HAL_TIMER_RATE) / (STEPPER_TIMER_RATE) - 1; // Use prescaler to set frequency if needed
36
   LPC_TIM0->PR = (HAL_TIMER_RATE) / (STEPPER_TIMER_RATE) - 1; // Use prescaler to set frequency if needed
37
 
37
 

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

53
 
53
 
54
 #define _HAL_TIMER(T) _CAT(LPC_TIM, T)
54
 #define _HAL_TIMER(T) _CAT(LPC_TIM, T)
55
 #define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn
55
 #define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn
56
-#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler(void)
56
+#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler()
57
 #define _HAL_TIMER_ISR(T)  __HAL_TIMER_ISR(T)
57
 #define _HAL_TIMER_ISR(T)  __HAL_TIMER_ISR(T)
58
 
58
 
59
 typedef uint32_t hal_timer_t;
59
 typedef uint32_t hal_timer_t;
94
 // ------------------------
94
 // ------------------------
95
 // Public functions
95
 // Public functions
96
 // ------------------------
96
 // ------------------------
97
-void HAL_timer_init(void);
97
+void HAL_timer_init();
98
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
98
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
99
 
99
 
100
 FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
100
 FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c View File

163
   return 1;
163
   return 1;
164
 }
164
 }
165
 
165
 
166
-void u8g_i2c_stop(void) {
166
+void u8g_i2c_stop() {
167
 }
167
 }
168
 
168
 
169
 
169
 

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

25
 uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos);
25
 uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos);
26
 uint8_t u8g_i2c_start(uint8_t sla);
26
 uint8_t u8g_i2c_start(uint8_t sla);
27
 uint8_t u8g_i2c_send_byte(uint8_t data);
27
 uint8_t u8g_i2c_send_byte(uint8_t data);
28
-void u8g_i2c_stop(void);
28
+void u8g_i2c_stop();

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

35
 #endif
35
 #endif
36
 
36
 
37
 void U8g_delay(int msec);
37
 void U8g_delay(int msec);
38
-void u8g_MicroDelay(void);
39
-void u8g_10MicroDelay(void);
38
+void u8g_MicroDelay();
39
+void u8g_10MicroDelay();
40
 
40
 
41
 #ifdef __cplusplus
41
 #ifdef __cplusplus
42
   }
42
   }

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction View File

138
 }
138
 }
139
 
139
 
140
 
140
 
141
-void u8g_i2c_stop_sw(void) { }
141
+void u8g_i2c_stop_sw() { }
142
 
142
 
143
 void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit
143
 void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit
144
 
144
 

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

29
 #include "lpc17xx_wdt.h"
29
 #include "lpc17xx_wdt.h"
30
 #include "watchdog.h"
30
 #include "watchdog.h"
31
 
31
 
32
-void watchdog_init(void) {
32
+void watchdog_init() {
33
   #if ENABLED(WATCHDOG_RESET_MANUAL)
33
   #if ENABLED(WATCHDOG_RESET_MANUAL)
34
     // We enable the watchdog timer, but only for the interrupt.
34
     // We enable the watchdog timer, but only for the interrupt.
35
 
35
 
56
   WDT_Start(WDT_TIMEOUT);
56
   WDT_Start(WDT_TIMEOUT);
57
 }
57
 }
58
 
58
 
59
-void HAL_clear_reset_source(void) {
59
+void HAL_clear_reset_source() {
60
   WDT_ClrTimeOutFlag();
60
   WDT_ClrTimeOutFlag();
61
 }
61
 }
62
 
62
 
63
-uint8_t HAL_get_reset_source(void) {
63
+uint8_t HAL_get_reset_source() {
64
   if (TEST(WDT_ReadTimeOutFlag(), 0)) return RST_WATCHDOG;
64
   if (TEST(WDT_ReadTimeOutFlag(), 0)) return RST_WATCHDOG;
65
   return RST_POWER_ON;
65
   return RST_POWER_ON;
66
 }
66
 }
74
 
74
 
75
 #else
75
 #else
76
 
76
 
77
-void watchdog_init(void) {}
78
-void watchdog_reset(void) {}
79
-void HAL_clear_reset_source(void) {}
80
-uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
77
+void watchdog_init() {}
78
+void watchdog_reset() {}
79
+void HAL_clear_reset_source() {}
80
+uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
81
 
81
 
82
 #endif // USE_WATCHDOG
82
 #endif // USE_WATCHDOG
83
 
83
 

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

23
 
23
 
24
 #define WDT_TIMEOUT   4000000 // 4 second timeout
24
 #define WDT_TIMEOUT   4000000 // 4 second timeout
25
 
25
 
26
-void watchdog_init(void);
27
-void watchdog_reset(void);
28
-void HAL_clear_reset_source(void);
29
-uint8_t HAL_get_reset_source(void);
26
+void watchdog_init();
27
+void watchdog_reset();
28
+void HAL_clear_reset_source();
29
+uint8_t HAL_get_reset_source();

+ 6
- 6
Marlin/src/HAL/HAL_SAMD51/HAL.cpp View File

368
 // ------------------------
368
 // ------------------------
369
 
369
 
370
 // HAL initialization task
370
 // HAL initialization task
371
-void HAL_init(void) {
371
+void HAL_init() {
372
   #if DMA_IS_REQUIRED
372
   #if DMA_IS_REQUIRED
373
     dma_init();
373
     dma_init();
374
   #endif
374
   #endif
383
 
383
 
384
 // HAL idle task
384
 // HAL idle task
385
 /*
385
 /*
386
-void HAL_idletask(void) {
386
+void HAL_idletask() {
387
 }
387
 }
388
 */
388
 */
389
 
389
 
390
-void HAL_clear_reset_source(void) { }
390
+void HAL_clear_reset_source() { }
391
 
391
 
392
 #pragma push_macro("WDT")
392
 #pragma push_macro("WDT")
393
 #undef WDT    // Required to be able to use '.bit.WDT'. Compiler wrongly replace struct field with WDT define
393
 #undef WDT    // Required to be able to use '.bit.WDT'. Compiler wrongly replace struct field with WDT define
394
-uint8_t HAL_get_reset_source(void) {
394
+uint8_t HAL_get_reset_source() {
395
   RSTC_RCAUSE_Type resetCause;
395
   RSTC_RCAUSE_Type resetCause;
396
 
396
 
397
   resetCause.reg = REG_RSTC_RCAUSE;
397
   resetCause.reg = REG_RSTC_RCAUSE;
421
 // ADC
421
 // ADC
422
 // ------------------------
422
 // ------------------------
423
 
423
 
424
-void HAL_adc_init(void) {
424
+void HAL_adc_init() {
425
   #if ADC_IS_REQUIRED
425
   #if ADC_IS_REQUIRED
426
     memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results));                 // Fill result with invalid values
426
     memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results));                 // Fill result with invalid values
427
 
427
 
469
   HAL_adc_result = 0xFFFF;
469
   HAL_adc_result = 0xFFFF;
470
 }
470
 }
471
 
471
 
472
-uint16_t HAL_adc_get_result(void) {
472
+uint16_t HAL_adc_get_result() {
473
   return HAL_adc_result;
473
   return HAL_adc_result;
474
 }
474
 }
475
 
475
 

+ 7
- 7
Marlin/src/HAL/HAL_SAMD51/HAL.h View File

91
 #define cli() __disable_irq()       // Disable interrupts
91
 #define cli() __disable_irq()       // Disable interrupts
92
 #define sei() __enable_irq()        // Enable interrupts
92
 #define sei() __enable_irq()        // Enable interrupts
93
 
93
 
94
-void HAL_clear_reset_source(void);  // clear reset reason
95
-uint8_t HAL_get_reset_source(void); // get reset reason
94
+void HAL_clear_reset_source();  // clear reset reason
95
+uint8_t HAL_get_reset_source(); // get reset reason
96
 
96
 
97
 //
97
 //
98
 // EEPROM
98
 // EEPROM
107
 
107
 
108
 #define HAL_ANALOG_SELECT(pin)
108
 #define HAL_ANALOG_SELECT(pin)
109
 
109
 
110
-void HAL_adc_init(void);
110
+void HAL_adc_init();
111
 
111
 
112
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
112
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
113
 #define HAL_READ_ADC()      HAL_adc_result
113
 #define HAL_READ_ADC()      HAL_adc_result
114
 #define HAL_ADC_READY()     true
114
 #define HAL_ADC_READY()     true
115
 
115
 
116
 void HAL_adc_start_conversion(const uint8_t adc_pin);
116
 void HAL_adc_start_conversion(const uint8_t adc_pin);
117
-uint16_t HAL_adc_get_result(void);
117
+uint16_t HAL_adc_get_result();
118
 
118
 
119
 //
119
 //
120
 // Pin Map
120
 // Pin Map
131
 void noTone(const pin_t _pin);
131
 void noTone(const pin_t _pin);
132
 
132
 
133
 // Enable hooks into idle and setup for HAL
133
 // Enable hooks into idle and setup for HAL
134
-void HAL_init(void);
134
+void HAL_init();
135
 /*
135
 /*
136
 #define HAL_IDLETASK 1
136
 #define HAL_IDLETASK 1
137
-void HAL_idletask(void);
137
+void HAL_idletask();
138
 */
138
 */
139
 
139
 
140
 //
140
 //
144
 
144
 
145
 #pragma GCC diagnostic push
145
 #pragma GCC diagnostic push
146
 #pragma GCC diagnostic ignored "-Wunused-function"
146
 #pragma GCC diagnostic ignored "-Wunused-function"
147
-int freeMemory(void);
147
+int freeMemory();
148
 #pragma GCC diagnostic pop
148
 #pragma GCC diagnostic pop
149
 
149
 
150
 #ifdef __cplusplus
150
 #ifdef __cplusplus

+ 2
- 2
Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp View File

64
   // ------------------------
64
   // ------------------------
65
   // Hardware SPI
65
   // Hardware SPI
66
   // ------------------------
66
   // ------------------------
67
-  void spiBegin(void) {
67
+  void spiBegin() {
68
     spiInit(SPI_HALF_SPEED);
68
     spiInit(SPI_HALF_SPEED);
69
   }
69
   }
70
 
70
 
92
    *
92
    *
93
    * @details
93
    * @details
94
    */
94
    */
95
-  uint8_t spiRec(void) {
95
+  uint8_t spiRec() {
96
     sdSPI.beginTransaction(spiConfig);
96
     sdSPI.beginTransaction(spiConfig);
97
     uint8_t returnByte = sdSPI.transfer(0xFF);
97
     uint8_t returnByte = sdSPI.transfer(0xFF);
98
     sdSPI.endTransaction();
98
     sdSPI.endTransaction();

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

112
                                  && !MATCH_Z_MIN_PROBE_EILINE(P))
112
                                  && !MATCH_Z_MIN_PROBE_EILINE(P))
113
 
113
 
114
 // One ISR for all EXT-Interrupts
114
 // One ISR for all EXT-Interrupts
115
-void endstop_ISR(void) { endstops.update(); }
115
+void endstop_ISR() { endstops.update(); }
116
 
116
 
117
-void setup_endstop_interrupts(void) {
117
+void setup_endstop_interrupts() {
118
   #if HAS_X_MAX
118
   #if HAS_X_MAX
119
     #if !AVAILABLE_EILINE(X_MAX_PIN)
119
     #if !AVAILABLE_EILINE(X_MAX_PIN)
120
       static_assert(false, "X_MAX_PIN has no EXTINT line available.");
120
       static_assert(false, "X_MAX_PIN has no EXTINT line available.");

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

27
 
27
 
28
   #include "watchdog.h"
28
   #include "watchdog.h"
29
 
29
 
30
-  void watchdog_init(void) {
30
+  void watchdog_init() {
31
     // The low-power oscillator used by the WDT runs at 32,768 Hz with
31
     // The low-power oscillator used by the WDT runs at 32,768 Hz with
32
     // a 1:32 prescale, thus 1024 Hz, though probably not super precise.
32
     // a 1:32 prescale, thus 1024 Hz, though probably not super precise.
33
 
33
 

+ 4
- 4
Marlin/src/HAL/HAL_STM32/HAL.cpp View File

60
 #endif
60
 #endif
61
 
61
 
62
 // HAL initialization task
62
 // HAL initialization task
63
-void HAL_init(void) {
63
+void HAL_init() {
64
   FastIO_init();
64
   FastIO_init();
65
 
65
 
66
   #if ENABLED(SDSUPPORT)
66
   #if ENABLED(SDSUPPORT)
84
   #endif // EEPROM_EMULATED_SRAM
84
   #endif // EEPROM_EMULATED_SRAM
85
 }
85
 }
86
 
86
 
87
-void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); }
87
+void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
88
 
88
 
89
-uint8_t HAL_get_reset_source(void) {
89
+uint8_t HAL_get_reset_source() {
90
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG;
90
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG;
91
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET)  return RST_SOFTWARE;
91
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET)  return RST_SOFTWARE;
92
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET)  return RST_EXTERNAL;
92
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET)  return RST_EXTERNAL;
108
   HAL_adc_result = analogRead(adc_pin);
108
   HAL_adc_result = analogRead(adc_pin);
109
 }
109
 }
110
 
110
 
111
-uint16_t HAL_adc_get_result(void) {
111
+uint16_t HAL_adc_get_result() {
112
   return HAL_adc_result;
112
   return HAL_adc_result;
113
 }
113
 }
114
 
114
 

+ 5
- 5
Marlin/src/HAL/HAL_STM32/HAL.h View File

147
 #define __bss_end __bss_end__
147
 #define __bss_end __bss_end__
148
 
148
 
149
 // Enable hooks into  setup for HAL
149
 // Enable hooks into  setup for HAL
150
-void HAL_init(void);
150
+void HAL_init();
151
 
151
 
152
 // Clear reset reason
152
 // Clear reset reason
153
-void HAL_clear_reset_source(void);
153
+void HAL_clear_reset_source();
154
 
154
 
155
 // Reset reason
155
 // Reset reason
156
-uint8_t HAL_get_reset_source(void);
156
+uint8_t HAL_get_reset_source();
157
 
157
 
158
 void _delay_ms(const int delay);
158
 void _delay_ms(const int delay);
159
 
159
 
185
 
185
 
186
 #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
186
 #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
187
 
187
 
188
-inline void HAL_adc_init(void) {}
188
+inline void HAL_adc_init() {}
189
 
189
 
190
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
190
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
191
 #define HAL_READ_ADC()      HAL_adc_result
191
 #define HAL_READ_ADC()      HAL_adc_result
193
 
193
 
194
 void HAL_adc_start_conversion(const uint8_t adc_pin);
194
 void HAL_adc_start_conversion(const uint8_t adc_pin);
195
 
195
 
196
-uint16_t HAL_adc_get_result(void);
196
+uint16_t HAL_adc_get_result();
197
 
197
 
198
 #define GET_PIN_MAP_PIN(index) index
198
 #define GET_PIN_MAP_PIN(index) index
199
 #define GET_PIN_MAP_INDEX(pin) pin
199
 #define GET_PIN_MAP_INDEX(pin) pin

+ 2
- 2
Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp View File

59
  *
59
  *
60
  * @details Only configures SS pin since stm32duino creates and initialize the SPI object
60
  * @details Only configures SS pin since stm32duino creates and initialize the SPI object
61
  */
61
  */
62
-void spiBegin(void) {
62
+void spiBegin() {
63
   #if !PIN_EXISTS(SS)
63
   #if !PIN_EXISTS(SS)
64
     #error "SS_PIN not defined!"
64
     #error "SS_PIN not defined!"
65
   #endif
65
   #endif
93
  *
93
  *
94
  * @details
94
  * @details
95
  */
95
  */
96
-uint8_t spiRec(void) {
96
+uint8_t spiRec() {
97
   SPI.beginTransaction(spiConfig);
97
   SPI.beginTransaction(spiConfig);
98
   uint8_t returnByte = SPI.transfer(0xFF);
98
   uint8_t returnByte = SPI.transfer(0xFF);
99
   SPI.endTransaction();
99
   SPI.endTransaction();

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

25
 #include "../../module/endstops.h"
25
 #include "../../module/endstops.h"
26
 
26
 
27
 // One ISR for all EXT-Interrupts
27
 // One ISR for all EXT-Interrupts
28
-void endstop_ISR(void) { endstops.update(); }
28
+void endstop_ISR() { endstops.update(); }
29
 
29
 
30
-void setup_endstop_interrupts(void) {
30
+void setup_endstop_interrupts() {
31
   #if HAS_X_MAX
31
   #if HAS_X_MAX
32
     attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
32
     attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
33
   #endif
33
   #endif

+ 10
- 10
Marlin/src/HAL/HAL_STM32F1/HAL.cpp View File

201
     #if SERIAL_PORT > 0
201
     #if SERIAL_PORT > 0
202
       #if SERIAL_PORT2
202
       #if SERIAL_PORT2
203
         #if SERIAL_PORT2 > 0
203
         #if SERIAL_PORT2 > 0
204
-          void board_setup_usb(void) {}
204
+          void board_setup_usb() {}
205
         #endif
205
         #endif
206
       #else
206
       #else
207
-        void board_setup_usb(void) {}
207
+        void board_setup_usb() {}
208
       #endif
208
       #endif
209
     #endif
209
     #endif
210
   } }
210
   } }
211
 #endif
211
 #endif
212
 
212
 
213
-void HAL_init(void) {
213
+void HAL_init() {
214
   NVIC_SetPriorityGrouping(0x3);
214
   NVIC_SetPriorityGrouping(0x3);
215
   #if PIN_EXISTS(LED)
215
   #if PIN_EXISTS(LED)
216
     OUT_WRITE(LED_PIN, LOW);
216
     OUT_WRITE(LED_PIN, LOW);
226
 }
226
 }
227
 
227
 
228
 // HAL idle task
228
 // HAL idle task
229
-void HAL_idletask(void) {
229
+void HAL_idletask() {
230
   #ifdef USE_USB_COMPOSITE
230
   #ifdef USE_USB_COMPOSITE
231
     #if ENABLED(SHARED_SD_CARD)
231
     #if ENABLED(SHARED_SD_CARD)
232
       // If Marlin is using the SD card we need to lock it to prevent access from
232
       // If Marlin is using the SD card we need to lock it to prevent access from
245
 
245
 
246
 /* VGPV Done with defines
246
 /* VGPV Done with defines
247
 // disable interrupts
247
 // disable interrupts
248
-void cli(void) { noInterrupts(); }
248
+void cli() { noInterrupts(); }
249
 
249
 
250
 // enable interrupts
250
 // enable interrupts
251
-void sei(void) { interrupts(); }
251
+void sei() { interrupts(); }
252
 */
252
 */
253
 
253
 
254
-void HAL_clear_reset_source(void) { }
254
+void HAL_clear_reset_source() { }
255
 
255
 
256
 /**
256
 /**
257
  * TODO: Check this and change or remove.
257
  * TODO: Check this and change or remove.
258
  * currently returns 1 that's equal to poweron reset.
258
  * currently returns 1 that's equal to poweron reset.
259
  */
259
  */
260
-uint8_t HAL_get_reset_source(void) { return 1; }
260
+uint8_t HAL_get_reset_source() { return 1; }
261
 
261
 
262
 void _delay_ms(const int delay_ms) { delay(delay_ms); }
262
 void _delay_ms(const int delay_ms) { delay(delay_ms); }
263
 
263
 
297
 // ADC
297
 // ADC
298
 // ------------------------
298
 // ------------------------
299
 // Init the AD in continuous capture mode
299
 // Init the AD in continuous capture mode
300
-void HAL_adc_init(void) {
300
+void HAL_adc_init() {
301
   // configure the ADC
301
   // configure the ADC
302
   adc.calibrate();
302
   adc.calibrate();
303
   #if F_CPU > 72000000
303
   #if F_CPU > 72000000
356
   HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
356
   HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
357
 }
357
 }
358
 
358
 
359
-uint16_t HAL_adc_get_result(void) { return HAL_adc_result; }
359
+uint16_t HAL_adc_get_result() { return HAL_adc_result; }
360
 
360
 
361
 uint16_t analogRead(pin_t pin) {
361
 uint16_t analogRead(pin_t pin) {
362
   const bool is_analog = _GET_MODE(pin) == GPIO_INPUT_ANALOG;
362
   const bool is_analog = _GET_MODE(pin) == GPIO_INPUT_ANALOG;

+ 7
- 7
Marlin/src/HAL/HAL_STM32F1/HAL.h View File

116
 #endif
116
 #endif
117
 
117
 
118
 // Set interrupt grouping for this MCU
118
 // Set interrupt grouping for this MCU
119
-void HAL_init(void);
119
+void HAL_init();
120
 #define HAL_IDLETASK 1
120
 #define HAL_IDLETASK 1
121
-void HAL_idletask(void);
121
+void HAL_idletask();
122
 
122
 
123
 /**
123
 /**
124
  * TODO: review this to return 1 for pins that are not analog input
124
  * TODO: review this to return 1 for pins that are not analog input
183
 #define __bss_end __bss_end__
183
 #define __bss_end __bss_end__
184
 
184
 
185
 // Clear reset reason
185
 // Clear reset reason
186
-void HAL_clear_reset_source(void);
186
+void HAL_clear_reset_source();
187
 
187
 
188
 // Reset reason
188
 // Reset reason
189
-uint8_t HAL_get_reset_source(void);
189
+uint8_t HAL_get_reset_source();
190
 
190
 
191
 void _delay_ms(const int delay);
191
 void _delay_ms(const int delay);
192
 
192
 
195
 
195
 
196
 /*
196
 /*
197
 extern "C" {
197
 extern "C" {
198
-  int freeMemory(void);
198
+  int freeMemory();
199
 }
199
 }
200
 */
200
 */
201
 
201
 
235
 
235
 
236
 #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG);
236
 #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG);
237
 
237
 
238
-void HAL_adc_init(void);
238
+void HAL_adc_init();
239
 
239
 
240
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
240
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
241
 #define HAL_READ_ADC()      HAL_adc_result
241
 #define HAL_READ_ADC()      HAL_adc_result
242
 #define HAL_ADC_READY()     true
242
 #define HAL_ADC_READY()     true
243
 
243
 
244
 void HAL_adc_start_conversion(const uint8_t adc_pin);
244
 void HAL_adc_start_conversion(const uint8_t adc_pin);
245
-uint16_t HAL_adc_get_result(void);
245
+uint16_t HAL_adc_get_result();
246
 
246
 
247
 uint16_t analogRead(pin_t pin); // need HAL_ANALOG_SELECT() first
247
 uint16_t analogRead(pin_t pin); // need HAL_ANALOG_SELECT() first
248
 void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!?
248
 void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!?

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp View File

112
  *
112
  *
113
  * @details
113
  * @details
114
  */
114
  */
115
-uint8_t spiRec(void) {
115
+uint8_t spiRec() {
116
   uint8_t returnByte = SPI.transfer(ff);
116
   uint8_t returnByte = SPI.transfer(ff);
117
   return returnByte;
117
   return returnByte;
118
 }
118
 }

+ 2
- 2
Marlin/src/HAL/HAL_STM32F1/SPI.cpp View File

499
  *  New functions added to manage callbacks.
499
  *  New functions added to manage callbacks.
500
  *  Victor Perez 2017
500
  *  Victor Perez 2017
501
  */
501
  */
502
-void SPIClass::onReceive(void(*callback)(void)) {
502
+void SPIClass::onReceive(void(*callback)()) {
503
   _currentSetting->receiveCallback = callback;
503
   _currentSetting->receiveCallback = callback;
504
   if (callback) {
504
   if (callback) {
505
     switch (_currentSetting->spi_d->clk_id) {
505
     switch (_currentSetting->spi_d->clk_id) {
527
   }
527
   }
528
 }
528
 }
529
 
529
 
530
-void SPIClass::onTransmit(void(*callback)(void)) {
530
+void SPIClass::onTransmit(void(*callback)()) {
531
   _currentSetting->transmitCallback = callback;
531
   _currentSetting->transmitCallback = callback;
532
   if (callback) {
532
   if (callback) {
533
     switch (_currentSetting->spi_d->clk_id) {
533
     switch (_currentSetting->spi_d->clk_id) {

+ 5
- 5
Marlin/src/HAL/HAL_STM32F1/SPI.h View File

137
   spi_dev *spi_d;
137
   spi_dev *spi_d;
138
   dma_channel spiRxDmaChannel, spiTxDmaChannel;
138
   dma_channel spiRxDmaChannel, spiTxDmaChannel;
139
   dma_dev* spiDmaDev;
139
   dma_dev* spiDmaDev;
140
-  void (*receiveCallback)(void) = NULL;
141
-  void (*transmitCallback)(void) = NULL;
140
+  void (*receiveCallback)() = NULL;
141
+  void (*transmitCallback)() = NULL;
142
 
142
 
143
   friend class SPIClass;
143
   friend class SPIClass;
144
 };
144
 };
213
    * onTransmit used to set the callback in case of dmaSend (tx only). That function
213
    * onTransmit used to set the callback in case of dmaSend (tx only). That function
214
    * will NOT be called in case of TX/RX
214
    * will NOT be called in case of TX/RX
215
    */
215
    */
216
-  void onReceive(void(*)(void));
217
-  void onTransmit(void(*)(void));
216
+  void onReceive(void(*)());
217
+  void onTransmit(void(*)());
218
 
218
 
219
   /*
219
   /*
220
    * I/O
220
    * I/O
327
    * @brief Get a pointer to the underlying libmaple spi_dev for
327
    * @brief Get a pointer to the underlying libmaple spi_dev for
328
    *        this HardwareSPI instance.
328
    *        this HardwareSPI instance.
329
    */
329
    */
330
-  spi_dev* c_dev(void) { return _currentSetting->spi_d; }
330
+  spi_dev* c_dev() { return _currentSetting->spi_d; }
331
 
331
 
332
   spi_dev* dev() { return _currentSetting->spi_d; }
332
   spi_dev* dev() { return _currentSetting->spi_d; }
333
 
333
 

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/Servo.cpp View File

148
 }
148
 }
149
 
149
 
150
 #ifdef SERVO0_TIMER_NUM
150
 #ifdef SERVO0_TIMER_NUM
151
-  extern "C" void Servo_IRQHandler(void) {
151
+  extern "C" void Servo_IRQHandler() {
152
     static timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM);
152
     static timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM);
153
     uint16_t SR = timer_get_status(tdev);
153
     uint16_t SR = timer_get_status(tdev);
154
     if (SR & TIMER_SR_CC1IF) { // channel 1 off
154
     if (SR & TIMER_SR_CC1IF) { // channel 1 off

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp View File

113
 #define __ASM __asm
113
 #define __ASM __asm
114
 #define __STATIC_INLINE static inline
114
 #define __STATIC_INLINE static inline
115
 
115
 
116
-__attribute__((always_inline)) __STATIC_INLINE void __DSB(void) {
116
+__attribute__((always_inline)) __STATIC_INLINE void __DSB() {
117
   __ASM volatile ("dsb 0xF":::"memory");
117
   __ASM volatile ("dsb 0xF":::"memory");
118
 }
118
 }
119
 
119
 

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

50
 #include "../../module/endstops.h"
50
 #include "../../module/endstops.h"
51
 
51
 
52
 // One ISR for all EXT-Interrupts
52
 // One ISR for all EXT-Interrupts
53
-void endstop_ISR(void) { endstops.update(); }
53
+void endstop_ISR() { endstops.update(); }
54
 
54
 
55
-void setup_endstop_interrupts(void) {
55
+void setup_endstop_interrupts() {
56
   #if HAS_X_MAX
56
   #if HAS_X_MAX
57
     attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it
57
     attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it
58
   #endif
58
   #endif

+ 4
- 4
Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp View File

128
 /* Deselect card and release SPI                                         */
128
 /* Deselect card and release SPI                                         */
129
 /*-----------------------------------------------------------------------*/
129
 /*-----------------------------------------------------------------------*/
130
 
130
 
131
-static void deselect(void) {
131
+static void deselect() {
132
   CS_HIGH();    /* CS = H */
132
   CS_HIGH();    /* CS = H */
133
   xchg_spi(0xFF); /* Dummy clock (force DO hi-z for multiple slave SPI) */
133
   xchg_spi(0xFF); /* Dummy clock (force DO hi-z for multiple slave SPI) */
134
 }
134
 }
137
 /* Select card and wait for ready                                        */
137
 /* Select card and wait for ready                                        */
138
 /*-----------------------------------------------------------------------*/
138
 /*-----------------------------------------------------------------------*/
139
 
139
 
140
-static int select(void) { /* 1:OK, 0:Timeout */
140
+static int select() { /* 1:OK, 0:Timeout */
141
   CS_LOW();   /* CS = L */
141
   CS_LOW();   /* CS = L */
142
   xchg_spi(0xFF); /* Dummy clock (force DO enabled) */
142
   xchg_spi(0xFF); /* Dummy clock (force DO enabled) */
143
 
143
 
151
 /* Control SPI module (Platform dependent)                               */
151
 /* Control SPI module (Platform dependent)                               */
152
 /*-----------------------------------------------------------------------*/
152
 /*-----------------------------------------------------------------------*/
153
 
153
 
154
-static void power_on(void) {  /* Enable SSP module and attach it to I/O pads */
154
+static void power_on() {  /* Enable SSP module and attach it to I/O pads */
155
   ONBOARD_SD_SPI.setModule(ON_BOARD_SPI_DEVICE);
155
   ONBOARD_SD_SPI.setModule(ON_BOARD_SPI_DEVICE);
156
   ONBOARD_SD_SPI.begin();
156
   ONBOARD_SD_SPI.begin();
157
   ONBOARD_SD_SPI.setBitOrder(MSBFIRST);
157
   ONBOARD_SD_SPI.setBitOrder(MSBFIRST);
159
   OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); /* Set CS# high */
159
   OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); /* Set CS# high */
160
 }
160
 }
161
 
161
 
162
-static void power_off(void) {   /* Disable SPI function */
162
+static void power_off() {   /* Disable SPI function */
163
   select();       /* Wait for card ready */
163
   select();       /* Wait for card ready */
164
   deselect();
164
   deselect();
165
 }
165
 }

+ 10
- 10
Marlin/src/HAL/HAL_STM32F1/sdio.cpp View File

33
 
33
 
34
 SDIO_CardInfoTypeDef SdCard;
34
 SDIO_CardInfoTypeDef SdCard;
35
 
35
 
36
-bool SDIO_Init(void) {
36
+bool SDIO_Init() {
37
   uint32_t count = 0U;
37
   uint32_t count = 0U;
38
   SdCard.CardType = SdCard.CardVersion = SdCard.Class = SdCard.RelCardAdd = SdCard.BlockNbr = SdCard.BlockSize = SdCard.LogBlockNbr = SdCard.LogBlockSize = 0;
38
   SdCard.CardType = SdCard.CardVersion = SdCard.Class = SdCard.RelCardAdd = SdCard.BlockNbr = SdCard.BlockSize = SdCard.LogBlockNbr = SdCard.LogBlockSize = 0;
39
 
39
 
167
   return false;
167
   return false;
168
 }
168
 }
169
 
169
 
170
-inline uint32_t SDIO_GetCardState(void) { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; }
170
+inline uint32_t SDIO_GetCardState() { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; }
171
 
171
 
172
 // ------------------------
172
 // ------------------------
173
 // SD Commands and Responses
173
 // SD Commands and Responses
174
 // ------------------------
174
 // ------------------------
175
 
175
 
176
 void SDIO_SendCommand(uint16_t command, uint32_t argument) { SDIO->ARG = argument; SDIO->CMD = (uint32_t)(SDIO_CMD_CPSMEN | command); }
176
 void SDIO_SendCommand(uint16_t command, uint32_t argument) { SDIO->ARG = argument; SDIO->CMD = (uint32_t)(SDIO_CMD_CPSMEN | command); }
177
-uint8_t SDIO_GetCommandResponse(void) { return (uint8_t)(SDIO->RESPCMD); }
177
+uint8_t SDIO_GetCommandResponse() { return (uint8_t)(SDIO->RESPCMD); }
178
 uint32_t SDIO_GetResponse(uint32_t response) { return SDIO->RESP[response]; }
178
 uint32_t SDIO_GetResponse(uint32_t response) { return SDIO->RESP[response]; }
179
 
179
 
180
-bool SDIO_CmdGoIdleState(void) { SDIO_SendCommand(CMD0_GO_IDLE_STATE, 0); return SDIO_GetCmdError(); }
181
-bool SDIO_CmdSendCID(void) { SDIO_SendCommand(CMD2_ALL_SEND_CID, 0); return SDIO_GetCmdResp2(); }
180
+bool SDIO_CmdGoIdleState() { SDIO_SendCommand(CMD0_GO_IDLE_STATE, 0); return SDIO_GetCmdError(); }
181
+bool SDIO_CmdSendCID() { SDIO_SendCommand(CMD2_ALL_SEND_CID, 0); return SDIO_GetCmdResp2(); }
182
 bool SDIO_CmdSetRelAdd(uint32_t *rca) { SDIO_SendCommand(CMD3_SET_REL_ADDR, 0); return SDIO_GetCmdResp6(SDMMC_CMD_SET_REL_ADDR, rca); }
182
 bool SDIO_CmdSetRelAdd(uint32_t *rca) { SDIO_SendCommand(CMD3_SET_REL_ADDR, 0); return SDIO_GetCmdResp6(SDMMC_CMD_SET_REL_ADDR, rca); }
183
 bool SDIO_CmdSelDesel(uint32_t address) { SDIO_SendCommand(CMD7_SEL_DESEL_CARD, address); return SDIO_GetCmdResp1(SDMMC_CMD_SEL_DESEL_CARD); }
183
 bool SDIO_CmdSelDesel(uint32_t address) { SDIO_SendCommand(CMD7_SEL_DESEL_CARD, address); return SDIO_GetCmdResp1(SDMMC_CMD_SEL_DESEL_CARD); }
184
-bool SDIO_CmdOperCond(void) { SDIO_SendCommand(CMD8_HS_SEND_EXT_CSD, SDMMC_CHECK_PATTERN); return SDIO_GetCmdResp7(); }
184
+bool SDIO_CmdOperCond() { SDIO_SendCommand(CMD8_HS_SEND_EXT_CSD, SDMMC_CHECK_PATTERN); return SDIO_GetCmdResp7(); }
185
 bool SDIO_CmdSendCSD(uint32_t argument) { SDIO_SendCommand(CMD9_SEND_CSD, argument); return SDIO_GetCmdResp2(); }
185
 bool SDIO_CmdSendCSD(uint32_t argument) { SDIO_SendCommand(CMD9_SEND_CSD, argument); return SDIO_GetCmdResp2(); }
186
 bool SDIO_CmdSendStatus(uint32_t argument) { SDIO_SendCommand(CMD13_SEND_STATUS, argument); return SDIO_GetCmdResp1(SDMMC_CMD_SEND_STATUS); }
186
 bool SDIO_CmdSendStatus(uint32_t argument) { SDIO_SendCommand(CMD13_SEND_STATUS, argument); return SDIO_GetCmdResp1(SDMMC_CMD_SEND_STATUS); }
187
 bool SDIO_CmdReadSingleBlock(uint32_t address) { SDIO_SendCommand(CMD17_READ_SINGLE_BLOCK, address); return SDIO_GetCmdResp1(SDMMC_CMD_READ_SINGLE_BLOCK); }
187
 bool SDIO_CmdReadSingleBlock(uint32_t address) { SDIO_SendCommand(CMD17_READ_SINGLE_BLOCK, address); return SDIO_GetCmdResp1(SDMMC_CMD_READ_SINGLE_BLOCK); }
212
   do { if (!--count) return false; } while (!SDIO_GET_FLAG(FLAGS)); \
212
   do { if (!--count) return false; } while (!SDIO_GET_FLAG(FLAGS)); \
213
 }while(0)
213
 }while(0)
214
 
214
 
215
-bool SDIO_GetCmdError(void) {
215
+bool SDIO_GetCmdError() {
216
   SDIO_WAIT(SDIO_STA_CMDSENT);
216
   SDIO_WAIT(SDIO_STA_CMDSENT);
217
 
217
 
218
   SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS);
218
   SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS);
232
   return (SDIO_GetResponse(SDIO_RESP1) & SDMMC_OCR_ERRORBITS) == SDMMC_ALLZERO;
232
   return (SDIO_GetResponse(SDIO_RESP1) & SDMMC_OCR_ERRORBITS) == SDMMC_ALLZERO;
233
 }
233
 }
234
 
234
 
235
-bool SDIO_GetCmdResp2(void) {
235
+bool SDIO_GetCmdResp2() {
236
   SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT);
236
   SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT);
237
 
237
 
238
   if (SDIO_GET_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT)) {
238
   if (SDIO_GET_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT)) {
244
   return true;
244
   return true;
245
 }
245
 }
246
 
246
 
247
-bool SDIO_GetCmdResp3(void) {
247
+bool SDIO_GetCmdResp3() {
248
   SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT);
248
   SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT);
249
 
249
 
250
   if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) {
250
   if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) {
272
   return true;
272
   return true;
273
 }
273
 }
274
 
274
 
275
-bool SDIO_GetCmdResp7(void) {
275
+bool SDIO_GetCmdResp7() {
276
   SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT);
276
   SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT);
277
 
277
 
278
   if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) {
278
   if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) {

+ 9
- 9
Marlin/src/HAL/HAL_STM32F1/sdio.h View File

121
 // Public functions
121
 // Public functions
122
 // ------------------------
122
 // ------------------------
123
 
123
 
124
-inline uint32_t SDIO_GetCardState(void);
124
+inline uint32_t SDIO_GetCardState();
125
 
125
 
126
-bool SDIO_CmdGoIdleState(void);
127
-bool SDIO_CmdSendCID(void);
126
+bool SDIO_CmdGoIdleState();
127
+bool SDIO_CmdSendCID();
128
 bool SDIO_CmdSetRelAdd(uint32_t *rca);
128
 bool SDIO_CmdSetRelAdd(uint32_t *rca);
129
 bool SDIO_CmdSelDesel(uint32_t address);
129
 bool SDIO_CmdSelDesel(uint32_t address);
130
-bool SDIO_CmdOperCond(void);
130
+bool SDIO_CmdOperCond();
131
 bool SDIO_CmdSendCSD(uint32_t argument);
131
 bool SDIO_CmdSendCSD(uint32_t argument);
132
 bool SDIO_CmdSendStatus(uint32_t argument);
132
 bool SDIO_CmdSendStatus(uint32_t argument);
133
 bool SDIO_CmdReadSingleBlock(uint32_t address);
133
 bool SDIO_CmdReadSingleBlock(uint32_t address);
139
 bool SDIO_CmdAppSetClearCardDetect(uint32_t rsa);
139
 bool SDIO_CmdAppSetClearCardDetect(uint32_t rsa);
140
 
140
 
141
 void SDIO_SendCommand(uint16_t command, uint32_t argument);
141
 void SDIO_SendCommand(uint16_t command, uint32_t argument);
142
-uint8_t SDIO_GetCommandResponse(void);
142
+uint8_t SDIO_GetCommandResponse();
143
 uint32_t SDIO_GetResponse(uint32_t response);
143
 uint32_t SDIO_GetResponse(uint32_t response);
144
-bool SDIO_GetCmdError(void);
144
+bool SDIO_GetCmdError();
145
 bool SDIO_GetCmdResp1(uint8_t command);
145
 bool SDIO_GetCmdResp1(uint8_t command);
146
-bool SDIO_GetCmdResp2(void);
147
-bool SDIO_GetCmdResp3(void);
146
+bool SDIO_GetCmdResp2();
147
+bool SDIO_GetCmdResp3();
148
 bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca);
148
 bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca);
149
-bool SDIO_GetCmdResp7(void);
149
+bool SDIO_GetCmdResp7();

+ 4
- 4
Marlin/src/HAL/HAL_STM32F1/timers.h View File

86
 
86
 
87
 // TODO change this
87
 // TODO change this
88
 
88
 
89
-#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void)
90
-#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void)
89
+#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
90
+#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
91
 
91
 
92
-extern "C" void tempTC_Handler(void);
93
-extern "C" void stepTC_Handler(void);
92
+extern "C" void tempTC_Handler();
93
+extern "C" void stepTC_Handler();
94
 
94
 
95
 // ------------------------
95
 // ------------------------
96
 // Public Variables
96
 // Public Variables

+ 2
- 2
Marlin/src/HAL/HAL_STM32F1/watchdog.cpp View File

40
   iwdg_feed();
40
   iwdg_feed();
41
 }
41
 }
42
 
42
 
43
-void watchdogSetup(void) {
43
+void watchdogSetup() {
44
   // do whatever. don't remove this function.
44
   // do whatever. don't remove this function.
45
 }
45
 }
46
 
46
 
51
  *
51
  *
52
  * @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0)
52
  * @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0)
53
  */
53
  */
54
-void watchdog_init(void) {
54
+void watchdog_init() {
55
   //iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
55
   //iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
56
 }
56
 }
57
 
57
 

+ 5
- 5
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp View File

39
 
39
 
40
 /* VGPV Done with defines
40
 /* VGPV Done with defines
41
 // disable interrupts
41
 // disable interrupts
42
-void cli(void) { noInterrupts(); }
42
+void cli() { noInterrupts(); }
43
 
43
 
44
 // enable interrupts
44
 // enable interrupts
45
-void sei(void) { interrupts(); }
45
+void sei() { interrupts(); }
46
 */
46
 */
47
 
47
 
48
-void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); }
48
+void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
49
 
49
 
50
-uint8_t HAL_get_reset_source(void) {
50
+uint8_t HAL_get_reset_source() {
51
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG;
51
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG;
52
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST)  != RESET) return RST_SOFTWARE;
52
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST)  != RESET) return RST_SOFTWARE;
53
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST)  != RESET) return RST_EXTERNAL;
53
   if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST)  != RESET) return RST_EXTERNAL;
91
 
91
 
92
 void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); }
92
 void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); }
93
 
93
 
94
-uint16_t HAL_adc_get_result(void) { return HAL_adc_result; }
94
+uint16_t HAL_adc_get_result() { return HAL_adc_result; }
95
 
95
 
96
 #endif // STM32GENERIC && (STM32F4 || STM32F7)
96
 #endif // STM32GENERIC && (STM32F4 || STM32F7)

+ 7
- 7
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h View File

150
 // Memory related
150
 // Memory related
151
 #define __bss_end __bss_end__
151
 #define __bss_end __bss_end__
152
 
152
 
153
-inline void HAL_init(void) { }
153
+inline void HAL_init() { }
154
 
154
 
155
 // Clear reset reason
155
 // Clear reset reason
156
-void HAL_clear_reset_source(void);
156
+void HAL_clear_reset_source();
157
 
157
 
158
 // Reset reason
158
 // Reset reason
159
-uint8_t HAL_get_reset_source(void);
159
+uint8_t HAL_get_reset_source();
160
 
160
 
161
 void _delay_ms(const int delay);
161
 void _delay_ms(const int delay);
162
 
162
 
163
 /*
163
 /*
164
 extern "C" {
164
 extern "C" {
165
-  int freeMemory(void);
165
+  int freeMemory();
166
 }
166
 }
167
 */
167
 */
168
 
168
 
179
 #pragma GCC diagnostic push
179
 #pragma GCC diagnostic push
180
 #pragma GCC diagnostic ignored "-Wunused-function"
180
 #pragma GCC diagnostic ignored "-Wunused-function"
181
 
181
 
182
-static inline int freeMemory(void) {
182
+static inline int freeMemory() {
183
   volatile char top;
183
   volatile char top;
184
   return &top - reinterpret_cast<char*>(_sbrk(0));
184
   return &top - reinterpret_cast<char*>(_sbrk(0));
185
 }
185
 }
205
 
205
 
206
 #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
206
 #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
207
 
207
 
208
-inline void HAL_adc_init(void) {}
208
+inline void HAL_adc_init() {}
209
 
209
 
210
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
210
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
211
 #define HAL_READ_ADC()      HAL_adc_result
211
 #define HAL_READ_ADC()      HAL_adc_result
212
 #define HAL_ADC_READY()     true
212
 #define HAL_ADC_READY()     true
213
 
213
 
214
 void HAL_adc_start_conversion(const uint8_t adc_pin);
214
 void HAL_adc_start_conversion(const uint8_t adc_pin);
215
-uint16_t HAL_adc_get_result(void);
215
+uint16_t HAL_adc_get_result();
216
 
216
 
217
 #define GET_PIN_MAP_PIN(index) index
217
 #define GET_PIN_MAP_PIN(index) index
218
 #define GET_PIN_MAP_INDEX(pin) pin
218
 #define GET_PIN_MAP_INDEX(pin) pin

+ 2
- 2
Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp View File

71
  *
71
  *
72
  * @details Only configures SS pin since libmaple creates and initialize the SPI object
72
  * @details Only configures SS pin since libmaple creates and initialize the SPI object
73
  */
73
  */
74
-void spiBegin(void) {
74
+void spiBegin() {
75
   #if !defined(SS_PIN) || SS_PIN < 0
75
   #if !defined(SS_PIN) || SS_PIN < 0
76
     #error SS_PIN not defined!
76
     #error SS_PIN not defined!
77
   #endif
77
   #endif
103
  *
103
  *
104
  * @details
104
  * @details
105
  */
105
  */
106
-uint8_t spiRec(void) {
106
+uint8_t spiRec() {
107
   SPI.beginTransaction(spiConfig);
107
   SPI.beginTransaction(spiConfig);
108
   uint8_t returnByte = SPI.transfer(0xFF);
108
   uint8_t returnByte = SPI.transfer(0xFF);
109
   SPI.endTransaction();
109
   SPI.endTransaction();

+ 0
- 0
Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save