ctr_mcu/trunk/task_debug.c
n2232 4a96cf6746 vol書き込みポーリングを行うように変更
ROM不足に対応するため、メモリマップをちょっと変更。 従来品とのアップデート/ダウンデートもとりあえず大丈夫(自ファームのチェック部分)
RAMも心配になってきたのでboolとして使ってるu8をbit型に、気がついたところから
型違いのwarningを減らすためにキャストをちゃんとする。気がついたところから
tsk_debugを外した…がサイズ変わらず
if~else~else~でつないでいたところをテーブル&ループに変更 項目数が増えると(>4)78k0/rはこっちの方が早くて小さいのか
TWLがVolを書くのと、スライダの操作がバッティングすると不整合が起こる事があり、それを防ぐ




git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@241 013db118-44a6-b54f-8bf7-843cb86687b1
2010-10-13 01:41:23 +00:00

124 lines
3.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma SFR
#pragma NOP
#pragma HALT
#pragma STOP
#include "incs_loader.h"
//#include "incs.h"
#include "renge\renge.h"
#include "pm.h"
#include "accero.h"
/* ========================================================
======================================================== */
// 7セグ 4バイト版
# define IIC_SLA_DBG_MONITOR 0x44
#if 0
注意! タスクリストからも外してますので、使うなら復活させて下さい!
void tsk_debug( )
{
// u8 temp;
#ifdef _DBG_PEDO_AUTO_ENABLE_
if( system_status.pwr_state == ON_TRIG ){
// 歩数計を起動時にonにする
vreg_ctr[ VREG_C_ACC_CONFIG ] = 0x03;
renge_task_immed_add( tski_acc_hosu_set );
}
#endif
/*
if( system_status.pwr_state == ON_TRIG ){
{
static u8 count = 0;
// デバッグLED8bitの初期化
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 );
}
}
*/
#ifdef _PMIC_TEST_
if( ( system_status.pwr_state == ON ) || ( system_status.pwr_state == SLEEP ) )
{
iic_mcu_write_a_byte( IIC_SLA_DBG_MONITOR, 0x03, 0 );
}
#endif
// 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 ] );
/*
{
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_SND_VOL ];
str[2] = vreg_ctr[ VREG_C_TUNE ];
str[1] = vreg_ctr[ VREG_C_ACC_CONFIG ];
str[0] = SEC;
iic_mcu_write( IIC_SLA_DBG_MONITOR, 0x03, 4, &str );
}
}
*/
}
#endif
#if 0
/* ========================================================
タスクひな形
======================================================== */
task_interval tsk_hina( )
{
switch ( system_status.pwr_state )
{
case OFF:
case ON_TRIG:
case ON:
case SLEEP:
case OFF_TRIG:
default:
}
return ( 次の起 ・ョまでのシ ・X ・e ・ tick ・・); // 毎 tic 呼ばれることになります
}
// ポインタで何かもらうのは危険な気がしてきた
/* このように使う
renge_task_immed_add( タスク関数へのポインタ );
*/
task_status_immed tski_hina( u8 * arg )
{
return ( ERR_FINISED );
// ERR_FINISED タスクを削除
// ERR_CONTINUE 次になんか割り込みなり、ユーザー操作なり、システムチックが
// 来たときに再度実行
}
#endif