Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bsp/w60x/drivers/drv_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static int wm_set_timestamp(time_t timestamp)
gmtime_r(&timestamp, &tblock);

ctrl2 = tls_reg_read32(HR_PMU_RTC_CTRL2); /* disable */
ctrl2 &= ~(1 << 16);
ctrl2 &= ~(BIT(16));
tls_reg_write32(HR_PMU_RTC_CTRL2, ctrl2);

ctrl1 |= tblock.tm_sec;
Expand All @@ -70,7 +70,7 @@ static int wm_set_timestamp(time_t timestamp)
tls_reg_write32(HR_PMU_RTC_CTRL2, ctrl2);

ctrl2 = tls_reg_read32(HR_PMU_RTC_CTRL2);/* enable */
ctrl2 |= (1 << 16);
ctrl2 |= BIT(16);
tls_reg_write32(HR_PMU_RTC_CTRL2, ctrl2);

return RT_EOK;
Expand Down
2 changes: 1 addition & 1 deletion libcpu/arm/s3c24x0/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void rt_hw_rtc_get(struct tm *ti)
rt_uint8_t sec, min, hour, mday, wday, mon, year;

/* enable access to RTC registers */
RTCCON |= RTC_ENABLE;
RTC_ENABLE;
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug/错误: The line RTC_ENABLE; appears to be a standalone macro call that likely has no effect. Based on the original code RTCCON |= RTC_ENABLE;, this should probably be RTCCON |= RTC_ENABLE; to actually enable RTC access by setting the enable bit in the control register. / 单独的宏调用 RTC_ENABLE; 可能没有任何效果。根据原始代码 RTCCON |= RTC_ENABLE;,这应该是 RTCCON |= RTC_ENABLE; 来通过设置控制寄存器中的使能位来实际启用RTC访问。

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, the AI is not smart enough, because

#define RTC_ENABLE      RTCCON |=  0x01;    /*RTC read and write enable */

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个和之前的逻辑有区别吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有区别,这个代码有问题,正确用法也有参考


/* read RTC registers */
do
Expand Down