Skip to content

Commit e272d04

Browse files
committed
[nuvoton] Sync to 4.1.0.
1. Remove dfs_posix.h including for syncing 4.1.0. 2. Fix issue in crypto driver. 3. Add LVGLv81 supporting in NuMaker-M2354 BSP. 4. Update USB board menu in M480 BSP.
1 parent c95c296 commit e272d04

File tree

37 files changed

+757
-407
lines changed

37 files changed

+757
-407
lines changed

bsp/nuvoton/libraries/m2354/rtt_port/drv_crc.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ static rt_uint32_t nu_crc_run(
4444
{
4545
uint32_t u32CalChecksum = 0;
4646
uint32_t i = 0;
47+
rt_err_t result;
4748

48-
rt_mutex_take(&s_CRC_mutex, RT_WAITING_FOREVER);
49+
result = rt_mutex_take(&s_CRC_mutex, RT_WAITING_FOREVER);
50+
RT_ASSERT(result == RT_EOK);
4951

5052
/* Configure CRC controller */
5153
CRC_Open(u32OpMode, u32Attr, u32Seed, CRC_CPU_WDATA_8);
@@ -85,17 +87,17 @@ static rt_uint32_t nu_crc_run(
8587

8688
/* Get checksum value */
8789
u32CalChecksum = CRC_GetChecksum();
88-
rt_mutex_release(&s_CRC_mutex);
90+
91+
result = rt_mutex_release(&s_CRC_mutex);
92+
RT_ASSERT(result == RT_EOK);
8993

9094
return u32CalChecksum;
9195
}
9296

9397
rt_err_t nu_crc_init(void)
9498
{
9599
SYS_ResetModule(CRC_RST);
96-
97-
rt_mutex_init(&s_CRC_mutex, NU_CRYPTO_CRC_NAME, RT_IPC_FLAG_PRIO);
98-
return RT_EOK;
100+
return rt_mutex_init(&s_CRC_mutex, NU_CRYPTO_CRC_NAME, RT_IPC_FLAG_PRIO);
99101
}
100102

101103
rt_uint32_t nu_crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, rt_size_t length)

0 commit comments

Comments
 (0)