volatile uint8_t motion_pending = 0; //Generic motion indicator field for low-power waker callback //... void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if (GPIO_Pin == MPU_INT_Pin) { //PB0 motion_pending = 1; //Set motion indicator } } //....