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;