mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-10-31 13:51:10 -04:00
・歩数の読み出しがおかしかったのを修正
・POWERスイッチ、ちょん押しでちょん押し割り込み、 長押し時、ちょん押し割り込みの後、長押し割り込みの2回が入るように ・RTCの日付が変更できなかったのを修正 ・電源ボタン長押し→強制オフで実際にオフに移行するまでの時間が0だったのを修正 こんなミス、コンパイラが指摘してくれればいいのに。 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@176 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
parent
21b34e899d
commit
477cbf231d
@ -47,11 +47,9 @@ void pedometer()
|
|||||||
static u8 interval_hh; // 山-山間の時間。短過ぎたらはじく。
|
static u8 interval_hh; // 山-山間の時間。短過ぎたらはじく。
|
||||||
static u8 time_l; // 前回の極小からの経過時間
|
static u8 time_l; // 前回の極小からの経過時間
|
||||||
static u16 peak_l; // 谷の深さ
|
static u16 peak_l; // 谷の深さ
|
||||||
static u16 peak_h; // ŽR‚Ì<E2809A>‚‚³
|
|
||||||
static u16 norm_hist[TAP];
|
static u16 norm_hist[TAP];
|
||||||
|
|
||||||
static u8 hist_indx;
|
static u8 hist_indx;
|
||||||
static u8 t_rise;
|
|
||||||
|
|
||||||
signed long filterd;
|
signed long filterd;
|
||||||
|
|
||||||
@ -302,7 +300,7 @@ void fill_hosu_hist_hours( u16 hours )
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
p_record += 1;
|
p_record += 1;
|
||||||
if( PEDOMETER_LOG_SIZE >= p_record )
|
if( p_record >= PEDOMETER_LOG_SIZE )
|
||||||
{
|
{
|
||||||
p_record = 0;
|
p_record = 0;
|
||||||
}
|
}
|
||||||
@ -385,21 +383,21 @@ u8 hosu_read( )
|
|||||||
default:
|
default:
|
||||||
temp = pool.vreg_c_ext.pedo_log[ p_record_buffer ];
|
temp = pool.vreg_c_ext.pedo_log[ p_record_buffer ];
|
||||||
if( record_read_msb_lsb == 0 )
|
if( record_read_msb_lsb == 0 )
|
||||||
{
|
{
|
||||||
dat = (u8)( temp & 0x00FF );
|
dat = (u8)( temp & 0x00FF );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
dat = (u8)(( temp >> 8 ) & 0x00FF );
|
||||||
|
if( p_record_buffer == 0 )
|
||||||
{
|
{
|
||||||
dat = (u8)(( temp >> 8 ) & 0x00FF );
|
p_record_buffer = PEDOMETER_LOG_SIZE-1;
|
||||||
if( p_record_buffer == 0 )
|
|
||||||
{
|
|
||||||
p_record_buffer = PEDOMETER_LOG_SIZE-1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p_record_buffer -= 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_record_buffer -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
record_read_msb_lsb += 1;
|
record_read_msb_lsb += 1;
|
||||||
return( dat );
|
return( dat );
|
||||||
}
|
}
|
||||||
|
|||||||
10
trunk/sw.c
10
trunk/sw.c
@ -107,13 +107,12 @@ void tsk_sw( )
|
|||||||
case ( BT_CHARGE ):
|
case ( BT_CHARGE ):
|
||||||
case ( OFF ):
|
case ( OFF ):
|
||||||
// 電源スイッチの監視 //
|
// 電源スイッチの監視 //
|
||||||
if( ( SW_POW_n ) &&
|
if( SW_pow_count == CLICK_THRESHOLD )
|
||||||
( SW_pow_count >= CLICK_THRESHOLD ) )
|
|
||||||
{
|
{
|
||||||
#ifdef _SW_HOME_ENABLE_
|
#ifdef _SW_HOME_ENABLE_
|
||||||
set_irq( VREG_C_IRQ0, REG_BIT_SW_POW_CLICK );
|
set_irq( VREG_C_IRQ0, REG_BIT_SW_POW_CLICK );
|
||||||
#else
|
#else
|
||||||
set_irq( VREG_C_IRQ0, REG_BIT_SW_HOME_CLICK );
|
set_irq( VREG_C_IRQ0, REG_BIT_SW_HOME_CLICK );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if( SW_pow_count == HOLD_THREASHOLD )
|
else if( SW_pow_count == HOLD_THREASHOLD )
|
||||||
@ -128,7 +127,8 @@ void tsk_sw( )
|
|||||||
|
|
||||||
if( cnt_force_off != 0 )
|
if( cnt_force_off != 0 )
|
||||||
{
|
{
|
||||||
if( ++cnt_force_off >= vreg_ctr[ VREG_C_OFF_DELAY ] * 6 );
|
cnt_force_off += 1;
|
||||||
|
if( cnt_force_off >= ( vreg_ctr[ VREG_C_OFF_DELAY ] * 8 ) )
|
||||||
{
|
{
|
||||||
// タイムアウトによる強制OFF
|
// タイムアウトによる強制OFF
|
||||||
cnt_force_off = 0;
|
cnt_force_off = 0;
|
||||||
|
|||||||
@ -213,6 +213,7 @@ void vreg_ctr_write( u8 adrs, u8 data )
|
|||||||
set_rtc( adrs - VREG_C_RTC_SEC, data & 0x7F );
|
set_rtc( adrs - VREG_C_RTC_SEC, data & 0x7F );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ( VREG_C_RTC_DAY ):
|
||||||
case ( VREG_C_RTC_HOUR ):
|
case ( VREG_C_RTC_HOUR ):
|
||||||
set_rtc( adrs - VREG_C_RTC_SEC, data & 0x3F );
|
set_rtc( adrs - VREG_C_RTC_SEC, data & 0x3F );
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -6,12 +6,12 @@ magic.c(10) : CC78K0R warning W0871: Data aligned after 'MGC_LOAD'in 'MGC_LOAD s
|
|||||||
Compilation complete, 0 error(s) and 3 warning(s) found.
|
Compilation complete, 0 error(s) and 3 warning(s) found.
|
||||||
"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\ra78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff inter_asm\magic.asm
|
"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\ra78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff inter_asm\magic.asm
|
||||||
Assembly complete, 0 error(s) and 0 warning(s) found.
|
Assembly complete, 0 error(s) and 0 warning(s) found.
|
||||||
"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\bin\cc78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -irenge -i"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r" -ms -qvjl2wt -sainter_asm -zpb -w2 -no task_sys.c
|
"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\bin\cc78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -irenge -i"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r" -ms -qvjl2wt -sainter_asm -zpb -w2 -no sw.c
|
||||||
task_sys.c(177) : CC78K0R warning W0401: Conversion may lose significant digits
|
sw.c(100) : CC78K0R warning W0760: Double and long double are treated as IEEE 754 single format
|
||||||
task_sys.c(425) : CC78K0R warning W0401: Conversion may lose significant digits
|
sw.c(164) : CC78K0R warning W0851: Data aligned in '@@DATA section'
|
||||||
task_sys.c(473) : CC78K0R warning W0851: Data aligned in '@@INIT section'
|
sw.c(164) : CC78K0R warning W0851: Data aligned in '@@INIT section'
|
||||||
Compilation complete, 0 error(s) and 3 warning(s) found.
|
Compilation complete, 0 error(s) and 3 warning(s) found.
|
||||||
"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\ra78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff inter_asm\task_sys.asm
|
"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\ra78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff inter_asm\sw.asm
|
||||||
Assembly complete, 0 error(s) and 0 warning(s) found.
|
Assembly complete, 0 error(s) and 0 warning(s) found.
|
||||||
"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\lk78k0r.exe" -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -obsr.lmf "..\..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r\s0rm.rel" -go85h,0FC00h,1024 -gi0FFFFFFFFFFFFFFFFFFFFh -pbsr_k0r.map -nkd -gb7EFBFFh -b"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\lib78k0r\fsl.lib" -bcl0rdm.lib -bcl0rm.lib -bcl0rmf.lib -i"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r" -dbsr_mcu.dr -s -w0 loader.rel pm.rel i2c_ctr.rel main.rel magic.rel WDT.rel i2c_mcu.rel i2c_twl.rel led.rel rtc.rel vreg_ctr.rel vreg_twl.rel adc.rel renge.rel accero.rel self_flash.rel sw.rel task_debug.rel task_misc.rel task_sys.rel pedo_alg_thre_det2.rel ini_VECT.rel task_status.rel
|
"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\lk78k0r.exe" -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -obsr.lmf "..\..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r\s0rm.rel" -go85h,0FC00h,1024 -gi0FFFFFFFFFFFFFFFFFFFFh -pbsr_k0r.map -nkd -gb7EFBFFh -b"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\lib78k0r\fsl.lib" -bcl0rdm.lib -bcl0rm.lib -bcl0rmf.lib -i"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r" -dbsr_mcu.dr -s -w0 loader.rel pm.rel i2c_ctr.rel main.rel magic.rel WDT.rel i2c_mcu.rel i2c_twl.rel led.rel rtc.rel vreg_ctr.rel vreg_twl.rel adc.rel renge.rel accero.rel self_flash.rel sw.rel task_debug.rel task_misc.rel task_sys.rel pedo_alg_thre_det2.rel ini_VECT.rel task_status.rel
|
||||||
Link complete, 0 error(s) and 0 warning(s) found.
|
Link complete, 0 error(s) and 0 warning(s) found.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user