2024-07-22 07:54 AM - last edited on 2024-07-31 05:51 AM by Peter BENSCH
Hello I I'm using the -> GitHub - STMicroelectronics/STMems_Standard_C_drivers, for presence and motion detect with a NUCLEO-F401RE directly connected with STEVAL-MKI231KA, i can read the sensor ID and setup the other paramethers, but my question is related to wakeup_thread, i to setup an external interrupt connected to INT1 from the board sensor to toogle this variable? without this i think that i will not start to read the sensor properly.
the example is: https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/sths34pf80_STdC/examples/sths34pf80_tmos_presence_detection.c
/* handle event in a "thread" alike code */
if (wakeup_thread) {
wakeup_thread = 0;
motion = 0;
presence = 0;
do {
sths34pf80_func_status_get(&dev_ctx, &func_status);
if (func_status.pres_flag != presence)
{
presence = func_status.pres_flag;
if (presence) {
sprintf((char *)tx_buffer, "Start of Presence\r\n");
tx_com(tx_buffer, strlen((char const *)tx_buffer));
} else {
sprintf((char *)tx_buffer, "End of Presence\r\n");
tx_com(tx_buffer, strlen((char const *)tx_buffer));
}
}
if (func_status.mot_flag != motion)
{
motion = func_status.mot_flag;
if (motion) {
sprintf((char *)tx_buffer, "Motion Detected!\r\n");
tx_com(tx_buffer, strlen((char const *)tx_buffer));
}
}
} while (func_status.pres_flag);
}
BR
Paulo
Solved! Go to Solution.
2024-07-23 05:52 AM
Hello all, sorry about the question, i just put TIM3 as overflow interrupt to toggle this variable and everything worked.
BR
Paulo
2024-07-23 05:52 AM
Hello all, sorry about the question, i just put TIM3 as overflow interrupt to toggle this variable and everything worked.
BR
Paulo