Skip to content

Commit 3687201

Browse files
committed
fixes cppcheck:
[cpp_check.py 80 INFO] bsp/w60x/drivers/drv_rtc.c:58:11: error: Syntax Error: AST broken, binary operator '&=' doesn't have two operands. [internalAstError] [cpp_check.py 80 INFO] libcpu/arm/s3c24x0/rtc.c:34:12: error: Expression 'RTCCON|=RTCCON|=0x01' depends on order of evaluation of side effects [unknownEvaluationOrder]
1 parent 1adefcf commit 3687201

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bsp/w60x/drivers/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int wm_set_timestamp(time_t timestamp)
5555
gmtime_r(&timestamp, &tblock);
5656

5757
ctrl2 = tls_reg_read32(HR_PMU_RTC_CTRL2); /* disable */
58-
ctrl2 &= ~(1 << 16);
58+
ctrl2 &= (int)(~(1 << 16));
5959
tls_reg_write32(HR_PMU_RTC_CTRL2, ctrl2);
6060

6161
ctrl1 |= tblock.tm_sec;

libcpu/arm/s3c24x0/rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void rt_hw_rtc_get(struct tm *ti)
3131
rt_uint8_t sec, min, hour, mday, wday, mon, year;
3232

3333
/* enable access to RTC registers */
34-
RTCCON |= RTC_ENABLE;
34+
RTC_ENABLE;
3535

3636
/* read RTC registers */
3737
do

0 commit comments

Comments
 (0)