Browse Source

Keep C extension for now, restore (void) arg (#15380)

Marcio Teixeira 5 years ago
parent
commit
02bbc51195

+ 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)();
177
+  Ctrl_status (*test_unit_ready)(void);
178
   Ctrl_status (*read_capacity)(U32 *);
178
   Ctrl_status (*read_capacity)(U32 *);
179
   bool (*unload)(bool);
179
   bool (*unload)(bool);
180
-  bool (*wr_protect)();
181
-  bool (*removal)();
180
+  bool (*wr_protect)(void);
181
+  bool (*removal)(void);
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()
258
+bool ctrl_access_init(void)
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()
278
+static bool ctrl_access_lock(void)
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()
292
+U8 get_nb_lun(void)
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()
313
+U8 get_cur_lun(void)
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();
194
+extern bool ctrl_access_init(void);
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();
202
+extern U8 get_nb_lun(void);
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();
210
+extern U8 get_cur_lun(void);
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.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();
81
+extern void           sd_mmc_spi_mem_init(void);
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();
94
+extern Ctrl_status    sd_mmc_spi_test_unit_ready(void);
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();
127
+extern bool           sd_mmc_spi_wr_protect(void);
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();
134
+extern bool           sd_mmc_spi_removal(void);
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()
74
+void sysclk_enable_usb(void)
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()
106
+void sysclk_disable_usb(void)
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();
217
-extern void sysclk_disable_usb();
216
+extern void sysclk_enable_usb(void);
217
+extern void sysclk_disable_usb(void);
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()
135
+	static const uint8_t *udc_get_string_serial_name(void)
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()
142
+	static const uint8_t *udc_get_string_serial_name(void)
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()
167
+usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void)
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()
177
+static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void)
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()
363
+void udc_start(void)
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()
370
+void udc_stop(void)
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()
380
+void udc_reset(void)
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()
407
+void udc_sof_notify(void)
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()
427
+static bool udc_req_std_dev_get_status(void)
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()
444
+static bool udc_req_std_ep_get_status(void)
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()
466
+static bool udc_req_std_dev_clear_feature(void)
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()
489
+static bool udc_req_std_ep_clear_feature(void)
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()
507
+static bool udc_req_std_dev_set_feature(void)
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()
570
+static bool udc_req_std_ep_set_feature(void)
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()
587
+static void udc_valid_address(void)
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()
597
+static bool udc_req_std_dev_set_address(void)
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()
614
+static bool udc_req_std_dev_get_str_desc(void)
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()
673
+static bool udc_req_std_dev_get_descriptor(void)
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()
790
+static bool udc_req_std_dev_get_configuration(void)
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()
805
+static bool udc_req_std_dev_set_configuration(void)
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()
870
+static bool udc_req_std_iface_get_setting(void)
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()
908
+static bool udc_req_std_iface_set_setting(void)
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()
936
+static bool udc_reqstd(void)
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()
1030
+static bool udc_req_iface(void)
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()
1065
+static bool udc_req_ep(void)
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()
1104
+bool udc_process_setup(void)
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()
175
+static inline bool udc_include_vbus_monitoring(void)
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();
182
+void udc_start(void);
183
 
183
 
184
 /*! \brief Stop the USB Device stack
184
 /*! \brief Stop the USB Device stack
185
  */
185
  */
186
-void udc_stop();
186
+void udc_stop(void);
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()
195
+static inline void udc_attach(void)
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()
206
+static inline void udc_detach(void)
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()
215
+static inline void udc_remotewakeup(void)
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();
226
+usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
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()
337
+	void usb_init(void)
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();
554
+	extern void my_callback_remotewakeup_enable(void);
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();
556
+	extern void my_callback_remotewakeup_disable(void);
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()
561
+	 void my_callback_remotewakeup_enable(void)
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()
565
+	 void my_callback_remotewakeup_disable(void)
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()
570
+	 void my_interrupt_event(void)
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(); \endcode
583
+	extern void my_callback_remotewakeup_enable(void); \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(); \endcode
586
+	extern void my_callback_remotewakeup_disable(void); \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()
608
+	extern void user_callback_suspend_action(void)
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()
610
+	extern void user_callback_resume_action(void)
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()
615
+	void user_callback_suspend_action(void)
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()
619
+	void user_callback_resume_action(void)
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(); \endcode
631
+	extern void user_callback_suspend_action(void); \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(); \endcode
634
+	extern void user_callback_resume_action(void); \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()
636
+ *   - \code void user_callback_suspend_action(void)
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()
667
+	 void init_build_usb_serial_number(void)
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()
686
+	 void init_build_usb_serial_number(void)
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)();
97
+	void (*callback)(void);
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)();
101
+	bool (*over_under_run)(void);
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)();
126
+typedef void (*udd_callback_halt_cleared_t)(void);
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();
145
+bool udd_include_vbus_monitoring(void);
146
 
