-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathconstants.h
More file actions
112 lines (86 loc) · 2.32 KB
/
constants.h
File metadata and controls
112 lines (86 loc) · 2.32 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef __CONSTANTS_H
#define __CONSTANTS_H
//#include "main.h"
#include "target_constants.h" // To be defined in target include folder
/*
* For more settings see target_constants.h in a target specific folder
*/
static const uint8_t SW_VERSION_INT[3] = {1,16,5}; // Version as array. 8 bit each!
#ifndef MAX_AXIS
#define MAX_AXIS 2 // ONLY USE 2 for now else screws HID Reports
#endif
#if !(MAX_AXIS > 0 && MAX_AXIS <= 3)
#error "MAX_AXIS must be between 1 and 3"
#endif
#define FLASH_VERSION 0 // Counter to increase whenever a full flash erase is required.
//#define DEBUGLOG // Uncomment to enable some debug printouts
#ifndef CANBUS
#undef ODRIVE
#undef CANBUTTONS
#undef VESC
#undef CANBRIDGE
#undef CANINPUTMAIN
#endif
#ifdef FFBWHEEL
#ifdef FFBWHEEL_USE_1AXIS_DESC
#define AXIS1_FFB_HID_DESC
#else
#define AXIS2_FFB_HID_DESC
#endif
#endif
#ifdef FFBJOYSTICK
#define AXIS2_FFB_HID_DESC
#endif
#ifndef HSPIDRV
#undef TMC4671DRIVER
#endif
#ifdef FFBHIDEXT
#define FFB_HID_DESC_GAMEPAD
#endif
#ifndef ENCODER_SPI_PORT
#define ENCODER_SPI_PORT ext3_spi // See cpp_target_config.cpp for ports
#endif
#ifdef SIMPLEMOTION
#define GPIO_MOTOR // See cpp_target_config.cpp for pin
#endif
#if defined(I2C_PORT_EEPROM) && defined(I2C_EEPROM_ADR)
#define USE_I2C_EEPROM
#else
#if defined(EEPROM_START_ADDRESS)
#define USE_EEPROM_EMULATION
#endif
#endif
#if defined(PCF8574BUTTONS) || defined(I2C_PORT)
#define I2CBUS
#endif
#ifndef TEMPSENSOR_ADC_RES
#define TEMPSENSOR_ADC_RES 0
#endif
// Assume vref is calibrated in full resolution. Check chip and __LL_ADC_CALC_VREFANALOG_VOLTAGE how to scale
#ifndef VREF_ADC_RES
#define VREF_ADC_RES 0
#endif
#ifndef VSENSE_ADC_RES
#define VSENSE_ADC_RES 0
#endif
#ifndef ADC_INTREF_VOL
#ifndef ADC_INTREF_VAL
#define ADC_INTREF_VOL 3300
#else
#define ADC_INTREF_VOL ((ADC_INTREF_VAL > 0) ? __LL_ADC_CALC_VREFANALOG_VOLTAGE(ADC_INTREF_VAL,VREF_ADC_RES) : 0)
#endif
#endif
#ifndef VOLTAGE_MULT_DEFAULT
#define VOLTAGE_MULT_DEFAULT 30.67 // mV adc * scaler = voltage for 976k/33k divider and 3.3V vref
#endif
#if defined(TIM_MICROS_HALTICK) && defined(TIM_MICROS)
#error "Only TIM_MICROS_HALTICK OR TIM_MICROS may be defined as a microsecond timebase"
#endif
#ifndef SIGNATURELEN
#define SIGNATURELEN 8
#define SIGNATURE
#endif
#if defined(FLASH_OTP_BASE) && defined(FLASH_OTP_END)
#define OTPMEMORY
#endif
#endif