-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathconfig_check.h
57 lines (49 loc) · 1.72 KB
/
config_check.h
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
// Configuration checks Arduino core, esp-idf, USB menu options
// check Arduino core version
#if !defined ESP_ARDUINO_VERSION_VAL
#error "Invalid esp32-core version (expected: 2.0.0)"
#else
#if defined ESP_ARDUINO_VERSION && ESP_ARDUINO_VERSION == ESP_ARDUINO_VERSION_VAL(2, 0, 0)
// fine, that's our target esp32 core
#else
#error "Invalid esp32-core version (expected: 2.0.0)"
#endif
#endif
// check esp-idf version
#if !defined ESP_IDF_VERSION_VAL
#error "Invalid esp-idf version (expected: 4.4.0)"
#else
#if defined ESP_IDF_VERSION && ESP_IDF_VERSION == ESP_IDF_VERSION_VAL(4, 4, 0)
// fine, that's our target for esp-idf core
#else
#error "Invalid esp-idf version (expected: 4.4.0)"
#endif
#endif
// check target config for device
#if !defined CONFIG_IDF_TARGET_ESP32S2
#error "This project is for ESP32-S2 only!"
#endif
// check config for USB
#if !defined CONFIG_TINYUSB_ENABLED
#error "This project needs CONFIG_TINYUSB_ENABLED in sdkconfig"
#endif
// check that required Arduino menu options are present
#if !defined ARDUINO_USB_CDC_ON_BOOT
#error "ARDUINO_USB_CDC_ON_BOOT build option is missing"
#endif
#if !defined ARDUINO_USB_MSC_ON_BOOT
#error "ARDUINO_USB_MSC_ON_BOOT build option is missing"
#endif
#if !defined ARDUINO_USB_DFU_ON_BOOT
#error "ARDUINO_USB_DFU_ON_BOOT build option is missing"
#endif
// check that required Arduino menu options are well set
#if ARDUINO_USB_CDC_ON_BOOT!=0
#error "The menu option 'Tools / USB CDC On Boot' should be disabled!"
#endif
#if ARDUINO_USB_MSC_ON_BOOT!=0
#error "The menu option 'Tools / USB Firmware MSC On Boot' should be disabled!"
#endif
#if ARDUINO_USB_DFU_ON_BOOT!=0
#error "The menu option 'Tools / USB DFU On Boot' should be disabled!"
#endif