📄 rt5time.c
字号:
SYS_WORK->tsk_id = TASKMNG;
OUT_PRIEVT->evt_cod = ERT;
OUT_PRIEVT->pri_cod = PSTCHACA;
OUT_PRIEVT->add_dat = BIT2;
m_excreq( (WORD*)&SYS_WORK->tsk_id );
return (0);
}
/********************************************************************************************************/
/* */
/* NUMBER 13 */
/* CALL void rt_tr306p */
/* PARAM timer timeout triggle this function */
/* DISCRIPTION: if monitor success begin to establish link channel */
/* otherwise camp cslist again */
/* RETURN: */
/********************************************************************************************************/
U1 rt_tr306p(void)
{
//U1 cnt, mode;
Rt_tim &= ~TR306ON;
cch_m_stp();
rt_recall_cch_moni2(); /* coordinate and sort camp cs list */
if ( Rt_mntcnt == 0 ) /* monitor fail */
{
if(SYS_PARTNER == DDI_PBS)
{
rt_tchold( 3 );
return(0);
}
else
{ /* camp cslist again */
Rt_gain = GAIN_M;
cch_m_req( CCH_HO, SYS_FREQ, SYS_HO_RSSI, Rt_gain, OFF );
rt_tm_start( TR306ON ); /* start monitor cs list again*/
}
}
else
{/* select a cs to establish link channel */
Rt_mntcnt--;
move_up_b( SYS_CSID_P, (U1*)Rt_mntcs[Rt_mntcnt].cs_id, 6 ); /* set current radio info*/
move_up_b( (U1*)Rt_radinf.cs_id, (U1*)Rt_mntcs[Rt_mntcnt].cs_id, 6 );
cch_est_req( SYS_FREQ, SYS_CSID_P, Rt_gain );
rt_tm_start( TRCCHESTON );/* startup timer to wait assign message */
if((Rtlchdat[0] & 0x0f) == 0x02) /* link establish message type is LCHR */
Rtlchdat[0]--;
move_up_b( tx_cac, Rtlchdat, 5 );
#ifdef SIMU_ON_PC
SendUart2L1(SIMTSKDTW,TXCAC, 0 , tx_cac,sizeof(tx_cac));
ph_dt_req( L1_SCCH, DUMMY, OFF,0 ); /* send link establish request message to cs*/
#else
ph_dt_req( L1_SCCH, DUMMY, OFF ); /* send link establish request message to cs*/
#endif
Lchercnt++;
Rt_sts = ST_RLCH_REQ;
}
return (0);
}
void rt_trstp(void)
{
if ( Rt_tim == 0 )
return;
#ifdef _DEBUG_TC6_
_SendStringToUart("rt_trstp\n",sizeof("rt_trstp\n"));
#endif
if ( Rt_tim & TR001ON )
rt_tm_stop( TR001ON );
if ( Rt_tim & TR101ON )
rt_tm_stop( TR101ON );
if ( Rt_tim & TR103ON )
rt_tm_stop( TR103ON );
if ( Rt_tim & TR105ON )
rt_tm_stop( TR105ON );
if ( Rt_tim & TR301ON )
rt_tm_stop( TR301ON );
if ( Rt_tim & TR3021ON )
rt_tm_stop( TR3021ON );
if ( Rt_tim & TR3022ON )
rt_tm_stop( TR3022ON );
if ( Rt_tim & TR304ON )
rt_tm_stop( TR304ON );
if ( Rt_tim & TR305ON )
rt_tm_stop( TR305ON );
if ( Rt_tim & TR306ON )
{
rt_tm_stop( TR306ON );
cch_m_stp();
}
if ( Rt_tim & TRCCHESTON )
rt_tm_stop( TRCCHESTON );
Rt_tim = 0;
rt_trstp_algo();
}
void rt_tm_start(U2 flg)
{
set_up_b( (U1 *)SYS_WORK->tim_inf, 0, 11*2 );
switch( flg )
{
case TR001ON:
SYS_WORK->tim_inf[0] = T100MS;
// #ifdef SIMU_ON_PC /* zch for protocol simulator */
// SYS_WORK->tim_inf[1] = TR001P + 50;
// #else
SYS_WORK->tim_inf[1] = TR001P;
// #endif
SYS_WORK->tim_inf[4] = PRTR001P;
break;
case TR101ON:
SYS_WORK->tim_inf[0] = T20MS;
SYS_WORK->tim_inf[1] = TR101P;
SYS_WORK->tim_inf[4] = PRTR101P;
break;
case TR103ON:
SYS_WORK->tim_inf[0] = T1S;
SYS_WORK->tim_inf[1] = TR103P;
SYS_WORK->tim_inf[4] = PRTR103P;
break;
case TR105ON:
SYS_WORK->tim_inf[0] = T100MS;
SYS_WORK->tim_inf[1] = TR105P;
SYS_WORK->tim_inf[4] = PRTR105P;
break;
case TR301ON:
SYS_WORK->tim_inf[0] = T100MS;
SYS_WORK->tim_inf[1] = TR301P;
SYS_WORK->tim_inf[4] = PRTR301P;
break;
case TR3021ON:
SYS_WORK->tim_inf[0] = T100MS;
SYS_WORK->tim_inf[1] = TR3021P;
SYS_WORK->tim_inf[4] = PRTR3021P;
break;
case TR3022ON:
SYS_WORK->tim_inf[0] = T100MS;
SYS_WORK->tim_inf[1] = TR3022P;
SYS_WORK->tim_inf[4] = PRTR3022P;
break;
case TR304ON:
SYS_WORK->tim_inf[0] = T100MS;
SYS_WORK->tim_inf[1] = TR304P;
SYS_WORK->tim_inf[4] = PRTR304P;
break;
case TR305ON:
SYS_WORK->tim_inf[0] = T100MS;
SYS_WORK->tim_inf[1] = TR305P;
SYS_WORK->tim_inf[4] = PRTR305P;
break;
case TR306ON:
SYS_WORK->tim_inf[0] = T20MS;
SYS_WORK->tim_inf[1] = Sys_montim[0] * Sys_hodat[1];
SYS_WORK->tim_inf[4] = PRTR306P;
break;
case TRCCHESTON:
SYS_WORK->tim_inf[0] = T20MS;
SYS_WORK->tim_inf[1] = TRCCHEST;
SYS_WORK->tim_inf[4] = PRTRCCHEST;
break;
default:
return;
}
SYS_WORK->tim_inf[2] = TASKRT;
SYS_WORK->tim_inf[3] = ERT;
Rt_tim |= flg;
m_settim((U2*)SYS_WORK->tim_inf);
}
void rt_tm_stop(U2 flg)
{
if (( Rt_tim & flg ) == 0 )
return;
switch( flg )
{
case TR001ON:
m_stptim(T100MS, ERT, PRTR001P);
break;
case TR101ON:
m_stptim(T20MS, ERT, PRTR101P);
break;
case TR103ON:
m_stptim(T1S, ERT, PRTR103P);
break;
case TR105ON:
m_stptim(T100MS, ERT, PRTR105P);
break;
case TR301ON:
m_stptim(T100MS, ERT, PRTR301P);
break;
case TR3021ON:
m_stptim(T100MS, ERT, PRTR3021P);
break;
case TR3022ON:
m_stptim(T100MS, ERT, PRTR3022P);
break;
case TR304ON:
m_stptim(T100MS, ERT, PRTR304P);
break;
case TR305ON:
m_stptim(T100MS, ERT, PRTR305P);
break;
case TR306ON:
m_stptim(T20MS, ERT, PRTR306P);
break;
case TRCCHESTON:
m_stptim(T20MS, ERT, PRTRCCHEST);
break;
default:
return;
}
Rt_tim &= ~flg;
}
U1 rt_trcchest(void)
{
Rt_tim &= ~TRCCHESTON;
rt_recall_lch_send();
return (0);
}
void rt_tm_start_algo2(U2 flg)
{
if(SYS_PARTNER != DDI_PBS)
return;
set_up_b( (U1 *)SYS_WORK->tim_inf, 0, 11*2 );
switch( flg )
{
case SYNBSTON:
SYS_WORK->tim_inf[0] = T20MS;
SYS_WORK->tim_inf[1] = Sys_initdl1[19];
SYS_WORK->tim_inf[4] = PRSYNBST;
break;
default:
return;
}
SYS_WORK->tim_inf[2] = TASKRT;
SYS_WORK->tim_inf[3] = ERT;
Rt_algo_tim |= flg;
m_settim((U2*)SYS_WORK->tim_inf);
}
void rt_tm_stop_algo2(U2 flg)
{
if (( Rt_algo_tim & flg ) == 0 )
return;
switch( flg )
{
case SYNBSTON:
m_stptim(T20MS, ERT, PRSYNBST);
break;
default:
return;
}
Rt_algo_tim &= ~flg;
}
void rt_trstp_algo(void)
{
if (Rt_algo_tim == 0)
return;
if ( Rt_algo_tim & SYNBSTON )
rt_tm_stop_algo2( SYNBSTON );
Rt_algo_tim = 0;
}
#ifdef __cplusplus
}
#endif
#undef __RTTIME_C_
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -