shared intr ...bad
This commit is contained in:
parent
c59676e30c
commit
d12e534ff0
|
@ -105,8 +105,8 @@
|
|||
|
||||
|
||||
#define MajorVer 24U
|
||||
#define MinorVer 03U
|
||||
#define SubMinorVer 07U
|
||||
#define MinorVer 4U
|
||||
#define SubMinorVer 10U
|
||||
#define FirmwareVersion 3U
|
||||
#define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U
|
||||
#define YUNHORN_STS_AC_CODE_SIZE 20U
|
||||
|
|
|
@ -57,8 +57,7 @@ void MX_GPIO_Init(void)
|
|||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
//__HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
//__HAL_RCC_GPIOB_CLK_DISABLE();
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_DISABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
|
@ -109,7 +108,7 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(BUT1_GPIO_Port, &GPIO_InitStruct);
|
||||
#endif
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pins : TOF_C_INT_Pin */
|
||||
#if defined(TOF_1)
|
||||
GPIO_InitStruct.Pin = TOF_C_INT_Pin;
|
||||
|
@ -194,6 +193,9 @@ HAL_GPIO_Init(SOAP_SWITCH_GPIO_Port, &GPIO_InitStruct);
|
|||
/* ============== SOAP LEVEL DETECTION ========================= */
|
||||
#endif
|
||||
|
||||
__HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
__HAL_RCC_GPIOB_CLK_DISABLE();
|
||||
|
||||
#if 0
|
||||
/* EXTI interrupt init*/
|
||||
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
|
||||
|
|
|
@ -80,55 +80,26 @@ const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
|
|||
|
||||
void PWR_EnterOffMode(void)
|
||||
{
|
||||
#if 0
|
||||
//HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_RESET); /* LED OFF */
|
||||
HAL_SuspendTick();
|
||||
HAL_UART_DeInit(&huart2);
|
||||
//LL_PWR_ClearFlag_WU();
|
||||
//__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
|
||||
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
|
||||
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_LPMODES);
|
||||
//LL_PWR_ClearFlag_WU();
|
||||
HAL_PWR_EnterSTANDBYMode();
|
||||
#endif
|
||||
|
||||
POWER_OFF;
|
||||
//HAL_UART_DeInit(&huart2);
|
||||
//vcom_DeInit();
|
||||
|
||||
HAL_GPIO_DeInit(GPIOA,GPIO_PIN_All);
|
||||
HAL_GPIO_DeInit(GPIOB,GPIO_PIN_All);
|
||||
HAL_GPIO_DeInit(GPIOC,GPIO_PIN_All);
|
||||
HAL_SuspendTick();
|
||||
HAL_PWR_EnterSTANDBYMode();
|
||||
#if 0
|
||||
LED_OFF;
|
||||
HAL_UART_DeInit(&huart2);
|
||||
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);//禁用所有使用的唤醒源:PWR_WAKEUP_PIN1 connected to PA.00
|
||||
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);//清除所有相关的唤醒标志
|
||||
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);//启用连接到PA.00的WakeUp Pin
|
||||
HAL_PWR_EnterSTANDBYMode();//进入待机模式
|
||||
|
||||
/* USER CODE BEGIN EnterOffMode_1 */
|
||||
HAL_PWR_EnterSTANDBYMode();
|
||||
/* USER CODE END EnterOffMode_1 */
|
||||
#endif
|
||||
}
|
||||
|
||||
void PWR_ExitOffMode(void)
|
||||
{
|
||||
/* USER CODE BEGIN ExitOffMode_1 */
|
||||
#if 1
|
||||
POWER_ON;
|
||||
|
||||
HAL_ResumeTick();
|
||||
//__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
|
||||
//HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_SET); /* LED ON */
|
||||
return;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
|
||||
LED_ON;
|
||||
HAL_Delay(200);
|
||||
#endif
|
||||
/* USER CODE END ExitOffMode_1 */
|
||||
}
|
||||
|
||||
|
@ -163,7 +134,6 @@ void PWR_ExitStopMode(void)
|
|||
/* Resume sysTick : work around for debugger problem in dual core */
|
||||
|
||||
HAL_ResumeTick();
|
||||
POWER_ON;
|
||||
/*Not retained periph:
|
||||
ADC interface
|
||||
DAC interface USARTx, TIMx, i2Cx, SPIx
|
||||
|
|
|
@ -28,9 +28,7 @@
|
|||
|
||||
UART_HandleTypeDef huart2;
|
||||
DMA_HandleTypeDef hdma_usart2_tx;
|
||||
#if 0
|
||||
DMA_HandleTypeDef hdma_usart2_rx;
|
||||
#endif
|
||||
|
||||
/* USART2 init function */
|
||||
|
||||
void MX_USART2_UART_Init(void)
|
||||
|
@ -62,12 +60,7 @@ void MX_USART2_UART_Init(void)
|
|||
{
|
||||
Error_Handler();
|
||||
}
|
||||
#if 0
|
||||
if (HAL_UARTEx_SetRxFifoThreshold(&huart2, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (HAL_UARTEx_EnableFifoMode(&huart2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
|
|
|
@ -101,6 +101,7 @@ static void _I2cFailRecover(){
|
|||
}while(HAL_GPIO_ReadPin(I2C2_SDA_PORT, I2C2_SDA_PIN) == 0 && nRetry++<7);
|
||||
|
||||
if( HAL_GPIO_ReadPin(I2C2_SDA_PORT, I2C2_SDA_PIN) == 0 ){
|
||||
#if 0
|
||||
__GPIOA_CLK_ENABLE();
|
||||
//We are still in bad i2c state warm user by blinking led but stay here
|
||||
GPIO_InitStruct.Pin = LED1_Pin ;
|
||||
|
@ -117,6 +118,7 @@ static void _I2cFailRecover(){
|
|||
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);
|
||||
HAL_Delay(33*20);
|
||||
}while(1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@ extern void XNUCLEO53L1A1_USART2_UART_Init(void);
|
|||
#endif
|
||||
|
||||
/* ############ FOR SHARED GPIO1 INTR TO MCU ###### */
|
||||
#if 0
|
||||
#define VL53L0X_GPIO1_C_GPIO_PORT GPIOA
|
||||
#define VL53L0X_GPIO1_C_CLK_ENABLE __GPIOA_CLK_ENABLE
|
||||
#define VL53L0X_GPIO1_C_GPIO_PIN GPIO_PIN_10
|
||||
|
@ -150,6 +151,22 @@ extern void XNUCLEO53L1A1_USART2_UART_Init(void);
|
|||
#define VL53L0X_GPIO1_R_CLK_ENABLE __GPIOA_CLK_ENABLE
|
||||
#define VL53L0X_GPIO1_R_GPIO_PIN GPIO_PIN_10
|
||||
#define VL53L0X_GPIO1_R_INTx EXTI15_10_IRQn
|
||||
#endif
|
||||
#define VL53L0X_GPIO1_C_GPIO_PORT GPIOB
|
||||
#define VL53L0X_GPIO1_C_CLK_ENABLE __GPIOB_CLK_ENABLE
|
||||
#define VL53L0X_GPIO1_C_GPIO_PIN GPIO_PIN_3
|
||||
#define VL53L0X_GPIO1_C_INTx EXTI3_IRQn
|
||||
|
||||
#define VL53L0X_GPIO1_L_GPIO_PORT GPIOB
|
||||
#define VL53L0X_GPIO1_L_CLK_ENABLE __GPIOB_CLK_ENABLE
|
||||
#define VL53L0X_GPIO1_L_GPIO_PIN GPIO_PIN_3
|
||||
#define VL53L0X_GPIO1_L_INTx EXTI3_IRQn
|
||||
|
||||
#define VL53L0X_GPIO1_R_GPIO_PORT GPIOB
|
||||
#define VL53L0X_GPIO1_R_CLK_ENABLE __GPIOB_CLK_ENABLE
|
||||
#define VL53L0X_GPIO1_R_GPIO_PIN GPIO_PIN_3
|
||||
#define VL53L0X_GPIO1_R_INTx EXTI3_IRQn
|
||||
|
||||
/* ############ FOR SHARED GPIO1 INTR TO MCU ###### */
|
||||
|
||||
/** @} */ /* defgroup L53L1A1_GPIO1_MAP */
|
||||
|
|
Loading…
Reference in New Issue