内部で年の比較を誤っていた。(再)

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@316 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
n2232 2011-02-15 09:22:06 +00:00
parent 76a167bc8e
commit 80dd01c515
2 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -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 );