i2c_ctr.c[ctr/twl] 初期化コードのポート設定、誤ってた(実害はなし)

TSKIタスクの返値、名前変更&typo修正


git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@459 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
n2232 2012-06-13 01:49:44 +00:00
parent ae2cf35020
commit f77e630f7f
11 changed files with 34 additions and 27 deletions

Binary file not shown.

Binary file not shown.

View File

@ -103,7 +103,7 @@ task_status_immed tski_cbk_accero( )
{ {
acc_retry_count ++; acc_retry_count ++;
// リトライ // リトライ
return( ERR_CONTINUE ); return( TSKI_CONTINUE );
} }
else else
{ {
@ -111,7 +111,7 @@ task_status_immed tski_cbk_accero( )
vreg_ctr[ VREG_C_ACC_CONFIG ] &= ~( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ ); vreg_ctr[ VREG_C_ACC_CONFIG ] &= ~( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ );
tski_acc_setup(); tski_acc_setup();
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_ACCERO_ERR; vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_ACCERO_ERR;
return ( ERR_FINISED ); // タスクの削除は必要 return ( TSKI_FINISHED ); // タスクの削除は必要
} }
} }
else else
@ -143,7 +143,7 @@ task_status_immed tski_cbk_accero( )
pedometer(); // 歩数計 pedometer(); // 歩数計
} }
} }
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }
@ -157,7 +157,7 @@ task_status_immed tski_acc_read( )
{ {
vreg_ctr[VREG_C_ACC_W_BUF] = iic_mcu_read_a_byte( IIC_SLA_ACCEL, vreg_ctr[VREG_C_ACC_R_ADRS] ); vreg_ctr[VREG_C_ACC_W_BUF] = iic_mcu_read_a_byte( IIC_SLA_ACCEL, vreg_ctr[VREG_C_ACC_R_ADRS] );
set_irq( VREG_C_IRQ1, REG_BIT_ACC_ACK ); set_irq( VREG_C_IRQ1, REG_BIT_ACC_ACK );
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }
@ -169,7 +169,7 @@ task_status_immed tski_acc_write( )
{ {
iic_mcu_write_a_byte( IIC_SLA_ACCEL, vreg_ctr[VREG_C_ACC_W_ADRS], vreg_ctr[VREG_C_ACC_W_BUF] ); iic_mcu_write_a_byte( IIC_SLA_ACCEL, vreg_ctr[VREG_C_ACC_W_ADRS], vreg_ctr[VREG_C_ACC_W_BUF] );
set_irq( VREG_C_IRQ1, REG_BIT_ACC_ACK ); set_irq( VREG_C_IRQ1, REG_BIT_ACC_ACK );
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }
@ -222,7 +222,7 @@ task_status_immed tski_acc_setup( )
{ {
// センサ反応無し。タスクは削除しなくてはならない。 // センサ反応無し。タスクは削除しなくてはならない。
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_ACCERO_ERR; vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_ACCERO_ERR;
return ( ERR_FINISED ); return ( TSKI_FINISHED );
// おしまい // おしまい
} }
// else // else
@ -247,12 +247,12 @@ task_status_immed tski_acc_setup( )
( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ ))) ( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ )))
{ {
// DI状態のまま帰る // DI状態のまま帰る
return ( ERR_CONTINUE ); // ちょっと間をおいて再度書きにくる // もっとよい実装? return ( TSKI_CONTINUE ); // ちょっと間をおいて再度書きにくる // もっとよい実装?
} }
} }
// DI状態のまま帰る // DI状態のまま帰る
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }

View File

@ -165,7 +165,7 @@ task_status_immed tski_vol_update()
if( !( system_status.pwr_state == ON ) || if( !( system_status.pwr_state == ON ) ||
( system_status.pwr_state == SLEEP )){ ( system_status.pwr_state == SLEEP )){
return( ERR_FINISED ); return( TSKI_FINISHED );
} }
// どの音量にするの? // // どの音量にするの? //
@ -216,7 +216,7 @@ task_status_immed tski_vol_update()
iic_mcu_write_a_byte_codec( CODEC_REG_VOL, slider_to_codec[ sent_index ] ); iic_mcu_write_a_byte_codec( CODEC_REG_VOL, slider_to_codec[ sent_index ] );
// set_irq( VREG_C_IRQ0, REG_BIT_VR_SNDVOL_CHANGE ); // 割り込み廃止 // set_irq( VREG_C_IRQ0, REG_BIT_VR_SNDVOL_CHANGE ); // 割り込み廃止
return( ERR_FINISED ); return( TSKI_FINISHED );
} }

View File

@ -47,6 +47,9 @@
#define SMC SMC1 #define SMC SMC1
#define DFC DFC1 #define DFC DFC1
#define IICS IICS1 #define IICS IICS1
#define PortMode PM20
#define Port P20
#endif #endif
@ -290,7 +293,8 @@ void IIC_ctr_Init( void )
IICE = 1; IICE = 1;
PM20 &= ~0x3; /* set clock pin for IICA */ // *twlと*ctrで違いますよ PortMode &= ~0x03;
Port &= ~0x03;
state = IIC_IDLE; state = IIC_IDLE;
} }

