□1.34 プラスアルファ

電池残量が30%未満の時に充電しながらoffすると充電LEDが消えない不具合修正
隠語を普通語に
コメント追加
しばらくほっといて電源を入れようとすると一発目電源が入らない件。まだ完全修正じゃないが
電源on時、シーケンスを誤っていた。(task_sys.c)


git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@332 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
n2232 2011-05-25 02:12:23 +00:00
parent e7456340e9
commit 0d13eb6bc2
17 changed files with 82 additions and 76 deletions

View File

@ -40,7 +40,7 @@ typedef struct filter_work
filter_work work_vr_3d = {
&vreg_ctr[ VREG_C_TUNE ]
&vreg_ctr[ VREG_C_3D ]
};
@ -85,7 +85,7 @@ static u8 adc_scaling( u8 );
======================================================== */
void tsk_adc( )
{
static u8 old_tune;
static u8 old_3D;
static u8 sndvol_codec;
static u8 bt_temp_old;
@ -94,7 +94,7 @@ void tsk_adc( )
adc_updated = false;
// 3D /////////////////////////////////////////
vreg_ctr[ VREG_C_TUNE ] = adc_raw_dep; // <20>l
vreg_ctr[ VREG_C_3D ] = adc_raw_dep; // <20>l
// Volume /////////////////////////////////////
{
@ -129,7 +129,7 @@ void tsk_adc( )
ADM = 0b00001011; // セレクトモード、昇圧、fCLK/6 ///ここから ↓
ADPC = 0x06; // ADCポートのセレクト
ADS = ADC_SEL_TUNE;
ADS = ADC_SEL_3D;
nop8();
ADCS = 1; // AD開始。 /// ここまで  までに1us=8clk以上開ける
@ -323,7 +323,7 @@ static u8 getmean3( u8 * hist )
======================================================== */
__interrupt void int_adc( )
{
static u8 hist_tune[3];
static u8 hist_3D[3];
static u8 hist_snd_vol[3];
static u8 hist_bt_temp[3];
static u8 index;
@ -340,7 +340,7 @@ case ( ADC_SEL_AMB_BRIT ): //
break;
*/
case ( ADC_SEL_TUNE ):
case ( ADC_SEL_3D ):
EI();
adc_raw_dep = adc_data;
break;
@ -520,7 +520,7 @@ static void adc_filter( u8 new_val, filter_work *work )
// getmean使用 //
__interrupt void int_adc( )
{
static u8 hist_tune[3];
static u8 hist_3D[3];
static u8 hist_snd_vol[3];
static u8 hist_bt_temp[3];
static u8 index;
@ -537,13 +537,13 @@ case ( ADC_SEL_AMB_BRIT ): //
break;
*/
case ( ADC_SEL_TUNE ):
hist_tune[index] = adc_data;
case ( ADC_SEL_3D ):
hist_3D[index] = adc_data;
EI();
#ifdef _MODEL_WM0_
adc_raw_dep = 255 - getmean3( hist_tune );
adc_raw_dep = 255 - getmean3( hist_3D );
#else
adc_raw_dep = getmean3( hist_tune );
adc_raw_dep = getmean3( hist_3D );
#endif
break;

View File

@ -17,7 +17,7 @@
*/
// ANI6 P26
#define ADC_SEL_TUNE 0x06
#define ADC_SEL_3D 0x06
// ANI7 P27
#define ADC_SEL_VOL 0x07

Binary file not shown.

Binary file not shown.

View File

@ -554,14 +554,15 @@ void iic_mcu_start( )
{
return;
}
iic_mcu_busy = true;
iic_mcu_busy = true;
DST1 = 0;
NOP( ); // 2clkもしくは、DSTn==0をポーリング
NOP( );
DEN1 = 0;
I2C_PU_on();
wait_ms( 10 ); // 立ち上がるのに50us位かかる
wait_ms( 20 ); // 立ち上がるのに50us位かかる
SAU0EN = 1;
nop8();

View File

@ -96,6 +96,14 @@ unsigned char YEAR;
unsigned char MIN;
unsigned char SEC;
unsigned char TDR06
unsigned char TDR03
unsigned char TDR01
unsigned char TDR07
unsigned char TDR05
unsigned char TDR02
# endif

View File

@ -502,7 +502,7 @@ void tsk_led_wifi( )
if( flag_wifi_TX != 0 )
{
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_WIFI_TX;
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_WIFI_TX;
// 送信パターン
switch ( state_wifi_tx )
{

View File

@ -61,10 +61,10 @@ enum LED_ILUM_MODE
};
enum LED_MODE_TUNE
enum LED_MODE_3D
{
LED_TUNE_ILM_OFF = 0,
LED_TUNE_ILM_ON
LED_3D_ILM_OFF = 0,
LED_3D_ILM_ON
};

View File

@ -127,7 +127,6 @@ void tsk_batt( )
heikinka_l = 0;
}
// WM0ではCHG_ENABLEピンは /WL_RST に配線されており、充電制御しない
if( !temp_zone_charge_disable && bt_authorized && !PM_EXTDC_n )
{
BT_CHG_ENABLE(); // 温度範囲OKで充電再開
@ -152,7 +151,7 @@ void tsk_batt( )
}
else
{
BT_IN_CHG_delayed_n = 0;
BT_IN_CHG_delayed_n = 0; // 充電中
}
}
else
@ -183,8 +182,7 @@ void tsk_batt( )
// 割り込みはmiscが引き受ける
// 電池残量 //
if(( system_status.pwr_state != ON_CHECK )&&
( system_status.pwr_state != OFF ))
if( system_status.pwr_state != ON_CHECK )
{
BT_get_left();
}
@ -300,7 +298,7 @@ void BT_model_detect()
BT_DET_P = 1;
BT_TEMP_P = 1;
wait_ms(2); // 電圧が上がるのに時間が掛かる
wait_ms( 5 ); // 電圧が上がるのに時間が掛かる
raw_adc_temperature = get_adc( ADC_SEL_BATT_TEMP );
temp = get_adc( ADC_SEL_BATT_DET );

View File

@ -56,9 +56,9 @@ void tsk_debug( )
// 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, 1, vreg_ctr[ VREG_3D ] );
// 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, 3, vreg_ctr[ VREG_C_3D ] );
// 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 ] );
@ -75,7 +75,7 @@ void tsk_debug( )
str[0] = vreg_ctr[ VREG_C_RTC_SEC ];
str[3] = vreg_ctr[ VREG_C_SND_VOL ];
str[2] = vreg_ctr[ VREG_C_TUNE ];
str[2] = vreg_ctr[ VREG_C_3D ];
str[1] = vreg_ctr[ VREG_C_ACC_CONFIG ];
str[0] = SEC;
iic_mcu_write( IIC_SLA_DBG_MONITOR, 0x03, 4, &str );

View File

@ -52,7 +52,7 @@ bit twl_ver_read;
bit going_to_sleep;
void update_LED_tune();
void update_LED_3D();
void check_twl_vol_irq();
@ -99,7 +99,7 @@ void tsk_misc( )
check_twl_vol_irq(); // TWL の音量変化割り込みチェック
}
update_LED_tune(); // 3D ランプ更新
update_LED_3D(); // 3D ランプ更新
}
@ -137,8 +137,8 @@ void check_twl_vol_irq()
// TUNE_LED ///////////////////////////////////
void update_LED_tune()
// 3D_LED /////////////////////////////////////
void update_LED_3D()
{
if( system_status.pwr_state != ON )
{
@ -147,7 +147,7 @@ void update_LED_tune()
// おしまい //
}
if( vreg_ctr[VREG_C_LED_TUNE] == LED_TUNE_ILM_OFF )
if( vreg_ctr[VREG_C_LED_3D] == LED_3D_ILM_OFF )
{
if( LED_duty_3d != 0 )
{

View File

@ -89,7 +89,7 @@ void tsk_sys( )
timeout = 0;
// todo debug
// for debug
#ifdef _DEBUG_BT_FUEL_
vreg_ctr[ VREG_C_DBG01 ] = 99;
#endif
@ -296,7 +296,7 @@ void tsk_sys( )
// LED消灯を待つ
vreg_ctr[ VREG_C_LED_POW ] = LED_POW_ILM_OFF;
vreg_ctr[ VREG_C_LED_WIFI ] = WIFI_LED_OFF;
vreg_ctr[ VREG_C_LED_TUNE ] = LED_TUNE_ILM_OFF;
vreg_ctr[ VREG_C_LED_3D ] = LED_3D_ILM_OFF;
info_led_off = true;
if( LED_duty_pow_blu != 0 )
{
@ -362,8 +362,6 @@ void tsk_sys( )
iic_mcu_stop( );
timeout = 0;
system_status.pwr_state = OFF;
SW_pow_mask = true;
SW_pow_count = 0;
@ -372,6 +370,7 @@ void tsk_sys( )
// no break //
case OFF:
system_status.poweron_reason = NONE;
if( !PM_EXTDC_n )
{
// アダプタが刺さってるときはこのブロックを繰り返す。
@ -382,10 +381,10 @@ void tsk_sys( )
if( SW_pow_count >= 10 ) // 電源スイッチが押されるのを待つ
{
// 電源投入
system_status.poweron_reason = PWSW;
system_status.pwr_state = ON_CHECK;
}
if( system_status.model != MODEL_JIKKI )
if( system_status.model != MODEL_JIKKI )
{
iic_mcu_stop( );
}
@ -407,8 +406,6 @@ void tsk_sys( )
};
// 省電力へ移行
system_status.poweron_reason = NONE;
iic_mcu_stop( );
pm_chk_adapter();
PM_Chg_Stop();
@ -440,9 +437,13 @@ void tsk_sys( )
{
// 電源ボタンで起きたとき
SW_pow_mask = false;
system_status.poweron_reason = NONE;
system_status.pwr_state = ON_CHECK;
timeout = 0;
}
// else{
// アダプタで起きたときは OFF の中をぐるぐるまわる
// }
RTCIMK = 0;
if( system_status.taikendai )
{

View File

@ -145,7 +145,7 @@
//#define LED_CAM P1.0 // TO02
//#define LED_WIFI P1.1 // TO03
//#define LED_NOTIFY P1.3 // TO05
//#define LED_TUNE P5.2 // SLTO <20>© TO01
//#define LED_3D P5.2 // SLTO <20>© TO01
//#define LED_POW2 P1.4 // TO06 ( <20>Â )
//#define LED_POW1 P1.5 // TO07 ( <20>Ô )
//#define LED_CHARGE P2.4

View File

@ -76,7 +76,7 @@ void vreg_ctr_reset( )
vreg_ctr[ VREG_C_LED_POW ] = 0;
vreg_ctr[ VREG_C_LED_WIFI ] = 0;
vreg_ctr[ VREG_C_LED_CAM ] = 0;
vreg_ctr[ VREG_C_LED_TUNE ] = 0;
vreg_ctr[ VREG_C_LED_3D ] = 0;
vreg_ctr[ VREG_C_VOL_DIGITAL ] = 0x20;
vreg_ctr[ VREG_C_VOL_OPTION ] = 0;
// vreg_ctr[ VREG_C_VOL_CAL_MIN ] = 0x36; ±±Å<E2809A>¢¿áƒ_ƒ<5F><C692>I
@ -189,7 +189,7 @@ void vreg_ctr_write( u8 adrs, u8 data )
case ( VREG_C_LED_WIFI ):
case ( VREG_C_LED_CAM ):
case ( VREG_C_LED_TUNE ):
case ( VREG_C_LED_3D ):
vreg_ctr[adrs] = (u8)( data & 0x0F );
break;
@ -339,7 +339,7 @@ void vreg_ctr_write( u8 adrs, u8 data )
// read only //
case ( VREG_C_MCU_VER_MAJOR ):
case ( VREG_C_MCU_VER_MINOR ):
// VREG_C_TUNE = 0x08,
// VREG_C_3D = 0x08,
// VREG_C_SND_VOL,
// VREG_C_BT_TEMP,
// VREG_C_BT_REMAIN,

View File

@ -70,7 +70,7 @@
// そのうちどこかに...
//#define REG_BIT_VR_TUNE_CHANGE ( 1 << 7 )
//#define REG_BIT_VR_3D_CHANGE ( 1 << 7 )
@ -162,7 +162,7 @@ enum VREG_C_ADRS
VREG_C_DBG02,
VREG_C_DBG03,
VREG_C_TUNE = 0x08,
VREG_C_3D = 0x08,
VREG_C_SND_VOL,
VREG_C_BT_TEMP,
VREG_C_BT_REMAIN,
@ -198,7 +198,7 @@ enum VREG_C_ADRS
VREG_C_LED_POW,
VREG_C_LED_WIFI,
VREG_C_LED_CAM,
VREG_C_LED_TUNE,
VREG_C_LED_3D,
VREG_C_LED_NOTIFY_DATA,
VREG_C_LED_NOTIFY_FLAG,

View File

@ -12,7 +12,7 @@ Firm Clock=System
Flash Programming=Permit
Low-voltage Flash Rewriting=On
Fail Safe Break=0x2000
Port=0
Port=1
NMI=OFF
TRESET=OFF
IRESET=OFF
@ -22,7 +22,7 @@ SubClock=None
[Mapping]
Count=0
[Main]
Geometry=66, 66, 960, 728
Geometry=13, 66, 1440, 858
Window=Max
MDI_MAX=OFF
Button=ON
@ -33,7 +33,7 @@ Coverage=OFF
Timer=OFF
Tracer=OFF
[Load File]
Dir=\\tsclient\C\78k_data\yav-mcu-basara\trunk\
Dir=\\Tsclient\c\78k_data\yav-mcu-basara\trunk\
SaveFilter=0
Start=0
End=0
@ -45,7 +45,7 @@ Erase=OFF
HighSpeed=OFF
Symbol Reset=ON
CPU Reset=ON
File1=\\tsclient\C\78k_data\yav-mcu-basara\trunk\bsr.lmf
File1=\\Tsclient\c\78k_data\yav-mcu-basara\trunk\bsr.lmf
LoadFilter1=5
Offset1=0
Object1=ON
@ -55,10 +55,10 @@ HighSpeed1=OFF
CPU Reset1=ON
Symbol Reset1=ON
[View File]
Dir=\\tsclient\C\78k_data\yav-mcu-basara\trunk\
Dir=\\Tsclient\c\78k_data\yav-mcu-basara\trunk\
Filter=Source
[Debugger Option]
Source Path="\\tsclient\C\78k_data\yav-mcu-basara\trunk\renge"
Source Path=""
Symbol Size=Byte
Symbol Format=Hex
Register Name=Func
@ -78,10 +78,10 @@ Symbol Type=OFF
Language=C
Kanji=SJIS
[Source]
Geometry=278, 33, 715, 1006
Geometry=0, 0, 725, 753
Window=Normal
DispStart=431
CaretPos=432,0
DispStart=435
CaretPos=436,0
Mode=Normal
DispFile=
Address1=
@ -139,6 +139,14 @@ SaveRange=Screen
SaveStart=
SaveEnd=
Accumulative=ON
[Source1]
Geometry=139, 70, 725, 684
Window=Normal
DispStart=153
CaretPos=121,9
Mode=Normal
DispFile=\\Tsclient\c\78k_data\yav-mcu-basara\trunk\led.c
Accumulative=ON
[Assemble]
Geometry=0, 0, 0, 0
Window=Hide
@ -185,7 +193,7 @@ SaveRange=Screen
SaveStart=
SaveEnd=
[Memory]
Geometry=0, 0, 0, 0
Geometry=856, 20, 550, 400
Window=Hide
Boundary=0
Format=Hex
@ -194,7 +202,7 @@ Endian=
Ascii=OFF
Idtag=OFF
Address=
DispStart=FFFFFFFF
DispStart=00000000
CaretPosData=0, 0
CaretPosAscii=0, 0
Address1=
@ -957,17 +965,15 @@ Detail=OFF
Last Name=
Count=0
[Variable]
Geometry=945, 6, 644, 1042
Geometry=908, 128, 510, 614
Window=Normal
Boundary=13762700
0=.vreg_ctr,P,N,A,+,1
1=.tdr05,P,S,A,+,1
2=.system_status,.,N,A,+,1
Line=3
Line=1
[Quick Watch]
0=tdr05,P,A,1
1=vreg_ctr,P,A,1
2=system_status,P,A,1
0=vreg_ctr,P,A,1
1=system=status,P,A,1
2=
3=
4=
5=
@ -985,15 +991,7 @@ Line=3
Geometry=0, 0, 0, 0
Window=Hide
Width=150 30 200 100
Name0=Swb00003
Address0=led.c#_led_pow_bt_empty+0x0
Window0=ASM
Status0=ON
Name1=Swb00001
Address1=led.c#_tsk_led_pow+0x7e
Window1=ASM
Status1=ON
Count=2
Count=0
[Reset]
Debugger=ON
Symbol=OFF

View File

@ -23,7 +23,7 @@ MuitiLoad=0
LoadPrjNum=0
CheckVersion=CC78K0R|W2.13;RA78K0R|W1.33
[Option.IDK0R32G]
File=\\tsclient\C\78k_data\yav-mcu-basara\trunk\yav_mcu_bsr.pri
File=\\Tsclient\c\78k_data\yav-mcu-basara\trunk\yav_mcu_bsr.pri
[BuildMode2]
BuildModeName=K0R_dbg
TargetFile=0
@ -840,7 +840,7 @@ G=1
E=0
E0=flash.elk
E1=a.elk
GO=0
GO=1
GOValue=85
GOStart=FC00
GOSizeValue=1024