swの時間カウントが誤っていたのを修正

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@250 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
n2232 2010-10-20 07:51:12 +00:00
parent dbfa16838c
commit 8b43c444af
4 changed files with 759 additions and 754 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -44,7 +44,7 @@ bit SW_HOME_n;
counter = 0; \
}else{ \
counter += 1; \
if( counter == 0 ) counter = 255; \
if( counter == 0 ) counter = -1; \
} \
} \
}
@ -98,15 +98,15 @@ void tsk_sw( )
case ( BT_CHARGE ):
case ( OFF ):
// “dŒ¹ƒXƒCƒbƒ`‚ÌŠÄŽ‹ //
if( SW_pow_count == (u8)(160/(INTERVAL_TSK_SW / SYS_INTERVAL_TICK)) )
if( SW_pow_count == (u8)( 320/ INTERVAL_TSK_SW ) )
{
set_irq( VREG_C_IRQ0, REG_BIT_SW_POW_CLICK );
}
else if( SW_pow_count == (u8)( HOLD_THREASHOLD * 1.5 ) )
else if( SW_pow_count == ( HOLD_THREASHOLD ) )
{
set_irq( VREG_C_IRQ0, REG_BIT_SW_POW_HOLD );
}
else if( SW_pow_count > ( (u16)HOLD_THREASHOLD + vreg_ctr[ VREG_C_OFF_DELAY ] *9 ))
else if( SW_pow_count > ( HOLD_THREASHOLD + vreg_ctr[ VREG_C_OFF_DELAY ] *16 )) // ‚¨‚æ‚» 100/SYSTEM_TICK
{
system_status.force_off = 1;
}

View File

@ -9,7 +9,7 @@ extern bit SW_pow_mask;
#define INTERVAL_TSK_SW 8
#define CLICK_THRESHOLD 2
#define HOLD_THREASHOLD (u8)( 2000 /INTERVAL_TSK_SW /SYS_INTERVAL_TICK )
#define FORCEOFF_THREASHOLD 50
#define HOLD_THREASHOLD (u8)( 2000 /INTERVAL_TSK_SW )
#define FORCEOFF_THREASHOLD 32
#endif