/*
 * step_detection.h
 *
 *  Created on: May 20, 2025
 *      Author: 911BL
 */

#ifndef INC_MIDDLEWARE_STEP_DETECTION_H_
#define INC_MIDDLEWARE_STEP_DETECTION_H_

#include <stdint.h>

//#define UPPER_THRESHOLD 300UL
//#define LOWER_THRESHOLD 260UL
#define UPPER_THRESHOLD 300 //300
#define LOWER_THRESHOLD 260 //260

// Step state enum
typedef enum {
    WAITING_FOR_PEAK,
    WAITING_FOR_VALLEY
} StepState;

// Global state variable
extern StepState step_state;

// Function declarations
uint32_t imu_magnitude(int16_t x, int16_t y, int16_t z);
void process_step(uint32_t acc_mag_squared);


#endif /* INC_MIDDLEWARE_STEP_DETECTION_H_ */
