old pixel rm2

This commit is contained in:
Yunhorn 2025-04-24 20:21:27 +08:00
parent a18a4ed4b7
commit a19ca44bf0
6 changed files with 39 additions and 37 deletions

View File

@ -50,12 +50,12 @@ extern "C" {
* #define VLEVEL_M 2 functional traces
* #define VLEVEL_H 3 all traces
*/
#define VERBOSE_LEVEL VLEVEL_OFF
#define VERBOSE_LEVEL VLEVEL_M
/**
* @brief Enable trace logs
*/
#define APP_LOG_ENABLED 0
#define APP_LOG_ENABLED 1
/**
* @brief Activate monitoring (probes) of some internal RF signals for debug purpose
@ -78,7 +78,7 @@ extern "C" {
* @brief Enable/Disable MCU Debugger pins (dbg serial wires)
* @note by HW serial wires are ON by default, need to put them OFF to save power
*/
#define DEBUGGER_ENABLED 0
#define DEBUGGER_ENABLED 1
/**
* @brief Disable Low Power mode

View File

@ -67,7 +67,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 0; //(3)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
}
@ -81,7 +81,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 0; //(4)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
}
@ -97,7 +97,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 0; //(5)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
@ -111,10 +111,10 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
acc_rss_assembly_test_configuration_clock_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; // (8)
test_result[t++] = 0; // (6)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
@ -129,10 +129,10 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
acc_rss_assembly_test_configuration_power_cycle_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; //(9)
test_result[t++] = 0; //(7)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
@ -147,10 +147,10 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
acc_rss_assembly_test_configuration_communication_hibernate_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; //(6)
test_result[t++] = 0; //(8)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
@ -164,10 +164,10 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
acc_rss_assembly_test_configuration_supply_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; //(7)
test_result[t++] = 0; //(9)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
@ -181,10 +181,10 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
acc_rss_assembly_test_configuration_clock_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; // (8)
test_result[t++] = 0; // (10)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
@ -198,10 +198,10 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
acc_rss_assembly_test_configuration_power_cycle_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; //(9)
test_result[t++] = 0; //(11)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
return EXIT_FAILURE;
} else {
test_result[t++] = 1;
@ -212,7 +212,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
// APP_LOG(TS_OFF, VLEVEL_L,"-- 10 -- Bring up test: All tests passed\n");
test_result[t++] = 1; //(10)
test_result[t++] = 1; //(12)
memcpy(rss_self_test_result, test_result, 12);
// APP_LOG(TS_OFF, VLEVEL_L,"--Bring up test result #=%d \r\n", t);

View File

@ -1097,7 +1097,7 @@ void STS_PRESENCE_SENSOR_Background_Measure_Process(uint16_t *bg_distance, uint1
void STS_PRESENCE_SENSOR_Function_Test_Process(uint8_t *self_test_result, uint8_t count)
{
uint8_t bring_up_result[16];
uint8_t bring_up_result[18]={0};
uint8_t previous_lamp_bar_color=sts_lamp_bar_color;
uint16_t bg_range=0, bg_noise=0;
PME_ON;
@ -1112,22 +1112,24 @@ void STS_PRESENCE_SENSOR_Function_Test_Process(uint8_t *self_test_result, uint8_
STS_Lamp_Bar_Refresh();
HAL_Delay(200);
sts_lamp_bar_color = STS_PINK;
sts_presence_rss_bring_up_test(bring_up_result);
int bur = sts_presence_rss_bring_up_test(bring_up_result);
HAL_Delay(200);
sts_lamp_bar_color = STS_CYAN;
STS_PRESENCE_SENSOR_Distance_Measure_Process();
bring_up_result[10]=sts_sensor_install_height>>8&0xff;
bring_up_result[11]=sts_sensor_install_height&0xff;
if (bur == EXIT_SUCCESS)
{
HAL_Delay(200);
sts_lamp_bar_color = STS_CYAN;
STS_PRESENCE_SENSOR_Distance_Measure_Process();
bring_up_result[12]=sts_sensor_install_height>>8&0xff;
bring_up_result[13]=sts_sensor_install_height&0xff;
HAL_Delay(200);
STS_PRESENCE_SENSOR_Background_Measure_Process(&bg_range, &bg_noise);
bring_up_result[12]=bg_range>>8&0xff;
bring_up_result[13]=bg_range&0xff;
bring_up_result[14]=bg_noise>>8&0xff;
bring_up_result[15]=bg_noise&0xff;
HAL_Delay(200);
STS_PRESENCE_SENSOR_Background_Measure_Process(&bg_range, &bg_noise);
bring_up_result[14]=bg_range>>8&0xff;
bring_up_result[15]=bg_range&0xff;
bring_up_result[16]=bg_noise>>8&0xff;
bring_up_result[17]=bg_noise&0xff;
}
}
HAL_Delay(200);

View File

@ -3146,13 +3146,13 @@ void STS_SENSOR_Function_Test_Process(void)
}
else
{
tstbuf[i++] = (uint8_t)16; //length of following data 16 bytes
tstbuf[i++] = (uint8_t)18; //length of following data 16 bytes
#if defined(STS_O7)||defined(STS_O6)
uint8_t self_test_result[16]={0x0};
uint8_t self_test_result[18]={0x0};
STS_PRESENCE_SENSOR_Function_Test_Process(self_test_result, count);
for (uint8_t j=0; j < 16; j++)
for (uint8_t j=0; j < 18; j++)
tstbuf[i++] = (uint8_t) (self_test_result[j])&0xff;
//STS_PRESENCE_SENSOR_Distance_Measure_Process();

View File

@ -155,7 +155,7 @@
<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="CLOCK_SYNC"/>
<listOptionValue builtIn="false" value="RM2_1"/>
<listOptionValue builtIn="false" value="RM2"/>
<listOptionValue builtIn="false" value="STS_O6"/>
<listOptionValue builtIn="false" value="YUNHORN_STS_RANDOM"/>
<listOptionValue builtIn="false" value="STM32WLE5xx"/>

Binary file not shown.