mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-06-18 16:45:33 -04:00
ファーム更新時、amo_hv の状態を復帰する
…けど、市場でクレームが出ていないということは(幸い)本体更新時はバックライト切ってる? (Horizon 再起動だし、 reset コマンドをちゃんと出してる気もする) git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@579 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
parent
30729da73f
commit
668c688a28
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ typedef signed short sx16;
|
||||
#define false 0
|
||||
|
||||
|
||||
#define set_bit( cond, reg, pos ) \
|
||||
#define set_bit_if( cond, reg, pos ) \
|
||||
{ \
|
||||
if( cond ){ \
|
||||
reg |= pos; \
|
||||
|
@ -185,7 +185,7 @@ static void update_chg_led()
|
||||
LED_CHARGE = temp_led_chg;
|
||||
|
||||
// レジスタの充電中ビットはLEDに同期する
|
||||
set_bit( LED_CHARGE, vreg_ctr[VREG_C_STATUS], REG_BIT_BATT_CHARGE ); // set_bitのみ。
|
||||
set_bit_if( LED_CHARGE, vreg_ctr[VREG_C_STATUS], REG_BIT_BATT_CHARGE ); // set_bit_ifのみ。
|
||||
/// 割り込みはtask_status()で行う
|
||||
}
|
||||
|
||||
@ -282,7 +282,7 @@ void bt_get_charge_status()
|
||||
***********************************************/
|
||||
void pm_chk_adapter()
|
||||
{
|
||||
set_bit( !PM_EXTDC_n, vreg_ctr[VREG_C_STATUS], REG_BIT_POW_SUPPLY );
|
||||
set_bit_if( !PM_EXTDC_n, vreg_ctr[VREG_C_STATUS], REG_BIT_POW_SUPPLY );
|
||||
|
||||
if( pm_extdc_old != PM_EXTDC_n ) // HAL を通すため、 PM_EXTDC_n の volatile にする心配なし
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ void tsk_status( )
|
||||
u8 diff;
|
||||
|
||||
// 蓋開けチェック
|
||||
set_bit( SHELL_OPEN, vreg_ctr[VREG_C_STATUS], REG_BIT_ST_SHELL_OPEN );
|
||||
set_bit_if( SHELL_OPEN, vreg_ctr[VREG_C_STATUS], REG_BIT_ST_SHELL_OPEN );
|
||||
|
||||
// ステータスレジスタ関係 → 割り込み //
|
||||
// pm.c で、その場で行います。
|
||||
|
@ -201,6 +201,13 @@ void tsk_sys( )
|
||||
LED_CAM = 0;
|
||||
i2c_mcu_time_out_error = false;
|
||||
#endif
|
||||
|
||||
/// ここでやるべきでは?
|
||||
// プルアップon
|
||||
PU_BT_IN_CHG_n = 1;
|
||||
PU7 = bits8(0,0,0,1, 1,1,0,1); // 4:SW_WIFI 3:SW_PWSW 2:PM_IRQ 0:PM_EXTDC_n
|
||||
PU_SW_HOME_n_JIKKI = 1; // SW_HOME
|
||||
|
||||
IIC_ctr_Init( );
|
||||
IIC_twl_Init( );
|
||||
|
||||
@ -222,15 +229,24 @@ void tsk_sys( )
|
||||
// PMK21 = 0; // wifi Žg‚í‚È‚¢
|
||||
PMK6 = 0; // pm_irq
|
||||
|
||||
// リブート時、ステータスを何となく更新
|
||||
// リブート時、ステータスを何となく更新、辻褄合わせ
|
||||
if( system_status.reboot )
|
||||
{
|
||||
u8 bl_status_temp;
|
||||
|
||||
// LCD 電源ステータス
|
||||
/// ファーム更新時、必ず液晶offかも?
|
||||
if( read_pmic( PM_REG_ADRS_VDD_LCD ) != 0 )
|
||||
{
|
||||
vreg_ctr[ VREG_C_STATUS ] |= REG_BIT_LCD_POW;
|
||||
LCD_AMOL_HV_CTRL = 1;
|
||||
}
|
||||
|
||||
// バックライトが点いていたなら点ける
|
||||
bl_status_temp = read_pmic( PM_REG_ADRS_BL );
|
||||
vreg_ctr[ VREG_C_STATUS ] |= (( bl_status_temp & 0x03 ) << 5 );
|
||||
set_bit( ( read_pmic( PM_REG_ADRS_VDD_LCD ) != 0 ),
|
||||
vreg_ctr[ VREG_C_STATUS ], REG_BIT_LCD_POW );
|
||||
|
||||
// バッテリ&本体識別
|
||||
BT_chk();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user