Skip to content

Commit bcf5b81

Browse files
committed
boards: fix compile failed
In file included from /home/ligd/platform/mainline/nuttx/include/nuttx/clock.h:38, from sam_automount.c:35: sam_automount.c:92:19: error: braced-group within expression allowed only inside a function 92 | .ddelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_DDELAY), | ^~~~~~~~~ sam_automount.c:93:19: error: braced-group within expression allowed only inside a function 93 | .udelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_UDELAY), | ^~~~~~~~~ Signed-off-by: ligd <[email protected]>
1 parent 21ebaa2 commit bcf5b81

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed

boards/arm/cxd56xx/spresense/src/cxd56_automount.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ static const struct cxd56_automount_config_s g_sdcard0config =
8989
.fstype = CONFIG_CXD56_SDCARD_AUTOMOUNT_FSTYPE,
9090
.blockdev = CONFIG_CXD56_SDCARD_AUTOMOUNT_BLKDEV,
9191
.mountpoint = CONFIG_CXD56_SDCARD_AUTOMOUNT_MOUNTPOINT,
92-
.ddelay = MSEC2TICK(CONFIG_CXD56_SDCARD_AUTOMOUNT_DDELAY),
93-
.udelay = MSEC2TICK(CONFIG_CXD56_SDCARD_AUTOMOUNT_UDELAY),
92+
.ddelay = MSEC2TICK_SLOW(CONFIG_CXD56_SDCARD_AUTOMOUNT_DDELAY),
93+
.udelay = MSEC2TICK_SLOW(CONFIG_CXD56_SDCARD_AUTOMOUNT_UDELAY),
9494
.attach = sdcard_attach,
9595
.enable = sdcard_enable,
9696
.inserted = sdcard_inserted

boards/arm/kinetis/freedom-k28f/src/k28_automount.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static const struct k28_automount_config_s g_sdhc_config =
8787
.fstype = CONFIG_FRDMK28F_SDHC_AUTOMOUNT_FSTYPE,
8888
.blockdev = CONFIG_FRDMK28F_SDHC_AUTOMOUNT_BLKDEV,
8989
.mountpoint = CONFIG_FRDMK28F_SDHC_AUTOMOUNT_MOUNTPOINT,
90-
.ddelay = MSEC2TICK(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_DDELAY),
91-
.udelay = MSEC2TICK(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_UDELAY),
90+
.ddelay = MSEC2TICKSLOW(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_DDELAY),
91+
.udelay = MSEC2TICKSLOW(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_UDELAY),
9292
.attach = k28_sdhc_attach,
9393
.enable = k28_sdhc_enable,
9494
.inserted = k28_sdhc_inserted

boards/arm/kinetis/freedom-k64f/src/k64_automount.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static const struct k64_automount_config_s g_sdhc_config =
8787
.fstype = CONFIG_FRDMK64F_SDHC_AUTOMOUNT_FSTYPE,
8888
.blockdev = CONFIG_FRDMK64F_SDHC_AUTOMOUNT_BLKDEV,
8989
.mountpoint = CONFIG_FRDMK64F_SDHC_AUTOMOUNT_MOUNTPOINT,
90-
.ddelay = MSEC2TICK(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_DDELAY),
91-
.udelay = MSEC2TICK(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_UDELAY),
90+
.ddelay = MSEC2TICKSLOW(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_DDELAY),
91+
.udelay = MSEC2TICKSLOW(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_UDELAY),
9292
.attach = k64_attach,
9393
.enable = k64_enable,
9494
.inserted = k64_inserted

boards/arm/kinetis/freedom-k66f/src/k66_automount.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static const struct k66_automount_config_s g_sdhc_config =
8787
.fstype = CONFIG_FRDMK66F_SDHC_AUTOMOUNT_FSTYPE,
8888
.blockdev = CONFIG_FRDMK66F_SDHC_AUTOMOUNT_BLKDEV,
8989
.mountpoint = CONFIG_FRDMK66F_SDHC_AUTOMOUNT_MOUNTPOINT,
90-
.ddelay = MSEC2TICK(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_DDELAY),
91-
.udelay = MSEC2TICK(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_UDELAY),
90+
.ddelay = MSEC2TICKSLOW(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_DDELAY),
91+
.udelay = MSEC2TICKSLOW(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_UDELAY),
9292
.attach = k66_attach,
9393
.enable = k66_enable,
9494
.inserted = k66_inserted

boards/arm/kinetis/twr-k64f120m/src/k64_automount.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ static const struct k64_automount_config_s g_sdhc_config =
8787
.fstype = CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_FSTYPE,
8888
.blockdev = CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_BLKDEV,
8989
.mountpoint = CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_MOUNTPOINT,
90-
.ddelay = MSEC2TICK(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_DDELAY),
91-
.udelay = MSEC2TICK(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_UDELAY),
90+
.ddelay = MSEC2TICKSLOW(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_DDELAY),
91+
.udelay = MSEC2TICKSLOW(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_UDELAY),
9292
.attach = k64_attach,
9393
.enable = k64_enable,
9494
.inserted = k64_inserted