146
 
147
 /**
147
 /**
148
  * \brief Enables the USB Device mode
148
  * \brief Enables the USB Device mode
149
  */
149
  */
150
-void udd_enable();
150
+void udd_enable(void);
151
 
151
 
152
 /**
152
 /**
153
  * \brief Disables the USB Device mode
153
  * \brief Disables the USB Device mode
154
  */
154
  */
155
-void udd_disable();
155
+void udd_disable(void);
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();
164
+void udd_attach(void);
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();
171
+void udd_detach(void);
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();
179
+bool udd_is_high_speed(void);
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();
193
+uint8_t udd_getaddress(void);
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();
200
+uint16_t udd_get_frame_number(void);
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();
207
+uint16_t udd_get_micro_frame_number(void);
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();
211
+void udd_send_remotewakeup(void);
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();
350
-void udd_test_mode_k();
351
-void udd_test_mode_se0_nak();
352
-void udd_test_mode_packet();
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);
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();
373
+extern bool udc_process_setup(void);
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();
380
+extern void udc_reset(void);
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();
387
+extern void udc_sof_notify(void);
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)();
85
+	bool (*enable)(void);
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)();
98
+	void (*disable)(void);
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)();
111
+	bool (*setup)(void);
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)();
120
+	uint8_t (*getsetting)(void);
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)();
125
+	void (*sof_notify)(void);
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();
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();
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);
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();
133
+static uint8_t udi_cdc_setup_to_port(void);
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();
140
+static void udi_cdc_line_coding_received(void);
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()
270
+bool udi_cdc_comm_enable(void)
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()
324
+bool udi_cdc_data_enable(void)
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()
363
+void udi_cdc_comm_disable(void)
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()
369
+void udi_cdc_data_disable(void)
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()
380
+bool udi_cdc_comm_setup(void)
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()
436
+bool udi_cdc_data_setup(void)
437
 {
437
 {
438
 	return false;  // request Not supported
438
 	return false;  // request Not supported
439
 }
439
 }
440
 
440
 
441
-uint8_t udi_cdc_getsetting()
441
+uint8_t udi_cdc_getsetting(void)
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()
446
+void udi_cdc_data_sof_notify(void)
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()
464
+static uint8_t udi_cdc_setup_to_port(void)
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()
482
+static void udi_cdc_line_coding_received(void)
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()
800
+void udi_cdc_signal_framing_error(void)
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()
805
+void udi_cdc_signal_parity_error(void)
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()
810
+void udi_cdc_signal_overrun(void)
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()
856
+iram_size_t udi_cdc_get_nb_received_data(void)
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()
866
+bool udi_cdc_is_rx_ready(void)
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()
915
+int udi_cdc_getc(void)
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()
1044
+iram_size_t udi_cdc_get_free_tx_buffer(void)
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()
1054
+bool udi_cdc_is_tx_ready(void)
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();
369
+void udi_cdc_signal_framing_error(void);
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();
374
+void udi_cdc_signal_parity_error(void);
375
 
375
 
376
 /**
376
 /**
377
  * \brief Notify a overrun
377
  * \brief Notify a overrun
378
  */
378
  */
379
-void udi_cdc_signal_overrun();
379
+void udi_cdc_signal_overrun(void);
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();
386
+iram_size_t udi_cdc_get_nb_received_data(void);
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();
393
+bool udi_cdc_is_rx_ready(void);
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();
400
+int udi_cdc_getc(void);
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();
428
+iram_size_t udi_cdc_get_free_tx_buffer(void);
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();
436
+bool udi_cdc_is_tx_ready(void);
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();
614
+	 extern bool my_callback_cdc_enable(void);
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();
616
+	 extern void my_callback_cdc_disable(void);
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()
630
+	 bool my_callback_cdc_enable(void)
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()
635
+	 void my_callback_cdc_disable(void)
636
 	 {
636
 	 {
637
 	    my_flag_autorize_cdc_transfert = false;
637
 	    my_flag_autorize_cdc_transfert = false;
638
 	 }
638
 	 }
639
 
639
 
640
-	 void task()
640
+	 void task(void)
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(); \endcode
655
+	 extern bool my_callback_cdc_enable(void); \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(); \endcode
662
+	 extern void my_callback_cdc_disable(void); \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();
676
+	int udi_cdc_getc(void);
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();
75
-void udi_msc_disable();
76
-bool udi_msc_setup();
77
-uint8_t udi_msc_getsetting();
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);
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();
154
+static void udi_msc_cbw_invalid(void);
155
 
155
 
156
 /**
156
 /**
157
  * \brief Stall CSW request
157
  * \brief Stall CSW request
158
  */
