mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-10-31 13:51:10 -04:00
内部で年の比較を誤っていた。(再)
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:
parent
76a167bc8e
commit
80dd01c515
BIN
trunk/hoge.bin
BIN
trunk/hoge.bin
Binary file not shown.
@ -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 );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user