cancel
Showing results for 
Search instead for 
Did you mean: 

STEVAL-MKI231KA (STHS34PF80) wakeup

PCabr.1
Associate II

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
PCabr.1
Associate II

Hello all, sorry about the question, i just put TIM3 as overflow interrupt to toggle this variable and everything worked.

BR

Paulo

View solution in original post

1 REPLY 1
PCabr.1
Associate II

Hello all, sorry about the question, i just put TIM3 as overflow interrupt to toggle this variable and everything worked.

BR

Paulo