158
  */
159
-static void udi_msc_csw_invalid();
159
+static void udi_msc_csw_invalid(void);
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();
168
+static void udi_msc_cbw_wait(void);
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();
231
+static void udi_msc_csw_process(void);
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();
239
+void udi_msc_csw_send(void);
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();
262
+static void udi_msc_clear_sense(void);
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();
277
+static void udi_msc_sense_pass(void);
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();
282
+static void udi_msc_sense_fail_not_present(void);
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();
287
+static void udi_msc_sense_fail_busy_or_change(void);
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();
292
+static void udi_msc_sense_fail_hardware(void);
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();
297
+static void udi_msc_sense_fail_protected(void);
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();
302
+static void udi_msc_sense_fail_cdb_invalid(void);
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();
307
+static void udi_msc_sense_command_invalid(void);
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();
320
+static void udi_msc_spc_requestsense(void);
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();
326
+static void udi_msc_spc_inquiry(void);
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();
333
+static bool udi_msc_spc_testunitready_global(void);
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();
339
+static void udi_msc_spc_testunitready(void);
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();
344
+static void udi_msc_spc_prevent_allow_medium_removal(void);
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();
357
+static void udi_msc_sbc_start_stop(void);
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();
362
+static void udi_msc_sbc_read_capacity(void);
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()
376
+bool udi_msc_enable(void)
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()
401
+void udi_msc_disable(void)
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()
410
+bool udi_msc_setup(void)
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()
454
+uint8_t udi_msc_getsetting(void)
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()
463
+static void udi_msc_cbw_invalid(void)
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()
472
+static void udi_msc_csw_invalid(void)
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()
481
+static void udi_msc_cbw_wait(void)
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()
651
+static void udi_msc_csw_process(void)
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()
668
+void udi_msc_csw_send(void)
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()
697
+static void udi_msc_clear_sense(void)
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()
718
+static void udi_msc_sense_pass(void)
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()
725
+static void udi_msc_sense_fail_not_present(void)
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()
730
+static void udi_msc_sense_fail_busy_or_change(void)
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()
736
+static void udi_msc_sense_fail_hardware(void)
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()
742
+static void udi_msc_sense_fail_protected(void)
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()
747
+static void udi_msc_sense_fail_cdb_invalid(void)
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()
753
+static void udi_msc_sense_command_invalid(void)
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()
763
+static void udi_msc_spc_requestsense(void)
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()
778
+static void udi_msc_spc_inquiry(void)
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()
839
+static bool udi_msc_spc_testunitready_global(void)
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()
859
+static void udi_msc_spc_testunitready(void)
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()
947
+static void udi_msc_spc_prevent_allow_medium_removal(void)
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()
959
+static void udi_msc_sbc_start_stop(void)
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()
971
+static void udi_msc_sbc_read_capacity(void)
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()
1042
+bool udi_msc_process_trans(void)
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();
151
+bool udi_msc_process_trans(void);
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();
209
+	extern bool my_callback_msc_enable(void);
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();
211
+	extern void my_callback_msc_disable(void);
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()
218
+	 bool my_callback_msc_enable(void)
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()
223
+	 void my_callback_msc_disable(void)
224
 	 {
224
 	 {
225
 	    my_flag_autorize_msc_transfert = false;
225
 	    my_flag_autorize_msc_transfert = false;
226
 	 }
226
 	 }
227
 
227
 
