Skip to content

Commit

Permalink
boards: fix compile failed
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
GUIDINGLI committed Nov 5, 2024
1 parent e17a99c commit 8c4cf50
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions boards/arm/cxd56xx/spresense/src/cxd56_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ static const struct cxd56_automount_config_s g_sdcard0config =
.fstype = CONFIG_CXD56_SDCARD_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_CXD56_SDCARD_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_CXD56_SDCARD_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_CXD56_SDCARD_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_CXD56_SDCARD_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICK_SLOW(CONFIG_CXD56_SDCARD_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK_SLOW(CONFIG_CXD56_SDCARD_AUTOMOUNT_UDELAY),
.attach = sdcard_attach,
.enable = sdcard_enable,
.inserted = sdcard_inserted
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/kinetis/freedom-k28f/src/k28_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ static const struct k28_automount_config_s g_sdhc_config =
.fstype = CONFIG_FRDMK28F_SDHC_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_FRDMK28F_SDHC_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_FRDMK28F_SDHC_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICKSLOW(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICKSLOW(CONFIG_FRDMK28F_SDHC_AUTOMOUNT_UDELAY),
.attach = k28_sdhc_attach,
.enable = k28_sdhc_enable,
.inserted = k28_sdhc_inserted
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/kinetis/freedom-k64f/src/k64_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ static const struct k64_automount_config_s g_sdhc_config =
.fstype = CONFIG_FRDMK64F_SDHC_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_FRDMK64F_SDHC_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_FRDMK64F_SDHC_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICKSLOW(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICKSLOW(CONFIG_FRDMK64F_SDHC_AUTOMOUNT_UDELAY),
.attach = k64_attach,
.enable = k64_enable,
.inserted = k64_inserted
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/kinetis/freedom-k66f/src/k66_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ static const struct k66_automount_config_s g_sdhc_config =
.fstype = CONFIG_FRDMK66F_SDHC_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_FRDMK66F_SDHC_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_FRDMK66F_SDHC_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICKSLOW(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICKSLOW(CONFIG_FRDMK66F_SDHC_AUTOMOUNT_UDELAY),
.attach = k66_attach,
.enable = k66_enable,
.inserted = k66_inserted
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/kinetis/twr-k64f120m/src/k64_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ static const struct k64_automount_config_s g_sdhc_config =
.fstype = CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICKSLOW(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICKSLOW(CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT_UDELAY),
.attach = k64_attach,
.enable = k64_enable,
.inserted = k64_inserted
Expand Down
8 changes: 4 additions & 4 deletions boards/arm/sama5/sama5d4-ek/src/sam_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ static const struct sam_automount_config_s g_hsmci0config =
.fstype = CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICKSLOW(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICKSLOW(CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_UDELAY),
.attach = sam_attach,
.enable = sam_enable,
.inserted = sam_inserted
Expand All @@ -109,8 +109,8 @@ static const struct sam_automount_config_s g_hsmci1config =
.fstype = CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICK_SLOW(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK_SLOW(CONFIG_SAMA5D4EK_HSMCI1_AUTOMOUNT_UDELAY),
.attach = sam_attach,
.enable = sam_enable,
.inserted = sam_inserted
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/samd5e5/metro-m4/src/sam_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ static const struct sam_automount_config_s g_port0config =
.fstype = CONFIG_METRO_M4_USB_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_METRO_M4_USB_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_METRO_M4_USB_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_METRO_M4_USB_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_METRO_M4_USB_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICKSLOW(CONFIG_METRO_M4_USB_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICKSLOW(CONFIG_METRO_M4_USB_AUTOMOUNT_UDELAY),
.attach = sam_attach,
.enable = sam_enable,
.inserted = sam_inserted
Expand Down
4 changes: 2 additions & 2 deletions boards/arm/samv7/common/src/sam_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ static const struct sam_automount_config_s g_hsmci0config =
.fstype = CONFIG_SAMV7_HSMCI0_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_SAMV7_HSMCI0_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_SAMV7_HSMCI0_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_UDELAY),
.ddelay = MSEC2TICK_SLOW(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK_SLOW(CONFIG_SAMV7_HSMCI0_AUTOMOUNT_UDELAY),
.attach = sam_attach,
.enable = sam_enable,
.inserted = sam_inserted
Expand Down
8 changes: 4 additions & 4 deletions boards/arm/stm32/clicker2-stm32/src/stm32_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ static const struct stm32_automount_config_s g_mb1_mmcsdconfig =
.fstype = CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(
.ddelay = MSEC2TICKSLOW(
CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(
.udelay = MSEC2TICKSLOW(
CONFIG_CLICKER2_STM32_MB1_MMCSD_AUTOMOUNT_UDELAY),
.attach = stm32_attach,
.enable = stm32_enable,
Expand All @@ -115,9 +115,9 @@ static const struct stm32_automount_config_s g_mb2_mmcsdconfig =
.fstype = CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_FSTYPE,
.blockdev = CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_BLKDEV,
.mountpoint = CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(
.ddelay = MSEC2TICKSLOW(
CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_DDELAY),
.udelay = MSEC2TICK(
.udelay = MSEC2TICKSLOW(
CONFIG_CLICKER2_STM32_MB2_MMCSD_AUTOMOUNT_UDELAY),
.attach = stm32_attach,
.enable = stm32_enable,
Expand Down
6 changes: 2 additions & 4 deletions boards/risc-v/litex/arty_a7/src/litex_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ static const struct litex_automount_config_s g_mb1_mmcsdconfig =
.fstype = CONFIG_LITEX_SDIO_MOUNT_FSTYPE,
.blockdev = CONFIG_LITEX_SDIO_MOUNT_BLKDEV,
.mountpoint = CONFIG_LITEX_SDIO_MOUNT_MOUNTPOINT,
.ddelay = MSEC2TICK(
100),
.udelay = MSEC2TICK(
100),
.ddelay = MSEC2TICKSLOW(100),
.udelay = MSEC2TICKSLOW(100),
.attach = litex_attach,
.enable = litex_enable,
.inserted = litex_inserted
Expand Down
2 changes: 2 additions & 0 deletions include/nuttx/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@

#if (MSEC_PER_TICK * USEC_PER_MSEC) == USEC_PER_TICK
# define MSEC2TICK(msec) div_const_roundup(msec, MSEC_PER_TICK)
# define MSEC2TICKSLOW(msec) (((msec)+(MSEC_PER_TICK/2))/MSEC_PER_TICK)
#else
# define MSEC2TICK(msec) USEC2TICK((msec) * USEC_PER_MSEC)
# define MSEC2TICKSLOW(msec) USEC2TICK((msec) * USEC_PER_MSEC)
#endif

#define DSEC2TICK(dsec) MSEC2TICK((dsec) * MSEC_PER_DSEC)
Expand Down

0 comments on commit 8c4cf50

Please sign in to comment.