boards/arm/sama5/sama5d4-ek/src/sam_automount.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ static const struct sam_automount_config_s g_hsmci0config =
8989
.fstype = CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_FSTYPE,
9090
.blockdev = CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_BLKDEV,
9191
.mountpoint = CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_MOUNTPOINT,
92-
.ddelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_DDELAY),
93-
.udelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_UDELAY),
92+
.ddelay = MSEC2TICKSLOW(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_DDELAY),
93+
.udelay = MSEC2TICKSLOW(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_UDELAY),
9494
.attach = sam_attach,
9595
.enable = sam_enable,
9696
.inserted = sam_inserted
@@ -109,8 +109,8 @@ static const struct sam_automount_config_s g_hsmci1config =
109109
.fstype = CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_FSTYPE,
110110
.blockdev = CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_BLKDEV,
111111
.mountpoint = CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_MOUNTPOINT,
112-
.ddelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_DDELAY),
113-
.udelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_UDELAY),
112+
.ddelay = MSEC2TICK_SLOW(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_DDELAY),
113+
.udelay = MSEC2TICK_SLOW(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_UDELAY),
114114
.attach = sam_attach,
115115
.enable = sam_enable,
116116
.inserted = sam_inserted

boards/arm/samd5e5/metro-m4/src/sam_automount.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ static const struct sam_automount_config_s g_port0config =
8989
.fstype = CONFIG_METRO_M4_USB_AUTOMOUNT_FSTYPE,
9090
.blockdev = CONFIG_METRO_M4_USB_AUTOMOUNT_BLKDEV,
9191
.mountpoint = CONFIG_METRO_M4_USB_AUTOMOUNT_MOUNTPOINT,
92-
.ddelay = MSEC2TICK(CONFIG_METRO_M4_USB_AUTOMOUNT_DDELAY),
93-
.udelay = MSEC2TICK(CONFIG_METRO_M4_USB_AUTOMOUNT_UDELAY),
92+
.ddelay = MSEC2TICKSLOW(CONFIG_METRO_M4_USB_AUTOMOUNT_DDELAY),
93+
.udelay = MSEC2TICKSLOW(CONFIG_METRO_M4_USB_AUTOMOUNT_UDELAY),
9494
.attach = sam_attach,
9595
.enable = sam_enable,
9696
.inserted = sam_inserted

boards/arm/samv7/common/src/sam_automount.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ static const struct sam_automount_config_s g_hsmci0config =
9292
.fstype = CONFIG_SAMV7_HSMCI0_AUTOMOUNT_FSTYPE,
9393
.blockdev = CONFIG_SAMV7_HSMCI0_AUTOMOUNT_BLKDEV,
9494
.mountpoint = CONFIG_SAMV7_HSMCI0_AUTOMOUNT_MOUNTPOINT,
95-
.ddelay = MSEC2TICK(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_DDELAY),
96-
.udelay = MSEC2TICK(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_UDELAY),
95+
.ddelay = MSEC2TICK_SLOW(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_DDELAY),
96+
.udelay = MSEC2TICK_SLOW(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_UDELAY),
9797
.attach = sam_attach,
9898
.enable = sam_enable,
9999
.inserted = sam_inserted

boards/arm/stm32/clicker2-stm32/src/stm32_automount.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ static const struct stm32_automount_config_s g_mb1_mmcsdconfig =
9393
.fstype = CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_FSTYPE,
9494
.blockdev = CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_BLKDEV,
9595
.mountpoint = CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_MOUNTPOINT,
96-
.ddelay = MSEC2TICK(
96+
.ddelay = MSEC2TICKSLOW(
9797
CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_DDELAY),
98-
.udelay = MSEC2TICK(
98+
.udelay = MSEC2TICKSLOW(
9999
CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_UDELAY),
100100
.attach = stm32_attach,
101101
.enable = stm32_enable,
@@ -115,9 +115,9 @@ static const struct stm32_automount_config_s g_mb2_mmcsdconfig =
115115
.fstype = CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_FSTYPE,
116116
.blockdev = CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_BLKDEV,
117117
.mountpoint = CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_MOUNTPOINT,
118-
.ddelay = MSEC2TICK(
118+
.ddelay = MSEC2TICKSLOW(
119119
CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_DDELAY),
120-
.udelay = MSEC2TICK(
120+
.udelay = MSEC2TICKSLOW(
121121
CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_UDELAY),
122122
.attach = stm32_attach,
123123
.enable = stm32_enable,

boards/risc-v/litex/arty_a7/src/litex_automount.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ static const struct litex_automount_config_s g_mb1_mmcsdconfig =
9393
.fstype = CONFIG_LITEX_SDIO_MOUNT_FSTYPE,
9494
.blockdev = CONFIG_LITEX_SDIO_MOUNT_BLKDEV,
9595
.mountpoint = CONFIG_LITEX_SDIO_MOUNT_MOUNTPOINT,
96-
.ddelay = MSEC2TICK(
97-
100),
98-
.udelay = MSEC2TICK(
99-
100),
96+
.ddelay = MSEC2TICKSLOW(100),
97+
.udelay = MSEC2TICKSLOW(100),
10098
.attach = litex_attach,
10199
.enable = litex_enable,
102100
.inserted = litex_inserted

include/nuttx/clock.h

+2
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@
185185

186186
#if (MSEC_PER_TICK * USEC_PER_MSEC) == USEC_PER_TICK
187187
# define MSEC2TICK(msec) div_const_roundup(msec, MSEC_PER_TICK)
188+
# define MSEC2TICKSLOW(msec) (((msec)+(MSEC_PER_TICK/2))/MSEC_PER_TICK)
188189
#else
189190
# define MSEC2TICK(msec) USEC2TICK((msec) * USEC_PER_MSEC)
191+
# define MSEC2TICKSLOW(msec) USEC2TICK((msec) * USEC_PER_MSEC)
190192
#endif
191193

192194
#define DSEC2TICK(dsec) MSEC2TICK((dsec) * MSEC_PER_DSEC)

0 commit comments

Comments
 (0)