ctr_mcu/trunk/task_debug.c
fujita_ryohei 41c448cf1c TWLのI2C通信に間に合わないことがあるのでクロックを倍速に。
データシートでは使うなと書いてあったが、メーカーに問い合わせたら99.9999%大丈夫、との事。・・・。
I2C_mの修正
 初期化時にダミーで9クロック送った後にエラーフラグの初期化を忘れていた
 →初期化後最初の通信(電池残量IC)と通信できずにいた。
タスクシステムの逐次起動を修正
 改良になってるのか?
セレクト押しながら起動でバックライトの強制点灯復活
 ダイレクトブート時に困るので... 運が悪いとシャットダウンすることもあり得る
TWLに割り込みを入れるのを間違えていた 


git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@31 013db118-44a6-b54f-8bf7-843cb86687b1
2009-11-26 00:31:25 +00:00

117 lines
3.1 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.h"
#include "renge.h"
#include "pm.h"
#include "accero.h"
extern u8 command_bl_set;
/* ========================================================
======================================================== */
void tsk_debug( )
{
u8 temp;
static u8 count = 0;
static u8 task_interval;
if( system_status.pwr_state == ON_TRIG ){
iic_mcu_write_a_byte( IIC_SLA_DCP, 0x08, 0x80 ); // ACR<43>©0x80 Šö”­<E2809D><EFBFBD>[<5B>hÖ
if( !SW_SEL_n ){
}
PM_LCD_on();
PM_BL_set( REG_BIT_CMD_BL_U_ON | REG_BIT_CMD_BL_L_ON );
// vreg_ctr[ VREG_C_ACC_CONFIG ] = 0x03;
// renge_task_immed_add( acc_hosu_set );
}
/*
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_ACC_HOSU_L ];
str[2] = SEC;
str[1] = vreg_ctr[ VREG_C_BT_TEMP ];
str[0] = vreg_ctr[ VREG_C_BT_REMAIN ];
// 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
/* ========================================================
<20>^<5E>X<EFBFBD>NĐČŚ`
======================================================== */
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 ( ŽźĚN <20>ÜĹĚ<E2809A>V <20>EX <20>Ee <20>E tick <20>E<EFBFBD>E); // <> tic ŚÄ‚΂ę‚邱‚ƂɂȂč‚Ü‚·
}
// <20>|<7C>C<EFBFBD><EFBFBD>^ʼn˝©ŕç¤Ě͊댯ČC޵ī˝
/* ±Ěć¤ÉŽg¤
renge_task_immed_add( <20>^<5E>X<EFBFBD>NŠÖ<C5A0>ÖĚ<E2809A>|<7C>C<EFBFBD><EFBFBD>^ );
*/
task_status_immed tsk_imm_hina( u8 * arg )
{
return ( ERR_FINISED );
// ERR_FINISED <20>^<5E>X<EFBFBD>NđŤíŹś
// ERR_CONTINUE ŽźÉČń©Š„荞ÝČč<E2809A>A<EFBFBD><EFBFBD>[<5B>U<EFBFBD>[€ŤěČč<E2809A>A<EFBFBD>V<EFBFBD>X<EFBFBD>e<EFBFBD><EFBFBD>`<60>b<EFBFBD>NŞ
// —<>˝Ć«ÉŤÄ“xŽŔŤs
}
#endif