diff options
| author | Man, Jianting (Meco) <[email protected]> | 2022-12-11 13:12:03 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-11 13:12:03 -0500 |
| commit | 99bdf978d7fe4ec18ed50a639e15b254825c871b (patch) | |
| tree | 51ffb6f5fae10f2ce9a6baf4b861c025b8056fb6 /components/drivers | |
| parent | a4b8762d8584b02a9b1f1c675a97ecaa105144be (diff) | |
[rtdef] use lower-case to define attributes (#6728)
* [rtdef] rename RT_WEAK attribute as rt_weak
* [rtdef] rename RT_USED attribute as rt_used
* [rtdef] rename RT_SECTION attribute as rt_section
* [rtdef] rename ALIGN attribute as rt_align
* [legacy] add RT_USED ALIGN RT_SECTION RT_WEAK as legacy support
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/pm/pm.c | 8 | ||||
| -rw-r--r-- | components/drivers/spi/spi_wifi_rw009.c | 6 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/audio_mic.c | 12 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/audio_speaker.c | 12 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/cdc_vcom.c | 16 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/ecm.c | 18 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/hid.c | 14 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/mstorage.c | 10 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/rndis.c | 22 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/class/winusb.c | 12 | ||||
| -rw-r--r-- | components/drivers/usb/usbdevice/core/usbdevice_core.c | 2 |
11 files changed, 66 insertions, 66 deletions
diff --git a/components/drivers/pm/pm.c b/components/drivers/pm/pm.c index b4dee11e41..0c6dcf065d 100644 --- a/components/drivers/pm/pm.c +++ b/components/drivers/pm/pm.c @@ -64,12 +64,12 @@ static rt_uint8_t _pm_default_deepsleep = RT_PM_DEFAULT_DEEPSLEEP_MODE; static struct rt_pm_notify _pm_notify; static rt_uint8_t _pm_init_flag = 0; -RT_WEAK rt_uint32_t rt_pm_enter_critical(rt_uint8_t sleep_mode) +rt_weak rt_uint32_t rt_pm_enter_critical(rt_uint8_t sleep_mode) { return rt_hw_interrupt_disable(); } -RT_WEAK void rt_pm_exit_critical(rt_uint32_t ctx, rt_uint8_t sleep_mode) +rt_weak void rt_pm_exit_critical(rt_uint32_t ctx, rt_uint8_t sleep_mode) { rt_hw_interrupt_enable(ctx); } @@ -288,7 +288,7 @@ static rt_bool_t _pm_device_check_idle(void) return RT_TRUE; } -RT_WEAK rt_tick_t pm_timer_next_timeout_tick(rt_uint8_t mode) +rt_weak rt_tick_t pm_timer_next_timeout_tick(rt_uint8_t mode) { switch (mode) { @@ -310,7 +310,7 @@ RT_WEAK rt_tick_t pm_timer_next_timeout_tick(rt_uint8_t mode) * * @return none */ -RT_WEAK rt_uint8_t pm_get_sleep_threshold_mode(rt_uint8_t cur_mode, rt_tick_t timeout_tick) +rt_weak rt_uint8_t pm_get_sleep_threshold_mode(rt_uint8_t cur_mode, rt_tick_t timeout_tick) { rt_uint8_t sleep_mode = cur_mode; diff --git a/components/drivers/spi/spi_wifi_rw009.c b/components/drivers/spi/spi_wifi_rw009.c index 20dd6d7f93..39388f10c4 100644 --- a/components/drivers/spi/spi_wifi_rw009.c +++ b/components/drivers/spi/spi_wifi_rw009.c @@ -68,12 +68,12 @@ struct rw009_wifi struct rt_mailbox rw009_cmd_mb; uint32_t last_cmd; - ALIGN(4) + rt_align(4) rt_uint8_t spi_tx_mempool[(sizeof(struct spi_data_packet) + 4) * SPI_TX_POOL_SIZE]; - ALIGN(4) + rt_align(4) rt_uint8_t spi_rx_mempool[(sizeof(struct spi_data_packet) + 4) * SPI_RX_POOL_SIZE]; - ALIGN(4) + rt_align(4) uint8_t spi_hw_rx_buffer[MAX_SPI_BUFFER_SIZE]; /* status for RW009 */ diff --git a/components/drivers/usb/usbdevice/class/audio_mic.c b/components/drivers/usb/usbdevice/class/audio_mic.c index 81170b8a72..afedf2ef2d 100644 --- a/components/drivers/usb/usbdevice/class/audio_mic.c +++ b/components/drivers/usb/usbdevice/class/audio_mic.c @@ -88,7 +88,7 @@ struct uac_audio_mic }; static struct uac_audio_mic mic; -ALIGN(4) +rt_align(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -108,7 +108,7 @@ static struct udevice_descriptor dev_desc = }; //FS and HS needed -ALIGN(4) +rt_align(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -122,7 +122,7 @@ static struct usb_qualifier_descriptor dev_qualifier = 0, }; -ALIGN(4) +rt_align(4) const static char *_ustring[] = { "Language", @@ -133,7 +133,7 @@ const static char *_ustring[] = "Interface", }; -ALIGN(4) +rt_align(4) static struct uac_ac_descriptor ac_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -214,7 +214,7 @@ static struct uac_ac_descriptor ac_desc = #endif }; -ALIGN(4) +rt_align(4) static struct uinterface_descriptor as_desc0 = { USB_DESC_LENGTH_INTERFACE, @@ -228,7 +228,7 @@ static struct uinterface_descriptor as_desc0 = 0x00, }; -ALIGN(4) +rt_align(4) static struct uac_as_descriptor as_desc = { /* Interface Descriptor */ diff --git a/components/drivers/usb/usbdevice/class/audio_speaker.c b/components/drivers/usb/usbdevice/class/audio_speaker.c index 6148478c02..67da8105e4 100644 --- a/components/drivers/usb/usbdevice/class/audio_speaker.c +++ b/components/drivers/usb/usbdevice/class/audio_speaker.c @@ -89,7 +89,7 @@ struct uac_audio_speaker }; static struct uac_audio_speaker speaker; -ALIGN(4) +rt_align(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -109,7 +109,7 @@ static struct udevice_descriptor dev_desc = }; //FS and HS needed -ALIGN(4) +rt_align(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -123,7 +123,7 @@ static struct usb_qualifier_descriptor dev_qualifier = 0, }; -ALIGN(4) +rt_align(4) const static char *_ustring[] = { "Language", @@ -134,7 +134,7 @@ const static char *_ustring[] = "Interface", }; -ALIGN(4) +rt_align(4) static struct uac_ac_descriptor ac_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -214,7 +214,7 @@ static struct uac_ac_descriptor ac_desc = #endif }; -ALIGN(4) +rt_align(4) static struct uinterface_descriptor as_desc0 = { USB_DESC_LENGTH_INTERFACE, @@ -228,7 +228,7 @@ static struct uinterface_descriptor as_desc0 = 0x00, }; -ALIGN(4) +rt_align(4) static struct uac_as_descriptor as_desc = { /* Interface Descriptor */ diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index 91b49d47de..8eacd9248d 100644 --- a/components/drivers/usb/usbdevice/class/cdc_vcom.c +++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c @@ -57,7 +57,7 @@ #define _SER_NO_LEN 14 /*rt_strlen("32021919830108")*/ #endif /*RT_VCOM_SER_LEN*/ -ALIGN(RT_ALIGN_SIZE) +rt_align(RT_ALIGN_SIZE) static rt_uint8_t vcom_thread_stack[VCOM_TASK_STK_SIZE]; static struct rt_thread vcom_thread; static struct ucdc_line_coding line_coding; @@ -91,7 +91,7 @@ struct vcom_tx_msg rt_size_t size; }; -ALIGN(4) +rt_align(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -111,7 +111,7 @@ static struct udevice_descriptor dev_desc = }; //FS and HS needed -ALIGN(4) +rt_align(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -126,7 +126,7 @@ static struct usb_qualifier_descriptor dev_qualifier = }; /* communcation interface descriptor */ -ALIGN(4) +rt_align(4) const static struct ucdc_comm_descriptor _comm_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -200,7 +200,7 @@ const static struct ucdc_comm_descriptor _comm_desc = }; /* data interface descriptor */ -ALIGN(4) +rt_align(4) const static struct ucdc_data_descriptor _data_desc = { /* interface descriptor */ @@ -234,15 +234,15 @@ const static struct ucdc_data_descriptor _data_desc = 0x00, }, }; -ALIGN(4) +rt_align(4) static char serno[_SER_NO_LEN + 1] = {'\0'}; -RT_WEAK rt_err_t vcom_get_stored_serno(char *serno, int size); +rt_weak rt_err_t vcom_get_stored_serno(char *serno, int size); rt_err_t vcom_get_stored_serno(char *serno, int size) { return RT_ERROR; } -ALIGN(4) +rt_align(4) const static char* _ustring[] = { "Language", diff --git a/components/drivers/usb/usbdevice/class/ecm.c b/components/drivers/usb/usbdevice/class/ecm.c index 575da357e5..4f41c00531 100644 --- a/components/drivers/usb/usbdevice/class/ecm.c +++ b/components/drivers/usb/usbdevice/class/ecm.c @@ -36,13 +36,13 @@ struct rt_ecm_eth rt_uint8_t host_addr[MAX_ADDR_LEN]; rt_uint8_t dev_addr[MAX_ADDR_LEN]; - ALIGN(4) + rt_align(4) rt_uint8_t rx_pool[512]; - ALIGN(4) + rt_align(4) rt_size_t rx_size; - ALIGN(4) + rt_align(4) rt_size_t rx_offset; - ALIGN(4) + rt_align(4) char rx_buffer[USB_ETH_MTU]; char tx_buffer[USB_ETH_MTU]; @@ -51,7 +51,7 @@ struct rt_ecm_eth }; typedef struct rt_ecm_eth * rt_ecm_eth_t; -ALIGN(4) +rt_align(4) static struct udevice_descriptor _dev_desc = { USB_DESC_LENGTH_DEVICE, /* bLength */ @@ -71,7 +71,7 @@ static struct udevice_descriptor _dev_desc = }; /* communcation interface descriptor */ -ALIGN(4) +rt_align(4) const static struct ucdc_eth_descriptor _comm_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -141,7 +141,7 @@ const static struct ucdc_eth_descriptor _comm_desc = }; /* data interface descriptor */ -ALIGN(4) +rt_align(4) const static struct ucdc_data_descriptor _data_desc = { /* interface descriptor */ @@ -176,7 +176,7 @@ const static struct ucdc_data_descriptor _data_desc = }, }; -ALIGN(4) +rt_align(4) const static char* _ustring[] = { "Language", /* LANGID */ @@ -187,7 +187,7 @@ const static char* _ustring[] = "Interface", /* INTERFACE */ }; -ALIGN(4) +rt_align(4) //FS and HS needed static struct usb_qualifier_descriptor dev_qualifier = { diff --git a/components/drivers/usb/usbdevice/class/hid.c b/components/drivers/usb/usbdevice/class/hid.c index aa8877e471..a95e1d82e5 100644 --- a/components/drivers/usb/usbdevice/class/hid.c +++ b/components/drivers/usb/usbdevice/class/hid.c @@ -31,7 +31,7 @@ struct hid_s }; /* CustomHID_ConfigDescriptor */ -ALIGN(4) +rt_align(4) const rt_uint8_t _report_desc[]= { #ifdef RT_USB_DEVICE_HID_KEYBOARD @@ -236,7 +236,7 @@ const rt_uint8_t _report_desc[]= #endif }; /* CustomHID_ReportDescriptor */ -ALIGN(4) +rt_align(4) static struct udevice_descriptor _dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -256,7 +256,7 @@ static struct udevice_descriptor _dev_desc = }; //FS and HS needed -ALIGN(4) +rt_align(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -272,7 +272,7 @@ static struct usb_qualifier_descriptor dev_qualifier = /* hid interface descriptor */ -ALIGN(4) +rt_align(4) const static struct uhid_comm_descriptor _hid_comm_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -361,7 +361,7 @@ const static struct uhid_comm_descriptor _hid_comm_desc = }, }; -ALIGN(4) +rt_align(4) const static char* _ustring[] = { "Language", @@ -612,11 +612,11 @@ static rt_size_t _hid_write(rt_device_t dev, rt_off_t pos, const void *buffer, r return 0; } -RT_WEAK void HID_Report_Received(hid_report_t report) +rt_weak void HID_Report_Received(hid_report_t report) { dump_report(report); } -ALIGN(RT_ALIGN_SIZE) +rt_align(RT_ALIGN_SIZE) static rt_uint8_t hid_thread_stack[512]; static struct rt_thread hid_thread; diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c index 97a189834b..b8f21a29df 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.c +++ b/components/drivers/usb/usbdevice/class/mstorage.c @@ -71,7 +71,7 @@ struct mstorage struct rt_device_blk_geometry geometry; }; -ALIGN(4) +rt_align(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -91,7 +91,7 @@ static struct udevice_descriptor dev_desc = }; //FS and HS needed -ALIGN(4) +rt_align(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -106,7 +106,7 @@ static struct usb_qualifier_descriptor dev_qualifier = }; -ALIGN(4) +rt_align(4) const static struct umass_descriptor _mass_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -157,7 +157,7 @@ const static struct umass_descriptor _mass_desc = }, }; -ALIGN(4) +rt_align(4) const static char* _ustring[] = { "Language", @@ -180,7 +180,7 @@ static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw); static rt_size_t _write_10(ufunction_t func, ustorage_cbw_t cbw); static rt_size_t _verify_10(ufunction_t func, ustorage_cbw_t cbw); -ALIGN(4) +rt_align(4) static struct scsi_cmd cmd_data[] = { {SCSI_TEST_UNIT_READY, _test_unit_ready, 6, FIXED, 0, DIR_NONE}, diff --git a/components/drivers/usb/usbdevice/class/rndis.c b/components/drivers/usb/usbdevice/class/rndis.c index 69ca3f5d69..425ff62ee1 100644 --- a/components/drivers/usb/usbdevice/class/rndis.c +++ b/components/drivers/usb/usbdevice/class/rndis.c @@ -53,20 +53,20 @@ struct rt_rndis_eth struct rt_timer timer; #endif /* RNDIS_DELAY_LINK_UP */ - ALIGN(4) + rt_align(4) rt_uint8_t rx_pool[512]; - ALIGN(4) + rt_align(4) rt_uint8_t tx_pool[512]; rt_uint32_t cmd_pool[2]; - ALIGN(4) + rt_align(4) char rx_buffer[sizeof(struct rndis_packet_msg) + USB_ETH_MTU + 14]; rt_size_t rx_offset; rt_size_t rx_length; rt_bool_t rx_flag; rt_bool_t rx_frist; - ALIGN(4) + rt_align(4) char tx_buffer[sizeof(struct rndis_packet_msg) + USB_ETH_MTU + 14]; struct rt_semaphore tx_buffer_free; @@ -77,7 +77,7 @@ struct rt_rndis_eth typedef struct rt_rndis_eth * rt_rndis_eth_t; static rt_uint32_t oid_packet_filter = 0x0000000; -ALIGN(4) +rt_align(4) static struct udevice_descriptor _dev_desc = { USB_DESC_LENGTH_DEVICE, /* bLength */ @@ -97,7 +97,7 @@ static struct udevice_descriptor _dev_desc = }; /* communcation interface descriptor */ -ALIGN(4) +rt_align(4) const static struct ucdc_comm_descriptor _comm_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -171,7 +171,7 @@ const static struct ucdc_comm_descriptor _comm_desc = }; /* data interface descriptor */ -ALIGN(4) +rt_align(4) const static struct ucdc_data_descriptor _data_desc = { /* interface descriptor */ @@ -206,7 +206,7 @@ const static struct ucdc_data_descriptor _data_desc = }, }; -ALIGN(4) +rt_align(4) const static char* _ustring[] = { "Language", /* LANGID */ @@ -218,7 +218,7 @@ const static char* _ustring[] = USB_STRING_OS }; -ALIGN(4) +rt_align(4) struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc = { .bFirstInterfaceNumber = USB_DYNAMIC, @@ -229,7 +229,7 @@ struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc = }; //FS and HS needed -ALIGN(4) +rt_align(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -244,7 +244,7 @@ static struct usb_qualifier_descriptor dev_qualifier = }; /* supported OIDs */ -ALIGN(4) +rt_align(4) const static rt_uint32_t oid_supported_list[] = { /* General OIDs */ diff --git a/components/drivers/usb/usbdevice/class/winusb.c b/components/drivers/usb/usbdevice/class/winusb.c index b5a169d2cb..4e534399be 100644 --- a/components/drivers/usb/usbdevice/class/winusb.c +++ b/components/drivers/usb/usbdevice/class/winusb.c @@ -22,7 +22,7 @@ struct winusb_device #define WINUSB_INTF_STR_INDEX 13 typedef struct winusb_device * winusb_device_t; -ALIGN(4) +rt_align(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -42,7 +42,7 @@ static struct udevice_descriptor dev_desc = }; //FS and HS needed -ALIGN(4) +rt_align(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -56,7 +56,7 @@ static struct usb_qualifier_descriptor dev_qualifier = 0, }; -ALIGN(4) +rt_align(4) struct winusb_descriptor _winusb_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -108,7 +108,7 @@ struct winusb_descriptor _winusb_desc = }, }; -ALIGN(4) +rt_align(4) const static char* _ustring[] = { "Language", @@ -120,13 +120,13 @@ const static char* _ustring[] = USB_STRING_OS//must be }; -ALIGN(4) +rt_align(4) struct usb_os_proerty winusb_proerty[] = { USB_OS_PROPERTY_DESC(USB_OS_PROPERTY_TYPE_REG_SZ,"DeviceInterfaceGUID",RT_WINUSB_GUID), }; -ALIGN(4) +rt_align(4) struct usb_os_function_comp_id_descriptor winusb_func_comp_id_desc = { .bFirstInterfaceNumber = USB_DYNAMIC, diff --git a/components/drivers/usb/usbdevice/core/usbdevice_core.c b/components/drivers/usb/usbdevice/core/usbdevice_core.c index 7b3a3ff67d..58d7170012 100644 --- a/components/drivers/usb/usbdevice/core/usbdevice_core.c +++ b/components/drivers/usb/usbdevice/core/usbdevice_core.c @@ -2225,7 +2225,7 @@ rt_err_t rt_usbd_event_signal(struct udev_msg* msg) } -ALIGN(RT_ALIGN_SIZE) +rt_align(RT_ALIGN_SIZE) static rt_uint8_t usb_thread_stack[RT_USBD_THREAD_STACK_SZ]; static struct rt_thread usb_thread; #define USBD_MQ_MSG_SZ 32 |