View File

@ -53,6 +53,8 @@
#define SMC SMC0 #define SMC SMC0
#define TRC TRC0 #define TRC TRC0
#define DFC DFC0 #define DFC DFC0
#define PortMode PM6
#define Port P6
#endif // _MCU_BSR_ #endif // _MCU_BSR_
@ -224,7 +226,8 @@ void IIC_twl_Init( void )
IICE = 1; IICE = 1;
PM3 &= ~0x3; /* set clock pin for IICA */ // *twlと*ctrで違いますよ PortMode &= ~0x03;
Port &= ~0x03;
LREL = 1; LREL = 1;
} }

View File

@ -633,7 +633,7 @@ task_status_immed tski_BT_temp_update( )
} }
} }
} }
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }
@ -1002,7 +1002,7 @@ void PM_LCD_vcom_set( )
task_status_immed tski_vcom_set( ) task_status_immed tski_vcom_set( )
{ {
PM_LCD_vcom_set( ); PM_LCD_vcom_set( );
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }
@ -1148,7 +1148,7 @@ task_status_immed tski_ntr_pmic_comm( )
ntr_pm_reg_shadow = iic_mcu_read_a_byte( IIC_SLA_CODEC, CODEC_REG_PM ); ntr_pm_reg_shadow = iic_mcu_read_a_byte( IIC_SLA_CODEC, CODEC_REG_PM );
if( iic_mcu_result != ERR_SUCCESS ) if( iic_mcu_result != ERR_SUCCESS )
{ {
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }
// DI( ); // DI( );
@ -1218,7 +1218,7 @@ task_status_immed tski_ntr_pmic_comm( )
ntr_pm_reg_shadow &= ~( REG_BIT_TWL_REQ_OFF_REQ | REG_BIT_TWL_REQ_RST_REQ ); ntr_pm_reg_shadow &= ~( REG_BIT_TWL_REQ_OFF_REQ | REG_BIT_TWL_REQ_RST_REQ );
iic_mcu_write_a_byte_codec( CODEC_REG_PM, ntr_pm_reg_shadow ); iic_mcu_write_a_byte_codec( CODEC_REG_PM, ntr_pm_reg_shadow );
} }
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }
@ -1231,13 +1231,13 @@ task_status_immed tski_ntr_pmic_comm( )
task_status_immed tski_PM_LCD_on() task_status_immed tski_PM_LCD_on()
{ {
PM_LCD_on(); PM_LCD_on();
return( ERR_FINISED ); return( TSKI_FINISHED );
} }
task_status_immed tski_PM_LCD_off() task_status_immed tski_PM_LCD_off()
{ {
PM_LCD_off(); PM_LCD_off();
return( ERR_FINISED ); return( TSKI_FINISHED );
} }
task_status_immed tski_PM_BL_set() task_status_immed tski_PM_BL_set()
@ -1252,7 +1252,7 @@ task_status_immed tski_PM_BL_set()
while( cmd_BL != vreg_ctr[VREG_C_COMMAND2] ); // <- PM_BL_setª<E2809A>X<EFBFBD>V·é while( cmd_BL != vreg_ctr[VREG_C_COMMAND2] ); // <- PM_BL_setª<E2809A>X<EFBFBD>V·é
vreg_ctr[VREG_C_COMMAND2] = 0; vreg_ctr[VREG_C_COMMAND2] = 0;
return( ERR_FINISED ); return( TSKI_FINISHED );
} }

View File

@ -126,7 +126,7 @@ __callt err renge_task_interval_run(){
tickI2C通信完了など tickI2C通信完了など
 ERR_FINISED   TSKI_FINISHED 
         
*****************************************************************************/ *****************************************************************************/

View File

@ -33,8 +33,8 @@ typedef enum _ERR
typedef enum _IMMED_TASK_ERR typedef enum _IMMED_TASK_ERR
{ {
ERR_FINISED = 0, TSKI_FINISHED = 0,
ERR_CONTINUE TSKI_CONTINUE
}IMMED_TASK_ERR; }IMMED_TASK_ERR;

View File

@ -112,9 +112,9 @@ task_interval tsk_hina( )
***********************************************/ ***********************************************/
task_status_immed tski_hina( u8 * arg ) task_status_immed tski_hina( u8 * arg )
{ {
return ( ERR_FINISED ); return ( TSKI_FINISHED );
// ERR_FINISED タスクを削除 // TSKI_FINISHED タスクを削除
// ERR_CONTINUE 次になんか割り込みなり、ユーザー操作なり、システムチックが // TSKI_CONTINUE 次になんか割り込みなり、ユーザー操作なり、システムチックが
// 来たときに再度実行 // 来たときに再度実行
} }

View File

@ -300,10 +300,10 @@ task_status_immed tski_do_command0( )
OFF OFF
if( vreg_ctr[VREG_C_COMMAND0] != 0 ) if( vreg_ctr[VREG_C_COMMAND0] != 0 )
{ {
return ( ERR_CONTINUE ); return ( TSKI_CONTINUE );
} }
*/ */
return ( ERR_FINISED ); return ( TSKI_FINISHED );
} }