ctr_mcu/trunk/task_debug.c
fujita_ryohei bc2d7dd805 Vol、SVR2にヒステリシスを付けた。
SVR2を一時的に64段階に(値が飛び飛びで0-0xFC)
BL_OFFコマンド時はウェイトを入れない(PWMが入る前にBL-ONしてシャットダウンの回避を修正)
互換性検証 100208リリース

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@95 013db118-44a6-b54f-8bf7-843cb86687b1
2010-02-08 05:12:32 +00:00

109 lines
3.0 KiB
C

#pragma SFR
#pragma NOP
#pragma HALT
#pragma STOP
#include "incs.h"
#include "renge.h"
#include "pm.h"
#include "accero.h"
/* ========================================================
======================================================== */
void tsk_debug( )
{
u8 temp;
static u8 count = 0;
static u8 task_interval;
if( system_status.pwr_state == ON_TRIG ){
#ifdef _MODEL_WM0_
PM_CHG_TIMEOUT_DISABLE(); // /WL_RST に配線されています
#endif
iic_mcu_write_a_byte( IIC_SLA_DCP, 0x08, 0x80 ); // ACR←0x80 揮発モードへ
/*
temp = iic_mcu_read_a_byte( IIC_SLA_8LEDS, IIC_8LEDS_REG_DO );
count += 1;
iic_mcu_write_a_byte( IIC_SLA_8LEDS, IIC_8LEDS_REG_DO, count );
iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 3, count );
*/
}
return;
}
u8 temp_debug_3;
void tsk_debug2( )
{
u8 str[4];
if( ( system_status.pwr_state == ON ) || ( system_status.pwr_state == SLEEP ) )
{
/*
str[3] = vreg_ctr[ VREG_C_FREE0 ];
str[2] = vreg_ctr[ VREG_C_FREE1 ];
str[1] = vreg_ctr[ VREG_C_STATUS ];
str[0] = vreg_ctr[ VREG_C_RTC_SEC ];
*/
str[3] = vreg_ctr[ VREG_C_DBG1 ];
str[2] = vreg_ctr[ VREG_C_DBG2 ];
str[1] = vreg_ctr[ VREG_C_IRQ2 ];
// str[1] = MIN;
str[0] = SEC;
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 2, vreg_ctr[ VREG_C_IRQ1 ] );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 1, boot_ura );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 1, vreg_ctr[ VREG_C_SND_VOL ] );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 1, vreg_ctr[ VREG_TUNE ] );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 0, vreg_ctr[ VREG_C_ACC_ZH ] );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 3, vreg_ctr[ VREG_C_TUNE ] );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 2, vreg_ctr[ VREG_C_SND_VOL ] );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 1, vreg_ctr[ VREG_C_STATUS ] );
// iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 0, vreg_ctr[ VREG_C_ACC_ZH ] );
iic_mcu_write( IIC_SLA_DBG_MONITOR, 0, 4, &str[0] );
}
return;
}
#if 0
/* ========================================================
タスクひな形
======================================================== */
task_interval tsk_hina( )
{
switch ( system_status.pwr_state )
{
case OFF:
case ON_TRIG:
case ON:
case SLEEP_TRIG:
case SLEEP:
case OFF_TRIG:
default:
}
return ( 次の起 ・ョまでのシ ・X ・e ・ tick ・・); // 毎 tic 呼ばれることになります
}
// ポインタで何かもらうのは危険な気がしてきた
/* このように使う
renge_task_immed_add( タスク関数へのポインタ );
*/
task_status_immed tsk_imm_hina( u8 * arg )
{
return ( ERR_FINISED );
// ERR_FINISED タスクを削除
// ERR_CONTINUE 次になんか割り込みなり、ユーザー操作なり、システムチックが
// 来たときに再度実行
}
#endif