From 06aa5b547e6d7e7079bb7d84079b0bc6f18ece4a Mon Sep 17 00:00:00 2001 From: yunjian Date: Tue, 29 May 2018 14:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3get=5Fweek=E7=9A=84=E6=9C=89?= =?UTF-8?q?=E6=95=88=E5=80=BC=E4=B8=8EIS=5FRTC=5FWEEKDAY=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=9C=89=E6=95=88=E5=80=BC=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82=20get=5Fweek=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E5=80=BC=E6=98=AF0-6.=E8=80=8Cstm32f4xx=5Frtc.h?= =?UTF-8?q?=E4=B8=ADIS=5FRTC=5FWEEKDAY=E4=B8=AD=E5=88=A4=E6=96=AD=E7=9A=84?= =?UTF-8?q?=E6=9C=89=E6=95=88=E5=80=BC=E6=98=AF1-7.=E5=BD=93=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=97=A5=E6=9C=9F=E6=98=AF=E5=91=A8=E6=97=A5=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E6=9C=89=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/stm32f40x/drivers/stm32f4_rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/stm32f40x/drivers/stm32f4_rtc.c b/bsp/stm32f40x/drivers/stm32f4_rtc.c index f44949d59f..246622ccc8 100644 --- a/bsp/stm32f40x/drivers/stm32f4_rtc.c +++ b/bsp/stm32f40x/drivers/stm32f4_rtc.c @@ -23,7 +23,7 @@ static int get_week(int year, int month, int day) year -=1; month +=12; } - return (day+1+2*month+3*(month+1)/5+year+(year/4)-year/100+year/400)%7; + return (day+1+2*month+3*(month+1)/5+year+(year/4)-year/100+year/400)%7+1; } static struct rt_device rtc;