228
-	 void task()
228
+	 void task(void)
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(); \endcode
247
+	extern bool my_callback_msc_enable(void); \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(); \endcode
255
+	extern void my_callback_msc_disable(void); \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() {
263
+ *   - \code  * void task(void) {
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() {
270
+	void msc_notify_trans(void) {
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();
360
+static void udd_reset_ep_ctrl(void);
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();
367
+static void udd_ctrl_init(void);
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();
370
+static void udd_ctrl_setup_received(void);
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();
373
+static void udd_ctrl_in_sent(void);
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();
376
+static void udd_ctrl_out_received(void);
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();
379
+static void udd_ctrl_underflow(void);
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();
382
+static void udd_ctrl_overflow(void);
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();
385
+static void udd_ctrl_stall_data(void);
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();
388
+static void udd_ctrl_send_zlp_in(void);
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();
391
+static void udd_ctrl_send_zlp_out(void);
392
 
392
 
393
 //! \brief Call callback associated to setup request
393
 //! \brief Call callback associated to setup request
394
-static void udd_ctrl_endofrequest();
394
+static void udd_ctrl_endofrequest(void);
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();
404
+static bool udd_ctrl_interrupt(void);
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();
451
+static void udd_ep_job_table_reset(void);
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();
454
+static void udd_ep_job_table_kill(void);
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();
503
+static bool udd_ep_interrupt(void);
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();
528
-void udd_interrupt()
527
+void udd_interrupt(void);
528
+void udd_interrupt(void)
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()
646
+bool udd_include_vbus_monitoring(void)
647
 {
647
 {
648
 	return true;
648
 	return true;
649
 }
649
 }
650
 
650
 
651
 
651
 
652
-void udd_enable()
652
+void udd_enable(void)
653
 {
653
 {
654
 	irqflags_t flags;
654
 	irqflags_t flags;
655
 
655
 
736
 }
736
 }
737
 
737
 
738
 
738
 
739
-void udd_disable()
739
+void udd_disable(void)
740
 {
740
 {
741
 	irqflags_t flags;
741
 	irqflags_t flags;
742
 
742
 
777
 }
777
 }
778
 
778
 
779
 
779
 
780
-void udd_attach()
780
+void udd_attach(void)
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()
821
+void udd_detach(void)
822
 {
822
 {
823
 	otg_unfreeze_clock();
823
 	otg_unfreeze_clock();
824
 
824
 
829
 }
829
 }
830
 
830
 
831
 
831
 
832
-bool udd_is_high_speed()
832
+bool udd_is_high_speed(void)
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()
850
+uint8_t udd_getaddress(void)
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()
856
+uint16_t udd_get_frame_number(void)
857
 {
857
 {
858
 	return udd_frame_number();
858
 	return udd_frame_number();
859
 }
859
 }
860
 
860
 
861
-uint16_t udd_get_micro_frame_number()
861
+uint16_t udd_get_micro_frame_number(void)
862
 {
862
 {
863
 	return udd_micro_frame_number();
863
 	return udd_micro_frame_number();
864
 }
864
 }
865
 
865
 
866
-void udd_send_remotewakeup()
866
+void udd_send_remotewakeup(void)
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()
1245
+void udd_test_mode_j(void)
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()
1252
+void udd_test_mode_k(void)
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()
1259
+void udd_test_mode_se0_nak(void)
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()
1265
+void udd_test_mode_packet(void)
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()
1313
+static void udd_reset_ep_ctrl(void)
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()
1337
+static void udd_ctrl_init(void)
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()
1360
+static void udd_ctrl_setup_received(void)
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()
1422
+static void udd_ctrl_in_sent(void)
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()
1506
+static void udd_ctrl_out_received(void)
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()
1597
+static void udd_ctrl_underflow(void)
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()
1614
+static void udd_ctrl_overflow(void)
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()
1630
+static void udd_ctrl_stall_data(void)
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()
1638
+static void udd_ctrl_send_zlp_in(void)
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()
1656
+static void udd_ctrl_send_zlp_out(void)
1657
 {
1657
 {
1658
 	irqflags_t flags;
1658
 	irqflags_t flags;
1659
 
1659
 
1669
 }
1669
 }
1670
 
1670
 
1671
 
1671
 
1672
-static void udd_ctrl_endofrequest()
1672
+static void udd_ctrl_endofrequest(void)
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()
1681
+static bool udd_ctrl_interrupt(void)
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()
1737
+static void udd_ep_job_table_reset(void)
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()
1747
+static void udd_ep_job_table_kill(void)
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()
1973
+static bool udd_ep_interrupt(void)
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();
69
+bool otg_dual_enable(void);
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();
75
+void otg_dual_disable(void);
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() {
59
+void usb_task_idle(void) {
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()                { 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; }
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; }
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()             { return main_b_cdc_enable; }
80
+bool usb_task_cdc_isenabled(void)             { 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()             { return main_b_dtr_active; }
124
+bool usb_task_cdc_dtr_active(void)             { 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() {
205
+bool usb_task_extra_string(void) {
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() {
265
+bool usb_task_other_requests(void) {
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() {
300
+void usb_task_init(void) {
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();
61
+bool usb_task_msc_enable(void);
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();
66
+void usb_task_msc_disable(void);
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();
87
+bool usb_task_msc_isenabled(void);
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();
91
+bool usb_task_cdc_isenabled(void);
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();
96
+bool usb_task_cdc_dtr_active(void);
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();
101
+bool usb_task_extra_string(void);
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();
105
+bool usb_task_other_requests(void);
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();
120
+void USBD_ISR(void);
121
 
121
 
122
 /*! \brief USB task init
122
 /*! \brief USB task init
123
  */
123
  */
124
-void usb_task_init();
124
+void usb_task_init(void);
125
 
125
 
126
 /*! \brief USB task idle
126
 /*! \brief USB task idle
127
  */
127
  */
128
-void usb_task_idle();
128
+void usb_task_idle(void);
129
 
129
 
130
 #ifdef __cplusplus
130
 #ifdef __cplusplus
131
 }
131
 }

Loading…
Cancel
Save