谁能帮忙解释一下,我调用
time_Auto_Decrement()函数来是LED_Delay_Time变量的值递减,为什么,值却不变
/****main.c*****/
int main(void)
{
uint32_t LED_Delay_Time = 500;
HAL_Init();
BSP_LED_Init(LED2);
/* Configure the system clock to 64 MHz */
SystemClock_Config();
while (1)
{
if(Time_Auto_Decrement( LED_Delay_Time))
{
BSP_LED_Toggle(LED2);
LED_Delay_Time = 500;
}
}
}
/*****time.c****/
uint8_t Time_Auto_Decrement(uint32_t * delay)
{
uint8_t temp;
if(*delay != 0)
{
*delay --;
if(*delay <= 0)
{
temp = 1;
*delay = 0;
}
else
{
temp = 0;
}
}
return temp;
}