|
| 1 | +/* |
| 2 | + * This file is part of DeskHop (https://github.com/hrvach/deskhop). |
| 3 | + * Copyright (c) 2025 Hrvoje Cavrak |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, version 3. |
| 8 | + * |
| 9 | + * See the file LICENSE for the full license text. |
| 10 | + */ |
| 11 | +#pragma once |
| 12 | +#include <stdint.h> |
| 13 | + |
| 14 | +/*============================================================================== |
| 15 | + * Board and Output Roles |
| 16 | + *==============================================================================*/ |
| 17 | + |
| 18 | +#define OUTPUT_A 0 |
| 19 | +#define OUTPUT_B 1 |
| 20 | + |
| 21 | +/*============================================================================== |
| 22 | + * HID Interface Numbers |
| 23 | + *==============================================================================*/ |
| 24 | + |
| 25 | +#define ITF_NUM_HID 0 |
| 26 | +#define ITF_NUM_HID_REL_M 1 |
| 27 | +#define ITF_NUM_HID_VENDOR 1 |
| 28 | +#define ITF_NUM_MSC 2 |
| 29 | + |
| 30 | +/*============================================================================== |
| 31 | + * Mouse Modes |
| 32 | + *==============================================================================*/ |
| 33 | + |
| 34 | +#define ABSOLUTE 0 |
| 35 | +#define RELATIVE 1 |
| 36 | +#define TOUCH 2 |
| 37 | + |
| 38 | +/*============================================================================== |
| 39 | + * Boolean States |
| 40 | + *==============================================================================*/ |
| 41 | + |
| 42 | +#define ENABLE 1 |
| 43 | +#define DISABLE 0 |
| 44 | + |
| 45 | +/*============================================================================== |
| 46 | + * Numerical Constants |
| 47 | + *==============================================================================*/ |
| 48 | + |
| 49 | +#define CONFIG_MODE_TIMEOUT 300000000 // 5 minutes into the future |
| 50 | +#define JITTER_DISTANCE 2 |
| 51 | +#define MOUSE_BOOT_REPORT_LEN 4 |
| 52 | +#define MOUSE_ZOOM_SCALING_FACTOR 2 |
| 53 | +#define NUM_SCREENS 2 |
| 54 | + |
| 55 | +/*============================================================================== |
| 56 | + * Utility Macros |
| 57 | + *==============================================================================*/ |
| 58 | + |
| 59 | +#define _HZ(x) ((uint64_t)((1000000) / (x))) |
| 60 | +#define _MS(x) (x * 1000) |
| 61 | +#define _SEC(x) (x * 1000000) |
| 62 | +#define _TOP() 0 |
| 63 | +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) |
| 64 | +#define CURRENT_BOARD_IS_ACTIVE_OUTPUT (global_state.active_output == global_state.board_role) |
0 commit comments