P2x #74

Merged
sundp merged 36 commits from P2x into P2 2025-01-09 16:35:57 +08:00
2 changed files with 14 additions and 6 deletions
Showing only changes of commit 5c2b059eab - Show all commits

View File

@ -141,20 +141,28 @@ static void _I2cFailRecover(){
if( HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_11) == 0 ){
__GPIOB_CLK_ENABLE();
//We are still in bad i2c state warm user by blinking led but stay here
/*
GPIO_InitStruct.Pin = LED1_Pin ;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(LED3_GPIO_Port, &GPIO_InitStruct);
*/
nRetry = 0;
do{
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
// HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
LED_RED_ON;
HAL_Delay(33);
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
// HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
LED_RED_OFF;
HAL_Delay(33);
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
// HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
LED_RED_ON;
HAL_Delay(33);
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
HAL_Delay(33*20);
}while(1);
// HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
LED_RED_OFF;
HAL_Delay(33*4);
nRetry++;
}while(nRetry < 3);
}
}