summaryrefslogtreecommitdiff
path: root/common/rawaccel-settings.h
blob: e9e158c63d9eb0e11ab422caf2a43f057cc91c3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include "vec2.h"
#include "accel-base.hpp"

namespace rawaccel {

    using milliseconds = double;

    inline constexpr int MAX_POLL_RATE_KHZ = 8;
    inline constexpr milliseconds DEFAULT_TIME_MIN = 1.0 / MAX_POLL_RATE_KHZ * 0.8;
    inline constexpr milliseconds WRITE_DELAY = 1000;

    enum class accel_mode {
        linear, classic, natural, naturalgain, power, motivity, noaccel
    };

    struct settings {
        double degrees_rotation = 0;
        bool combine_mags = true;
        vec2<accel_mode> modes = { accel_mode::noaccel, accel_mode::noaccel };
        vec2<accel_args> argsv;
        vec2d sens = { 1, 1 };
        milliseconds time_min = DEFAULT_TIME_MIN;
    };

}