#ifndef DRILL_TIMING_H
#define DRILL_TIMING_H
#include <stdbool.h>
#include <stdint.h>
typedef enum {DT_NONE,DT_CLOCK,DT_COUNTER,DT_LIMIT,DT_SEQUENCE} dt_fault;
/* 64-byte SWD record. Reader must bracket it AND the stream snapshot with two
 * equal even epochs and reject fault/absent completed-window validity. */
typedef struct {uint32_t magic,version,epoch,windows,active_windows,last_cycles,max_cycles,last_us,max_us,last_gap_us,max_gap_us,fault,core_hz,limit_cycles,limit_us,flags;} dt_record;
extern volatile dt_record drill_debug_timing;
bool drill_timing_init(void);
bool drill_timing_begin(uint32_t *now);
bool drill_timing_end(bool idle);
#endif
