AnasSarkiz/pedometer
A four-layer Bluetooth pedometer PCB built around a bare TI CC2340R5 MCU, 48 MHz/32.768 kHz clocks, 2.4 GHz antenna matching network, battery charger/fuel gauge, accelerometer, regulator, USB‑C, OLED/SWD connectors, and supporting passives/protection.
- Version
- 1.1.3
- License
- unset
- Stars
- 0
firmware/app.h
#ifndef STRIDE_APP_H
#define STRIDE_APP_H
#include "pedometer.h"
typedef struct {
struct bma400_dev sensor;
StepAccumulator steps;
uint64_t next_sample, display_until, last_checkpoint, last_sample;
uint16_t millivolts, soc;
uint8_t flags;
bool display_on, gauge_configured;
} StrideApp;
/* All calls run on one application task, never in GPIO/BLE interrupt callbacks. */
bool stride_init(StrideApp *app,uint64_t restored_total,bool wrist);
void stride_tick(StrideApp *app,bool button_pressed);
uint64_t stride_deadline(const StrideApp *app);
/* Implement using the SDK GATT server and two-slot CRC-protected NVS journal.
* publish must copy its 14-byte argument before returning. */
void app_ble_publish(const uint8_t snapshot[14]);
bool app_checkpoint(uint64_t total);
#endif