clean up helper func

This commit is contained in:
hathach
2018-10-23 12:19:32 +07:00
parent 14cebcb5f5
commit c7340f4b0e
39 changed files with 83 additions and 111 deletions
+2 -2
View File
@@ -61,8 +61,8 @@ extern usbh_device_info_t usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
//--------------------------------------------------------------------+
void ehci_controller_init(void)
{
memclr_(&lpc_usb0, sizeof(LPC_USB0_Type));
memclr_(&lpc_usb1, sizeof(LPC_USB1_Type));
tu_memclr(&lpc_usb0, sizeof(LPC_USB0_Type));
tu_memclr(&lpc_usb1, sizeof(LPC_USB1_Type));
}
void ehci_controller_control_xfer_proceed(uint8_t dev_addr, uint8_t p_data[])
+2 -2
View File
@@ -75,7 +75,7 @@
({\
uint32_t value=0;\
struct_type str;\
memclr_((void*)&str, sizeof(struct_type));\
tu_memclr((void*)&str, sizeof(struct_type));\
str.member.bitfield_member = 1;\
memcpy(&value, (void*)&str.member, sizeof(str.member));\
tu_log2( value );\
@@ -84,7 +84,7 @@
#define BITFIELD_OFFSET_OF_UINT32(struct_type, offset, bitfield_member) \
({\
struct_type str;\
memclr_(&str, sizeof(struct_type));\
tu_memclr(&str, sizeof(struct_type));\
str.bitfield_member = 1;\
tu_log2( ((uint32_t*) &str)[offset] );\
})