From 2ca990eb5397b51074fcd4919b3b2ecba8d54fe3 Mon Sep 17 00:00:00 2001 From: Ahmet Alincak Date: Mon, 11 Jan 2021 15:08:14 +0300 Subject: [PATCH] Use MBED_ALIGN and remove mbed.h from header --- targets/TARGET_Maxim/USBPhyHw.h | 1 - targets/TARGET_Maxim/USBPhy_Maxim.cpp | 13 +++---------- targets/targets.json | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/targets/TARGET_Maxim/USBPhyHw.h b/targets/TARGET_Maxim/USBPhyHw.h index 1476fa797f..15a71f412e 100644 --- a/targets/TARGET_Maxim/USBPhyHw.h +++ b/targets/TARGET_Maxim/USBPhyHw.h @@ -18,7 +18,6 @@ #ifndef USBPHYHW_H #define USBPHYHW_H -#include "mbed.h" #include "USBPhy.h" diff --git a/targets/TARGET_Maxim/USBPhy_Maxim.cpp b/targets/TARGET_Maxim/USBPhy_Maxim.cpp index be1f8da95b..e2fbd79c3d 100644 --- a/targets/TARGET_Maxim/USBPhy_Maxim.cpp +++ b/targets/TARGET_Maxim/USBPhy_Maxim.cpp @@ -18,6 +18,7 @@ #if defined(DEVICE_USBDEVICE) && (DEVICE_USBDEVICE) && \ (defined(TARGET_MAX32620) || defined(TARGET_MAX32625) || defined(TARGET_MAX32630)) +#include "mbed.h" #include "USBPhyHw.h" #include "usb_phy_api.h" #include "USBEndpoints_Maxim.h" @@ -57,19 +58,11 @@ static enum { } control_state; // Static storage for endpoint buffer descriptor table. Must be 512 byte aligned for DMA. -#ifdef __IAR_SYSTEMS_ICC__ -#pragma data_alignment = 512 -#else -__attribute__ ((aligned (512))) -#endif +MBED_ALIGN(512) ep_buffer_descriptor_t ep_buffer_descriptor; // static storage for temporary data buffers. Must be 32 byte aligned. -#ifdef __IAR_SYSTEMS_ICC__ -#pragma data_alignment = 4 -#else -__attribute__ ((aligned (4))) -#endif +MBED_ALIGN(4) static uint8_t aligned_buffer[NUMBER_OF_LOGICAL_ENDPOINTS][MXC_USB_MAX_PACKET]; static uint8_t* read_buf_addr[NUMBER_OF_LOGICAL_ENDPOINTS]; diff --git a/targets/targets.json b/targets/targets.json index 835ab3284b..81c4b8d2fe 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -5094,7 +5094,7 @@ "STDIO_MESSAGES", "USTICKER", "MPU", - "SLEEP" + "SLEEP", "USBDEVICE" ], "release_versions": [