for debug
This commit is contained in:
parent
228caa620f
commit
4a220ec7cc
|
@ -177,14 +177,24 @@ void Error_Handler(void);
|
|||
#define A111_ENABLE_Pin GPIO_PIN_5
|
||||
#define A111_ENABLE_GPIO_Port GPIOB
|
||||
#endif
|
||||
#ifdef YUNHORN_STS_WLE5CCxx
|
||||
|
||||
#if defined(YUNHORN_STS_WLE5CCxx) && defined(RM2)
|
||||
#define A111_SENSOR_INTERRUPT_Pin GPIO_PIN_5
|
||||
#define A111_SENSOR_INTERRUPT_GPIO_Port GPIOB
|
||||
#define A111_SENSOR_INTERRUPT_EXTI_IRQn EXTI9_5_IRQn
|
||||
#define A111_ENABLE_Pin GPIO_PIN_3
|
||||
#define A111_ENABLE_GPIO_Port GPIOB
|
||||
#endif
|
||||
|
||||
#if defined(YUNHORN_STS_WLE5CCxx) && defined(RM2_1)
|
||||
#define A111_SENSOR_INTERRUPT_Pin GPIO_PIN_3 // SWITCH TO PB-3, 2024-05-06
|
||||
#define A111_SENSOR_INTERRUPT_GPIO_Port GPIOB
|
||||
#define A111_SENSOR_INTERRUPT_EXTI_IRQn EXTI3_IRQn // SWITCH TO PB-3, 2024-05-06
|
||||
#define A111_ENABLE_Pin GPIO_PIN_5 // SWITCH TO PB-5, 2024-05-06
|
||||
#define A111_ENABLE_GPIO_Port GPIOB
|
||||
#define A111_ENABLE_Pin GPIO_PIN_5 // SWITCH TO PB-5, 2024-05-06
|
||||
#define A111_ENABLE_GPIO_Port GPIOB
|
||||
#endif
|
||||
|
||||
|
||||
#define A111_SPI_HANDLE hspi1
|
||||
#ifndef A111_USE_SPI_DMA
|
||||
#define A111_USE_SPI_DMA
|
||||
|
|
|
@ -47,7 +47,7 @@ extern "C" {
|
|||
/**
|
||||
* @brief Verbose level for all trace logs
|
||||
*/
|
||||
#define VERBOSE_LEVEL VLEVEL_L
|
||||
#define VERBOSE_LEVEL VLEVEL_H
|
||||
|
||||
/**
|
||||
* @brief Enable trace logs
|
||||
|
|
|
@ -61,6 +61,12 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = MEMS_POWER_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(MEMS_POWER_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PtPin */
|
||||
GPIO_InitStruct.Pin = A111_ENABLE_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
|
@ -78,6 +84,7 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Pin = A111_SENSOR_INTERRUPT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
HAL_GPIO_Init(A111_SENSOR_INTERRUPT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
#ifdef STS_O7
|
||||
|
@ -112,6 +119,10 @@ void MX_GPIO_Init(void)
|
|||
|
||||
HAL_NVIC_SetPriority(HALL2_EXTI_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(HALL2_EXTI_IRQn);
|
||||
|
||||
HAL_NVIC_SetPriority(A111_SENSOR_INTERRUPT_EXTI_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(A111_SENSOR_INTERRUPT_EXTI_IRQn);
|
||||
|
||||
#else
|
||||
/* EXTI interrupt init*/
|
||||
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
|
||||
|
@ -123,6 +134,9 @@ void MX_GPIO_Init(void)
|
|||
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
||||
|
||||
HAL_NVIC_SetPriority(EXTI3_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
|
|
@ -361,7 +361,7 @@ void EXTI9_5_IRQHandler(void)
|
|||
/* USER CODE END EXTI9_5_IRQn 0 */
|
||||
//HAL_GPIO_EXTI_IRQHandler(BUT3_Pin);
|
||||
/* USER CODE BEGIN EXTI9_5_IRQn 1 */
|
||||
//HAL_GPIO_EXTI_IRQHandler(A111_SENSOR_INTERRUPT_Pin);
|
||||
HAL_GPIO_EXTI_IRQHandler(A111_SENSOR_INTERRUPT_Pin);
|
||||
/* USER CODE END EXTI9_5_IRQn 1 */
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,8 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
acc_rss_assembly_test_configuration_communication_write_read_test_disable(configuration);
|
||||
|
||||
// Enable and run: Interrupt Test
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Interrupt Test --- Start ********************\r\n");
|
||||
|
||||
acc_rss_assembly_test_configuration_communication_interrupt_test_enable(configuration);
|
||||
if (!run_test(configuration))
|
||||
{
|
||||
|
@ -102,10 +104,12 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
|
||||
test_result[t++] = 1;
|
||||
}
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Interrupt Test --- End ********************\r\n");
|
||||
|
||||
acc_rss_assembly_test_configuration_communication_interrupt_test_disable(configuration);
|
||||
|
||||
// Enable and run: Hibernate Test
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Hibernate Test --- Start ********************\r\n");
|
||||
acc_rss_assembly_test_configuration_communication_hibernate_test_enable(configuration);
|
||||
if (!run_test(configuration))
|
||||
{
|
||||
|
@ -118,9 +122,12 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
test_result[t++] = 1;
|
||||
}
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Hibernate Test --- End ********************\r\n");
|
||||
|
||||
acc_rss_assembly_test_configuration_communication_hibernate_test_disable(configuration);
|
||||
|
||||
// Enable and run: Supply Test
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Supply Test --- Start ********************\r\n");
|
||||
acc_rss_assembly_test_configuration_supply_test_enable(configuration);
|
||||
if (!run_test(configuration))
|
||||
{
|
||||
|
@ -133,9 +140,12 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
test_result[t++] = 1;
|
||||
}
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Supply Test --- End ********************\r\n");
|
||||
|
||||
acc_rss_assembly_test_configuration_supply_test_disable(configuration);
|
||||
|
||||
// Enable and run: Clock Test
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- Start ********************\r\n");
|
||||
acc_rss_assembly_test_configuration_clock_test_enable(configuration);
|
||||
if (!run_test(configuration))
|
||||
{
|
||||
|
@ -147,10 +157,12 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
|
||||
test_result[t++] = 1;
|
||||
}
|
||||
|
||||
//APP_LOG(TS_OFF, VLEVEL_H,"-- test step: [%d] --result=%d \n", t-1, test_result[t-1]);
|
||||
acc_rss_assembly_test_configuration_clock_test_disable(configuration);
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- end ********************\r\n");
|
||||
|
||||
// Enable and run: Power cycle test
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Power cycle test --- Start ********************\r\n");
|
||||
acc_rss_assembly_test_configuration_power_cycle_test_enable(configuration);
|
||||
if (!run_test(configuration))
|
||||
{
|
||||
|
@ -165,6 +177,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
|
||||
|
||||
acc_rss_assembly_test_configuration_power_cycle_test_disable(configuration);
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- Power cycle test --- end ********************\r\n");
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- 10 -- Bring up test: All tests passed\n");
|
||||
test_result[t++] = 1; //(10)
|
||||
|
|
|
@ -542,12 +542,9 @@ void STS_SENSOR_Power_ON(uint8_t cnt)
|
|||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
#ifdef YUNHORN_STS_M7_ENABLED
|
||||
HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_SET);
|
||||
#endif
|
||||
#ifdef YUNHORN_STS_O7_ENABLED
|
||||
PME_ON;
|
||||
#endif
|
||||
|
||||
PME_ON;
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -560,12 +557,9 @@ void STS_SENSOR_Power_OFF(uint8_t cnt)
|
|||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
#ifdef YUNHORN_STS_M7_ENABLED
|
||||
HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_RESET);
|
||||
#endif
|
||||
#ifdef YUNHORN_STS_O7_ENABLED
|
||||
PME_OFF;
|
||||
#endif
|
||||
|
||||
PME_OFF;
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -578,12 +572,9 @@ void STS_SENSOR_MEMS_Reset(uint8_t cnt)
|
|||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
#ifdef YUNHORN_STS_M7_ENABLED
|
||||
HAL_GPIO_WritePin(MEMS_RESET_GPIO_Port, MEMS_RESET_Pin, GPIO_PIN_SET);
|
||||
#endif
|
||||
#ifdef YUNHORN_STS_O7_ENABLED
|
||||
|
||||
HAL_GPIO_TogglePin(MEMS_RESET_GPIO_Port, MEMS_RESET_Pin);
|
||||
#endif
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -2271,7 +2271,7 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
if ((sts_version == sts_cfg_nvm.version)&& (NVM_CFG_PARAMETER_SIZE == sts_cfg_nvm.length))
|
||||
{
|
||||
STS_PRESENCE_SENSOR_Init();
|
||||
STS_PRESENCE_SENSOR_RSS_Init();
|
||||
//STS_PRESENCE_SENSOR_RSS_Init();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@
|
|||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1119592399" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.2024044405" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="CORE_CM4"/>
|
||||
<listOptionValue builtIn="false" value="RM2_1"/>
|
||||
<listOptionValue builtIn="false" value="LOG_RSS"/>
|
||||
<listOptionValue builtIn="false" value="STS_O7"/>
|
||||
<listOptionValue builtIn="false" value="YUNHORN_STS_RANDOM"/>
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue