From 2d16722c68a7e4d8263b83796c91d85e3bc08e6b Mon Sep 17 00:00:00 2001 From: n2232 Date: Tue, 15 Feb 2011 09:00:12 +0000 Subject: [PATCH] =?UTF-8?q?>=E6=AD=A9=E6=95=B0=E8=A8=88=E3=83=90=E3=82=B0?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20>=E3=83=BB=E5=86=85=E9=83=A8=E3=81=A7?= =?UTF-8?q?=E5=B9=B4=E3=81=AE=E6=AF=94=E8=BC=83=E3=82=92=E8=AA=A4=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=80=822021=E5=B9=B4=E3=81=AB?= =?UTF-8?q?=E3=83=90=E3=82=B0=E3=81=8C=E7=99=BA=E8=A6=9A=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=82=92=E5=9B=9E=E9=81=BF=E3=81=A7=E3=81=8D=E3=81=9F?= =?UTF-8?q?=20=E4=B8=8D=E5=AE=8C=E5=85=A8=E3=81=A7=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@313 013db118-44a6-b54f-8bf7-843cb86687b1 --- trunk/pedo_alg_thre_det2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trunk/pedo_alg_thre_det2.c b/trunk/pedo_alg_thre_det2.c index b5d731d..c071dd1 100644 --- a/trunk/pedo_alg_thre_det2.c +++ b/trunk/pedo_alg_thre_det2.c @@ -500,8 +500,10 @@ static unsigned long my_sqrt(unsigned long x) ======================================================== */ static u16 calc_hours_spend( u8 year ) { - // 同じ年の内 - if( bcdtob( cal_log_latest.year_bcd ) == year ) + u8 temp_arg_year_bcd = bcdtob( year ); + + // 同じ年の内 + if( cal_log_latest.year_bcd == temp_arg_year_bcd ) { if( now_longhour > last_hour_fny ) { @@ -512,12 +514,12 @@ static u16 calc_hours_spend( u8 year ) return( 0 ); // 同じ時間帯(と、巻き戻り。 どうなっても知らない) } } - else if( cal_log_latest.year_bcd == ( year -1 ) ) + else if( cal_log_latest.year_bcd == ( temp_arg_year_bcd -1 ) ) { // 年をまたいでいるとき return( ( ( 365 + ( is_firstyear(year) ? 1: 0 )) * 24 ) - last_hour_fny + now_longhour ); } - else if( cal_log_latest.year_bcd < year ) + else if( cal_log_latest.year_bcd < temp_arg_year_bcd ) { // 数年放置 return( PEDOMETER_LOG_SIZE +1 );