diff --git a/trunk/hoge.bin b/trunk/hoge.bin index c2f684e..efa2ea8 100644 Binary files a/trunk/hoge.bin and b/trunk/hoge.bin differ diff --git a/trunk/pedo_alg_thre_det2.c b/trunk/pedo_alg_thre_det2.c index c472b25..a3be680 100644 --- a/trunk/pedo_alg_thre_det2.c +++ b/trunk/pedo_alg_thre_det2.c @@ -500,10 +500,10 @@ static unsigned long my_sqrt(unsigned long x) ======================================================== */ static u16 calc_hours_spend( u8 year ) { - u8 temp_arg_year_bcd = btobcd( year ); + u8 cal_log_latest_year = bcdtob( cal_log_latest.year_bcd ); // 同じ年の内 - if( cal_log_latest.year_bcd == temp_arg_year_bcd ) + if( cal_log_latest_year == year ) { if( now_longhour > last_hour_fny ) { @@ -514,12 +514,12 @@ static u16 calc_hours_spend( u8 year ) return( 0 ); // 同じ時間帯(と、巻き戻り。 どうなっても知らない) } } - else if( cal_log_latest.year_bcd == ( temp_arg_year_bcd -1 ) ) + else if( cal_log_latest_year == ( year -1 ) ) { // 年をまたいでいるとき return( ( ( 365 + ( is_firstyear(year) ? 1: 0 )) * 24 ) - last_hour_fny + now_longhour ); } - else if( cal_log_latest.year_bcd < temp_arg_year_bcd ) + else if( cal_log_latest_year < year ) { // 数年放置 return( PEDOMETER_LOG_SIZE +1 );