1、修改定时器4初始化代码,修复上升下降控制速度异常BUG。
This commit is contained in:
@@ -157,7 +157,7 @@
|
|||||||
<Bp>
|
<Bp>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Type>0</Type>
|
<Type>0</Type>
|
||||||
<LineNumber>291</LineNumber>
|
<LineNumber>346</LineNumber>
|
||||||
<EnabledFlag>1</EnabledFlag>
|
<EnabledFlag>1</EnabledFlag>
|
||||||
<Address>4146</Address>
|
<Address>4146</Address>
|
||||||
<ByteObject>0</ByteObject>
|
<ByteObject>0</ByteObject>
|
||||||
@@ -168,23 +168,7 @@
|
|||||||
<BreakIfRCount>1</BreakIfRCount>
|
<BreakIfRCount>1</BreakIfRCount>
|
||||||
<Filename>..\source\Module\dc_motor\dc_motor.c</Filename>
|
<Filename>..\source\Module\dc_motor\dc_motor.c</Filename>
|
||||||
<ExecCommand></ExecCommand>
|
<ExecCommand></ExecCommand>
|
||||||
<Expression>\\BombSensor\../source/Module/dc_motor/dc_motor.c\291</Expression>
|
<Expression>\\BombSensor\../source/Module/dc_motor/dc_motor.c\346</Expression>
|
||||||
</Bp>
|
|
||||||
<Bp>
|
|
||||||
<Number>1</Number>
|
|
||||||
<Type>0</Type>
|
|
||||||
<LineNumber>343</LineNumber>
|
|
||||||
<EnabledFlag>1</EnabledFlag>
|
|
||||||
<Address>0</Address>
|
|
||||||
<ByteObject>0</ByteObject>
|
|
||||||
<HtxType>0</HtxType>
|
|
||||||
<ManyObjects>0</ManyObjects>
|
|
||||||
<SizeOfObject>0</SizeOfObject>
|
|
||||||
<BreakByAccess>0</BreakByAccess>
|
|
||||||
<BreakIfRCount>0</BreakIfRCount>
|
|
||||||
<Filename>..\source\Module\dc_motor\dc_motor.c</Filename>
|
|
||||||
<ExecCommand></ExecCommand>
|
|
||||||
<Expression></Expression>
|
|
||||||
</Bp>
|
</Bp>
|
||||||
</Breakpoint>
|
</Breakpoint>
|
||||||
<WatchWindow1>
|
<WatchWindow1>
|
||||||
@@ -283,6 +267,21 @@
|
|||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>g_motor_data</ItemText>
|
<ItemText>g_motor_data</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>19</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>g_motorSpeed,0x0A</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>20</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>DcMotorDispEn</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>21</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>(500u) - g_motorSpeed,0x0A</ItemText>
|
||||||
|
</Ww>
|
||||||
</WatchWindow1>
|
</WatchWindow1>
|
||||||
<Tracepoint>
|
<Tracepoint>
|
||||||
<THDelay>0</THDelay>
|
<THDelay>0</THDelay>
|
||||||
@@ -290,7 +289,7 @@
|
|||||||
<DebugFlag>
|
<DebugFlag>
|
||||||
<trace>0</trace>
|
<trace>0</trace>
|
||||||
<periodic>1</periodic>
|
<periodic>1</periodic>
|
||||||
<aLwin>0</aLwin>
|
<aLwin>1</aLwin>
|
||||||
<aCover>0</aCover>
|
<aCover>0</aCover>
|
||||||
<aSer1>0</aSer1>
|
<aSer1>0</aSer1>
|
||||||
<aSer2>0</aSer2>
|
<aSer2>0</aSer2>
|
||||||
@@ -326,6 +325,12 @@
|
|||||||
<pszMrulep></pszMrulep>
|
<pszMrulep></pszMrulep>
|
||||||
<pSingCmdsp></pSingCmdsp>
|
<pSingCmdsp></pSingCmdsp>
|
||||||
<pMultCmdsp></pMultCmdsp>
|
<pMultCmdsp></pMultCmdsp>
|
||||||
|
<SystemViewers>
|
||||||
|
<Entry>
|
||||||
|
<Name>System Viewer\TMR41</Name>
|
||||||
|
<WinId>35905</WinId>
|
||||||
|
</Entry>
|
||||||
|
</SystemViewers>
|
||||||
<DebugDescription>
|
<DebugDescription>
|
||||||
<Enable>1</Enable>
|
<Enable>1</Enable>
|
||||||
<EnableFlashSeq>0</EnableFlashSeq>
|
<EnableFlashSeq>0</EnableFlashSeq>
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ void DCMOTORDBGOnOff(uint8_t OnOff)
|
|||||||
#define TIMER4_PWM_H_PIN (Pin09)
|
#define TIMER4_PWM_H_PIN (Pin09)
|
||||||
#define TIMER4_PWM_L_PORT (PortB) /* TIM4_1_OUL_B:PE8 TIM4_1_OVL_B:PE10 TIM4_1_OWL_B:PE12 */
|
#define TIMER4_PWM_L_PORT (PortB) /* TIM4_1_OUL_B:PE8 TIM4_1_OVL_B:PE10 TIM4_1_OWL_B:PE12 */
|
||||||
#define TIMER4_PWM_L_PIN (Pin14)
|
#define TIMER4_PWM_L_PIN (Pin14)
|
||||||
|
|
||||||
|
en_timer4_oco_ch_t enOcoLowCh = (en_timer4_oco_ch_t)(TIMER4_OCO_HIGH_CH + 1);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -375,7 +378,7 @@ void AdcLoopHander(void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if(0)
|
||||||
void Timer41_Init(uint8_t dir)
|
void Timer41_Init(uint8_t dir)
|
||||||
{
|
{
|
||||||
uint8_t E_OC_Port = 0;
|
uint8_t E_OC_Port = 0;
|
||||||
@@ -516,9 +519,131 @@ void Timer41_Init(uint8_t dir)
|
|||||||
TIMER4_CNT_Start(TIMER4_UNIT);
|
TIMER4_CNT_Start(TIMER4_UNIT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if(1)
|
||||||
|
|
||||||
|
void Timer41_Init(void)
|
||||||
|
{
|
||||||
|
stc_timer4_cnt_init_t stcCntInit;
|
||||||
|
stc_timer4_oco_init_t stcOcoInit;
|
||||||
|
stc_timer4_pwm_init_t stcPwmInit;
|
||||||
|
stc_oco_low_ch_compare_mode_t stcLowChCmpMode;
|
||||||
|
stc_oco_high_ch_compare_mode_t stcHighChCmpMode;
|
||||||
|
uint16_t u8OcoOccrVal = TIMER4_CNT_CYCLE_VAL/10u;
|
||||||
|
en_timer4_oco_ch_t enOcoLowCh = (en_timer4_oco_ch_t)(TIMER4_OCO_HIGH_CH + 1);
|
||||||
|
|
||||||
|
/* Clear structures */
|
||||||
|
MEM_ZERO_STRUCT(stcCntInit);
|
||||||
|
MEM_ZERO_STRUCT(stcOcoInit);
|
||||||
|
MEM_ZERO_STRUCT(stcLowChCmpMode);
|
||||||
|
MEM_ZERO_STRUCT(stcHighChCmpMode);
|
||||||
|
MEM_ZERO_STRUCT(stcPwmInit);
|
||||||
|
|
||||||
|
/* Enable peripheral clock */
|
||||||
|
PWC_Fcg2PeriphClockCmd(PWC_FCG2_PERIPH_TIM41, Enable);
|
||||||
|
|
||||||
|
/* Timer4 CNT : Initialize CNT configuration structure */
|
||||||
|
stcCntInit.enBufferCmd = Disable;
|
||||||
|
stcCntInit.enClk = Timer4CntPclk;
|
||||||
|
stcCntInit.enClkDiv = Timer4CntPclkDiv4; /* CNT clock divide */
|
||||||
|
stcCntInit.u16Cycle = TIMER4_CNT_CYCLE_VAL;
|
||||||
|
// stcCntInit.enCntMode = Timer4CntSawtoothWave; //锯齿波模式
|
||||||
|
stcCntInit.enCntMode = Timer4CntTriangularWave; //三角波模式Timer4CntTriangularWave
|
||||||
|
stcCntInit.enZeroIntCmd = Disable;
|
||||||
|
stcCntInit.enPeakIntCmd = Disable;
|
||||||
|
stcCntInit.enZeroIntMsk = Timer4CntIntMask0;
|
||||||
|
stcCntInit.enPeakIntMsk = Timer4CntIntMask0;
|
||||||
|
TIMER4_CNT_Init(TIMER4_UNIT, &stcCntInit); /* Initialize CNT */
|
||||||
|
|
||||||
|
/* Timer4 OCO : Initialize OCO configuration structure */
|
||||||
|
stcOcoInit.enOccrBufMode = OccrBufDisable;
|
||||||
|
stcOcoInit.enOcmrBufMode = OcmrBufDisable;
|
||||||
|
stcOcoInit.enPortLevel = OcPortLevelHigh; /*输出高电平到OC端口*/
|
||||||
|
stcOcoInit.enOcoIntCmd = Disable;
|
||||||
|
TIMER4_OCO_Init(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, &stcOcoInit); /* Initialize OCO high channel */
|
||||||
|
TIMER4_OCO_Init(TIMER4_UNIT, enOcoLowCh, &stcOcoInit); /* Initialize OCO low channel */
|
||||||
|
|
||||||
|
if (!(TIMER4_OCO_HIGH_CH % 2))
|
||||||
|
{
|
||||||
|
/* ocmr[15:0] = 0x225F */
|
||||||
|
stcHighChCmpMode.enCntZeroNotMatchOpState = OcoOpOutputHold; ///< b15~b14
|
||||||
|
stcHighChCmpMode.enCntPeakNotMatchOpState = OcoOpOutputLow; ///< b13~b12
|
||||||
|
stcHighChCmpMode.enCntZeroMatchOpState = OcoOpOutputHold; ///< b11~b10
|
||||||
|
stcHighChCmpMode.enCntUpCntMatchOpState = OcoOpOutputLow; ///< b9~b8
|
||||||
|
stcHighChCmpMode.enCntPeakMatchOpState = OcoOpOutputHigh; ///< b7~b6
|
||||||
|
stcHighChCmpMode.enCntDownCntMatchOpState = OcoOpOutputHigh; ///< b5~b4
|
||||||
|
|
||||||
|
stcHighChCmpMode.enCntZeroMatchOcfState = OcoOcfSet; ///< b3
|
||||||
|
stcHighChCmpMode.enCntUpCntMatchOcfState = OcoOcfSet; ///< b2
|
||||||
|
stcHighChCmpMode.enCntPeakMatchOcfState = OcoOcfSet; ///< b1
|
||||||
|
stcHighChCmpMode.enCntDownCntMatchOcfState = OcoOcfSet; ///< b0
|
||||||
|
|
||||||
|
stcHighChCmpMode.enMatchConditionExtendCmd = Disable;
|
||||||
|
|
||||||
|
TIMER4_OCO_SetHighChCompareMode(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, &stcHighChCmpMode); /* Set OCO high channel compare mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************Timer4 OCO ocmr1[31:0] = 0x0FF0 0FFF*****************************/
|
||||||
|
if (enOcoLowCh % 2)
|
||||||
|
{
|
||||||
|
/* OCMR[31:0] Ox 2250 225F 0000 1111 1111 0000 0000 1111 1111 1111 */
|
||||||
|
stcLowChCmpMode.enCntZeroLowMatchHighMatchLowChOpState = OcoOpOutputHold; /* bit[27:26] 00 */
|
||||||
|
stcLowChCmpMode.enCntZeroLowMatchHighNotMatchLowChOpState = OcoOpOutputHold; /* bit[11:10] 00 */
|
||||||
|
stcLowChCmpMode.enCntZeroLowNotMatchHighMatchLowChOpState = OcoOpOutputHold; /* bit[31:30] 00 */
|
||||||
|
stcLowChCmpMode.enCntZeroLowNotMatchHighNotMatchLowChOpState = OcoOpOutputHold; /* bit[15:14] 00 */
|
||||||
|
|
||||||
|
stcLowChCmpMode.enCntUpCntLowMatchHighMatchLowChOpState = OcoOpOutputLow; /* bit[25:24] 10 */
|
||||||
|
stcLowChCmpMode.enCntUpCntLowMatchHighNotMatchLowChOpState = OcoOpOutputLow; /* bit[9:8] 10 */
|
||||||
|
stcLowChCmpMode.enCntUpCntLowNotMatchHighMatchLowChOpState = OcoOpOutputHold; /* bit[19:18] 00 */
|
||||||
|
|
||||||
|
stcLowChCmpMode.enCntPeakLowMatchHighMatchLowChOpState = OcoOpOutputHigh; /* bit[23:22] 01 */
|
||||||
|
stcLowChCmpMode.enCntPeakLowMatchHighNotMatchLowChOpState = OcoOpOutputHigh; /* bit[7:6] 01 */
|
||||||
|
stcLowChCmpMode.enCntPeakLowNotMatchHighMatchLowChOpState = OcoOpOutputLow; /* bit[29:28] 10 */
|
||||||
|
stcLowChCmpMode.enCntPeakLowNotMatchHighNotMatchLowChOpState = OcoOpOutputLow; /* bit[13:12] 10 */
|
||||||
|
|
||||||
|
stcLowChCmpMode.enCntDownLowMatchHighMatchLowChOpState = OcoOpOutputHigh; /* bit[21:20] 01 */
|
||||||
|
stcLowChCmpMode.enCntDownLowMatchHighNotMatchLowChOpState = OcoOpOutputHigh; /* bit[5:4] 01 */
|
||||||
|
stcLowChCmpMode.enCntDownLowNotMatchHighMatchLowChOpState = OcoOpOutputHold; /* bit[17:16] 00 */
|
||||||
|
|
||||||
|
stcLowChCmpMode.enCntZeroMatchOcfState = OcoOcfSet; /* bit[3] 1 */
|
||||||
|
stcLowChCmpMode.enCntUpCntMatchOcfState = OcoOcfSet; /* bit[2] 1 */
|
||||||
|
stcLowChCmpMode.enCntPeakMatchOcfState = OcoOcfSet; /* bit[1] 1 */
|
||||||
|
stcLowChCmpMode.enCntDownCntMatchOcfState = OcoOcfSet; /* bit[0] 1 */
|
||||||
|
|
||||||
|
TIMER4_OCO_SetLowChCompareMode(TIMER4_UNIT, enOcoLowCh, &stcLowChCmpMode); /* Set OCO low channel compare mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
// /* Set OCO compare value */
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, 0);
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, enOcoLowCh, 0);
|
||||||
|
|
||||||
|
/* Enable OCO */
|
||||||
|
|
||||||
|
TIMER4_OCO_OutputCompareCmd(TIMER4_UNIT, enOcoLowCh, Enable);
|
||||||
|
TIMER4_OCO_OutputCompareCmd(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, Enable);
|
||||||
|
|
||||||
|
/* Initialize PWM I/O */
|
||||||
|
PORT_SetFunc(TIMER4_PWM_H_PORT, TIMER4_PWM_H_PIN, Func_Tim4, Disable);
|
||||||
|
PORT_SetFunc(TIMER4_PWM_L_PORT, TIMER4_PWM_L_PIN, Func_Tim4, Disable);
|
||||||
|
|
||||||
|
/* Timer4 PWM: Initialize PWM configuration structure */
|
||||||
|
//重载定时器中断
|
||||||
|
stcPwmInit.enRtIntMaskCmd = Enable;
|
||||||
|
//计数时钟分频
|
||||||
|
stcPwmInit.enClkDiv = PwmPlckDiv1; /*滤波计数器和死区计数器的计数时钟分频*/
|
||||||
|
//PWM输出极性控制
|
||||||
|
stcPwmInit.enOutputState = PwmHPwmLReverse; /*输出PWMH信号不改变电平,输出PWML信号反转*/
|
||||||
|
//PWM输出模式
|
||||||
|
stcPwmInit.enMode = PwmThroughMode; /*直通模式*/
|
||||||
|
TIMER4_PWM_Init(TIMER4_UNIT, TIMER4_PWM_CH, &stcPwmInit); /* Initialize timer4 pwm */
|
||||||
|
|
||||||
|
/* Clear && Start CNT */
|
||||||
|
TIMER4_CNT_Start(TIMER4_UNIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void Timer61A_Init(void)
|
void Timer61A_Init(void)
|
||||||
{
|
{
|
||||||
@@ -691,10 +816,12 @@ void dcmotor_init(void)
|
|||||||
// PORT_SetBits(PortA, Pin03);
|
// PORT_SetBits(PortA, Pin03);
|
||||||
// /* SD拉低,关闭输出 */
|
// /* SD拉低,关闭输出 */
|
||||||
//
|
//
|
||||||
// dcmotor_stop(); /* 停止电机 */
|
Timer41_Init();
|
||||||
// dcmotor_dir(0); /* 设置正转 */
|
|
||||||
// dcmotor_speed(0); /* 速度设置为0 */
|
dcmotor_stop(); /* 停止电机 */
|
||||||
// dcmotor_start(); /* 开启电机 */
|
dcmotor_dir(0); /* 设置正转 */
|
||||||
|
dcmotor_speed(0); /* 速度设置为0 */
|
||||||
|
dcmotor_start(); /* 开启电机 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -719,7 +846,10 @@ void dcmotor_stop(void)
|
|||||||
#endif
|
#endif
|
||||||
#if(TIMER == TIMER4)
|
#if(TIMER == TIMER4)
|
||||||
|
|
||||||
TIMER4_CNT_Stop(TIMER4_UNIT);
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, 0);
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, enOcoLowCh, 0u);
|
||||||
|
DISABLE_MOTOR;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,17 +881,19 @@ void dcmotor_dir(uint8_t para)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if(TIMER == TIMER4)
|
#if(TIMER == TIMER4)
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, 0);
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, enOcoLowCh, 0u);
|
||||||
if (para == 0) /* 正转 */
|
if (para == 0) /* 正转 */
|
||||||
{
|
{
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, 0);
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, enOcoLowCh, 0u);
|
||||||
Timer41_Init(1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (para == 1) /* 反转 */
|
else if (para == 1) /* 反转 */
|
||||||
{
|
{
|
||||||
Timer41_Init(0);
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, 0);
|
||||||
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, enOcoLowCh, 0u);
|
||||||
}
|
}
|
||||||
|
dcmotor_start();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -782,8 +914,8 @@ void dcmotor_speed(uint16_t para)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if(TIMER == TIMER4)
|
#if(TIMER == TIMER4)
|
||||||
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, TIMER4_CNT_CYCLE_VAL - g_motorSpeed); //正转
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, g_motorSpeed); //正转
|
||||||
TIMER4_OCO_WriteOccr(TIMER4_UNIT, Timer4OcoOul, TIMER4_CNT_CYCLE_VAL - g_motorSpeed); //反转
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, enOcoLowCh, g_motorSpeed); //反转
|
||||||
#endif
|
#endif
|
||||||
dcmotor_stop();
|
dcmotor_stop();
|
||||||
return;
|
return;
|
||||||
@@ -797,10 +929,7 @@ void dcmotor_speed(uint16_t para)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if(TIMER == TIMER4)
|
#if(TIMER == TIMER4)
|
||||||
// TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, TIMER4_CNT_CYCLE_VAL - g_motorSpeed); //正转
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, enOcoLowCh, g_motorSpeed); //反转
|
||||||
// TIMER4_OCO_WriteOccr(TIMER4_UNIT, Timer4OcoOul, TIMER4_CNT_CYCLE_VAL - g_motorSpeed); //反转
|
|
||||||
TIMER4_OCO_WriteOccr(TIMER4_UNIT, Timer4OcoOul, g_motorSpeed); //反转
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DCMOTOR_DBG_LOG("REVERSE\tnewSpeed = %d\r\n", g_motorSpeed);
|
DCMOTOR_DBG_LOG("REVERSE\tnewSpeed = %d\r\n", g_motorSpeed);
|
||||||
@@ -814,7 +943,6 @@ void dcmotor_speed(uint16_t para)
|
|||||||
|
|
||||||
#if(TIMER == TIMER4)
|
#if(TIMER == TIMER4)
|
||||||
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, g_motorSpeed); //正转
|
TIMER4_OCO_WriteOccr(TIMER4_UNIT, TIMER4_OCO_HIGH_CH, g_motorSpeed); //正转
|
||||||
// TIMER4_OCO_WriteOccr(TIMER4_UNIT, Timer4OcoOul, TIMER4_CNT_CYCLE_VAL - g_motorSpeed); //反转
|
|
||||||
#endif
|
#endif
|
||||||
DCMOTOR_DBG_LOG("FORWARD\tnewSpeed = %d\r\n", g_motorSpeed);
|
DCMOTOR_DBG_LOG("FORWARD\tnewSpeed = %d\r\n", g_motorSpeed);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user