-
-
Notifications
You must be signed in to change notification settings - Fork 445
/
Copy pathValidate.h
678 lines (646 loc) · 22 KB
/
Validate.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
// Check selected board type
#if defined (STM32_BOARD) && defined (ORANGE_TX)
#error You must comment the board type STM32_BOARD in _Config.h to compile ORANGE_TX
#endif
#if not defined (ORANGE_TX) && not defined (STM32_BOARD)
//Atmega328p
#if not defined(ARDUINO_AVR_PRO) && not defined(ARDUINO_MULTI_NO_BOOT) && not defined(ARDUINO_MULTI_FLASH_FROM_TX) && not defined(ARDUINO_AVR_MINI) && not defined(ARDUINO_AVR_NANO) && not defined(ARDUINO_AVR_DUEMILANOVE)
#error You must select one of these boards: "Multi 4-in-1", "Arduino Pro or Pro Mini" or "Arduino Mini"
#endif
#if F_CPU != 16000000L || not (defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__))
#error You must select the processor type "ATmega328(5V, 16MHz)"
#endif
#endif
#if defined (STM32_BOARD) && not defined (ORANGE_TX)
//STM32
#if not defined(ARDUINO_GENERIC_STM32F103C) && not defined(ARDUINO_MULTI_STM32_FLASH_FROM_TX) && not defined(ARDUINO_MULTI_STM32_NO_BOOT) && not defined(ARDUINO_MULTI_STM32_WITH_BOOT)
#error You must select one of these boards: "Multi 4-in-1 (STM32F103CB)" or "Generic STM32F103C series"
#endif
#endif
// Check for minimum board file definition version for DIY multi-module boards
#define MIN_AVR_BOARD 110
#define MIN_ORX_BOARD 110
#define MIN_STM32_BOARD 117
//AVR
#if (defined(ARDUINO_MULTI_NO_BOOT) && ARDUINO_MULTI_NO_BOOT < MIN_AVR_BOARD) || (defined(ARDUINO_MULTI_FLASH_FROM_TX) && ARDUINO_MULTI_FLASH_FROM_TX < MIN_AVR_BOARD)
#error You need to update your Multi 4-in-1 board definition. Open Boards Manager and update to the latest version of the Multi 4-in-1 AVR Boards.
#endif
//OrangeRX
#if (defined(ARDUINO_MULTI_ORANGERX) && ARDUINO_MULTI_ORANGERX < MIN_ORX_BOARD)
#error You need to update your Multi 4-in-1 board definition. Open Boards Manager and update to the latest version of the Multi 4-in-1 AVR Boards.
#endif
//STM32
#if (defined(ARDUINO_MULTI_STM32_NO_BOOT) && ARDUINO_MULTI_STM32_NO_BOOT < MIN_STM32_BOARD) || (defined(ARDUINO_MULTI_STM32_FLASH_FROM_TX) && ARDUINO_MULTI_STM32_FLASH_FROM_TX < MIN_STM32_BOARD) || (defined(ARDUINO_MULTI_STM32_WITH_BOOT) && ARDUINO_MULTI_STM32_WITH_BOOT < MIN_STM32_BOARD)
#error You need to update your Multi 4-in-1 board definition. Open Boards Manager and update to the latest version of the Multi 4-in-1 STM32 Board.
#endif
// Enable serial debugging if a debugging option was chosen in the IDE
#ifdef ARDUINO_MULTI_DEBUG
#define DEBUG_SERIAL
#endif
// Error if CHECK_FOR_BOOTLOADER is not enabled but a FLASH_FROM_TX board is selected
#if (defined(ARDUINO_MULTI_FLASH_FROM_TX) || defined(ARDUINO_MULTI_STM32_FLASH_FROM_TX)) &! defined(CHECK_FOR_BOOTLOADER)
#if defined(STM32_BOARD)
#error "You have selected the 'Flash from TX' upload method but not enabled CHECK_FOR_BOOTLOADER."
#else
#error "You have selected the 'Flash from TX' bootloader but not enabled CHECK_FOR_BOOTLOADER."
#endif
#endif
// Warning if CHECK_FOR_BOOTLOADER is enabled but no bootloader
#if defined(ARDUINO_MULTI_NO_BOOT) && defined(CHECK_FOR_BOOTLOADER)
#undef CHECK_FOR_BOOTLOADER
#warning "Disabling CHECK_FOR_BOOTLOADER since no bootloader is selected."
#endif
//Check number of banks
#if NBR_BANKS < 1 || NBR_BANKS > 5
#error "You need to select a number of banks between 1 and 5."
#endif
//Check failsafe throttle value
#ifdef FAILSAFE_ENABLE
#if ( FAILSAFE_THROTTLE_LOW < -125 ) || ( FAILSAFE_THROTTLE_LOW > 125 )
#error "The failsafe value for throttle is outside of the range -125..125."
#endif
#endif
// Check forced tuning values are valid
//CC2500
#ifdef FORCE_CORONA_TUNING
#if ( FORCE_CORONA_TUNING < -127 ) || ( FORCE_CORONA_TUNING > 127 )
#error "The CORONA forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_FRSKYD_TUNING
#if ( FORCE_FRSKYD_TUNING < -127 ) || ( FORCE_FRSKYD_TUNING > 127 )
#error "The FrSkyD forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_FRSKYL_TUNING
#if ( FORCE_FRSKYL_TUNING < -127 ) || ( FORCE_FRSKYL_TUNING > 127 )
#error "The FrSkyL forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_FRSKYV_TUNING
#if ( FORCE_FRSKYV_TUNING < -127 ) || ( FORCE_FRSKYV_TUNING > 127 )
#error "The FrSkyV forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_FRSKYX_TUNING
#if ( FORCE_FRSKYX_TUNING < -127 ) || ( FORCE_FRSKYX_TUNING > 127 )
#error "The FrSkyX forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_HITEC_TUNING
#if ( FORCE_HITEC_TUNING < -127 ) || ( FORCE_HITEC_TUNING > 127 )
#error "The HITEC forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_HOTT_TUNING
#if ( FORCE_HOTT_TUNING < -127 ) || ( FORCE_HOTT_TUNING > 127 )
#error "The HOTT forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_REDPINE_TUNING
#if ( FORCE_REDPINE_TUNING < -127 ) || ( FORCE_REDPINE_TUNING > 127 )
#error "The REDPINE forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_RADIOLINK_TUNING
#if ( FORCE_RADIOLINK_TUNING < -127 ) || ( FORCE_RADIOLINK_TUNING > 127 )
#error "The RADIOLINK forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_FUTABA_TUNING
#if ( FORCE_FUTABA_TUNING < -127 ) || ( FORCE_FUTABA_TUNING > 127 )
#error "The Futaba forced frequency tuning value is outside of the range -127..127."
#endif
#endif
#ifdef FORCE_SKYARTEC_TUNING
#if ( FORCE_SKYARTEC_TUNING < -127 ) || ( FORCE_SKYARTEC_TUNING > 127 )
#error "The SKYARTEC forced frequency tuning value is outside of the range -127..127."
#endif
#endif
//A7105
#ifdef FORCE_AFHDS2A_TUNING
#if ( FORCE_AFHDS2A_TUNING < -300 ) || ( FORCE_AFHDS2A_TUNING > 300 )
#error "The AFHDS2A forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_BUGS_TUNING
#if ( FORCE_BUGS_TUNING < -300 ) || ( FORCE_BUGS_TUNING > 300 )
#error "The BUGS forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_FLYSKY_TUNING
#if ( FORCE_FLYSKY_TUNING < -300 ) || ( FORCE_FLYSKY_TUNING > 300 )
#error "The Flysky forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_HEIGHT_TUNING
#if ( FORCE_HEIGHT_TUNING < -300 ) || ( FORCE_HEIGHT_TUNING > 300 )
#error "The Height forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_PELIKAN_TUNING
#if ( FORCE_PELIKAN_TUNING < -300 ) || ( FORCE_PELIKAN_TUNING > 300 )
#error "The Pelikan forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_HUBSAN_TUNING
#if ( FORCE_HUBSAN_TUNING < -300 ) || ( FORCE_HUBSAN_TUNING > 300 )
#error "The Hubsan forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_JOYSWAY_TUNING
#if ( FORCE_JOYSWAY_TUNING < -300 ) || ( FORCE_JOYSWAY_TUNING > 300 )
#error "The JOYSWAY forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_KYOSHO_TUNING
#if ( FORCE_KYOSHO_TUNING < -300 ) || ( FORCE_KYOSHO_TUNING > 300 )
#error "The Kyosho forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifdef FORCE_WFLY2_TUNING
#if ( FORCE_WFLY2_TUNING < -300 ) || ( FORCE_WFLY2_TUNING > 300 )
#error "The WFLY2 forced frequency tuning value is outside of the range -300..300."
#endif
#endif
#ifndef USE_A7105_CH15_TUNING
#ifndef FORCE_BUGS_TUNING
#define FORCE_BUGS_TUNING 0
#endif
#ifndef FORCE_FLYSKY_TUNING
#define FORCE_FLYSKY_TUNING 0
#endif
#ifndef FORCE_HEIGHT_TUNING
#define FORCE_HEIGHT_TUNING 0
#endif
#ifndef FORCE_PELIKAN_TUNING
#define FORCE_PELIKAN_TUNING 0
#endif
#ifndef FORCE_JOYSWAY_TUNING
#define FORCE_JOYSWAY_TUNING 0
#endif
#ifndef FORCE_KYOSHO_TUNING
#define FORCE_KYOSHO_TUNING 0
#endif
#ifndef FORCE_WFLY2_TUNING
#define FORCE_WFLY2_TUNING 0
#endif
#ifndef FORCE_HUBSAN_TUNING
#define FORCE_HUBSAN_TUNING 0
#endif
#ifndef FORCE_AFHDS2A_TUNING
#define FORCE_AFHDS2A_TUNING 0
#endif
#endif
#if defined (USE_CYRF6936_CH15_TUNING) && (DSM_THROTTLE_KILL_CH == 15)
#error "Error Channel 15 conflict between the CYRF6936 freq tuning and the DSM throttle kill feature."
#endif
//Change/Force configuration if OrangeTX
#ifdef ORANGE_TX
#undef ENABLE_PPM // Disable PPM for OrangeTX module
#undef A7105_INSTALLED // Disable A7105 for OrangeTX module
#undef A7105_CSN_pin
#undef CC2500_INSTALLED // Disable CC2500 for OrangeTX module
#undef CC25_CSN_pin
#undef NRF24L01_INSTALLED // Disable NRF for OrangeTX module
#undef NRF_CSN_pin
#undef SX1276_INSTALLED // Disable SX1276 for OrangeTX module
#define TELEMETRY // Enable telemetry
#define INVERT_TELEMETRY // Enable invert telemetry
#define DSM_TELEMETRY // Enable DSM telemetry
#endif
//Change/Force RF chip configuration if MULTI_5IN1_INTERNAL
#ifdef MULTI_5IN1_INTERNAL
#if not defined(STM32_BOARD)
#error "Error MULTI_5IN1_INTERNAL is only for STM32 boards."
#endif
#if ! (MULTI_5IN1_INTERNAL + 0)
#define MULTI_5IN1_INTERNAL JP_T18 // make JP_T18 default if it has not been explicitly declared
#endif
#if MULTI_5IN1_INTERNAL > JP_TLite
#error "Invalid value for MULTI_5IN1_INTERNAL."
#endif
#define A7105_INSTALLED
#define CYRF6936_INSTALLED
#define CC2500_INSTALLED
#define NRF24L01_INSTALLED
#define SX1276_INSTALLED
#undef ENABLE_PPM
#undef SEND_CPPM
#endif
//Make sure protocols are selected correctly
#if not defined(A7105_INSTALLED) || defined MULTI_EU
#undef AFHDS2A_A7105_INO
#if not defined(A7105_INSTALLED)
#undef AFHDS2A_RX_A7105_INO
#endif
#undef BUGS_A7105_INO
#undef FLYSKY_A7105_INO
#undef HEIGHT_A7105_INO
#undef HUBSAN_A7105_INO
#undef JOYSWAY_A7105_INO
#undef KYOSHO_A7105_INO
#undef PELIKAN_A7105_INO
#undef WFLY2_A7105_INO
#endif
#if not defined(CYRF6936_INSTALLED) || defined MULTI_EU
#undef DEVO_CYRF6936_INO
#if not defined(CYRF6936_INSTALLED)
#undef DSM_CYRF6936_INO
#undef DSM_RX_CYRF6936_INO
#endif
#undef E010R5_CYRF6936_INO
#undef E01X_CYRF6936_INO
#undef E129_CYRF6936_INO
#undef J6PRO_CYRF6936_INO
#undef KYOSHO3_CYRF6936_INO
#undef LOSI_CYRF6936_INO
#undef MLINK_CYRF6936_INO
#undef TRAXXAS_CYRF6936_INO
#undef SCORPIO_CYRF6936_INO
#undef WFLY_CYRF6936_INO
#undef WK2x01_CYRF6936_INO
#endif
#if not defined(CC2500_INSTALLED) || defined MULTI_EU
#undef CORONA_CC2500_INO
#undef E016HV2_CC2500_INO
#undef ESKY150V2_CC2500_INO
#undef FRSKYD_CC2500_INO
#undef FRSKYL_CC2500_INO
#undef FRSKYV_CC2500_INO
#if not defined(CC2500_INSTALLED)
#undef FRSKYX_CC2500_INO
#undef FRSKY_RX_CC2500_INO
#endif
#undef HITEC_CC2500_INO
#if not defined(CC2500_INSTALLED)
#undef HOTT_CC2500_INO
#endif
#undef IKEAANSLUTA_CC2500_INO
#undef REDPINE_CC2500_INO
#undef RLINK_CC2500_INO
#if not defined(CC2500_INSTALLED)
#undef SCANNER_CC2500_INO
#endif
#undef FUTABA_CC2500_INO
#undef SKYARTEC_CC2500_INO
#endif
#if not defined(NRF24L01_INSTALLED) || defined MULTI_EU
#undef ASSAN_NRF24L01_INO
#undef BAYANG_NRF24L01_INO
#if not defined(NRF24L01_INSTALLED)
#undef BAYANG_RX_NRF24L01_INO
#endif
#undef BUGSMINI_NRF24L01_INO
#undef CABELL_NRF24L01_INO
#undef CFLIE_NRF24L01_INO
#undef CG023_NRF24L01_INO
#undef CX10_NRF24L01_INO
#undef DM002_NRF24L01_INO
#undef E016H_NRF24L01_INO
#undef EAZYRC_NRF24L01_INO
#undef ESKY_NRF24L01_INO
#undef ESKY150_NRF24L01_INO
#undef FQ777_NRF24L01_INO
#undef FX_NRF24L01_INO
#undef FY326_NRF24L01_INO
#undef GW008_NRF24L01_INO
#undef H8_3D_NRF24L01_INO
#undef HISKY_NRF24L01_INO
#undef HONTAI_NRF24L01_INO
#undef JJRC345_NRF24L01_INO
#undef KN_NRF24L01_INO
#undef KYOSHO2_NRF24L01_INO
#undef LOLI_NRF24L01_INO
#undef MOULDKG_NRF24L01_INO
#undef NCC1701_NRF24L01_INO
#undef POTENSIC_NRF24L01_INO
#undef PROPEL_NRF24L01_INO
#undef REALACC_NRF24L01_INO
#undef SGF22_NRF24L01_INO
#undef SHENQI_NRF24L01_INO
#undef SYMAX_NRF24L01_INO
#undef V2X2_NRF24L01_INO
#undef V761_NRF24L01_INO
#undef XERALL_NRF24L01_INO
#undef YD717_NRF24L01_INO
#undef YUXIANG_NRF24L01_INO
#undef ZSX_NRF24L01_INO
#endif
#if ( not defined(CC2500_INSTALLED) && not defined(NRF24L01_INSTALLED) ) || defined MULTI_EU
#undef BLUEFLY_CCNRF_INO
#undef BUMBLEB_CCNRF_INO
#undef GD00X_CCNRF_INO
#undef KF606_CCNRF_INO
#undef MJXQ_CCNRF_INO
#undef MT99XX_CCNRF_INO
#undef OMP_CCNRF_INO
#undef Q303_CCNRF_INO
#undef Q90C_CCNRF_INO
#undef SLT_CCNRF_INO
#undef V911S_CCNRF_INO
#undef XK_CCNRF_INO
#undef XK2_CCNRF_INO
#endif
#if defined(MCU_STM32F103C8) // Save flash space...
#undef BUMBLEB_CCNRF_INO
#undef Q303_CCNRF_INO
#undef Q90C_CCNRF_INO
#endif
#if not defined(DSM_CYRF6936_INO)
#undef LOSI_CYRF6936_INO
#endif
#if not defined(STM32_BOARD)
//RF2500 emulation does not work on atmega...
#undef E010R5_CYRF6936_INO
#undef E129_CYRF6936_INO
#endif
#if not defined(STM32_BOARD)
#undef SX1276_INSTALLED
#endif
#if not defined(SX1276_INSTALLED) || defined MULTI_EU
#undef FRSKYR9_SX1276_INO
#endif
#ifdef MULTI_AIR
#undef JOYSWAY_A7105_INO
//#undef KYOSHO_A7105_INO
//#undef PELIKAN_A7105_INO
#undef LOSI_CYRF6936_INO //Need DSM to be enabled
#undef TRAXXAS_CYRF6936_INO
#undef EAZYRC_NRF24L01_INO
#undef KYOSHO2_NRF24L01_INO
#undef KYOSHO3_CYRF6936_INO
#undef MOULDKG_NRF24L01_INO
#undef SHENQI_NRF24L01_INO
#endif
#ifdef MULTI_SURFACE
#undef BUGS_A7105_INO
#undef HEIGHT_A7105_INO
#undef HUBSAN_A7105_INO
#undef E010R5_CYRF6936_INO
#undef E01X_CYRF6936_INO
#undef E129_CYRF6936_INO
#undef J6PRO_CYRF6936_INO
#undef SCORPIO_CYRF6936_INO
#undef E016HV2_CC2500_INO
#undef ESKY150V2_CC2500_INO
#undef IKEAANSLUTA_CC2500_INO // This is mostly a "for-fun" kind of a thing, not needed for most users
#undef SKYARTEC_CC2500_INO
#undef REDPINE_CC2500_INO
#undef BAYANG_NRF24L01_INO
#undef BAYANG_RX_NRF24L01_INO
#undef BUGSMINI_NRF24L01_INO
#undef CABELL_NRF24L01_INO
#undef CFLIE_NRF24L01_INO
#undef CG023_NRF24L01_INO
#undef CX10_NRF24L01_INO
#undef DM002_NRF24L01_INO
#undef E016H_NRF24L01_INO
#undef ESKY_NRF24L01_INO
#undef ESKY150_NRF24L01_INO
#undef FQ777_NRF24L01_INO
#undef FX_NRF24L01_INO
#undef FY326_NRF24L01_INO
#undef GW008_NRF24L01_INO
#undef HONTAI_NRF24L01_INO
#undef H8_3D_NRF24L01_INO
#undef JJRC345_NRF24L01_INO
#undef KN_NRF24L01_INO
#undef LOLI_NRF24L01_INO
#undef NCC1701_NRF24L01_INO
#undef POTENSIC_NRF24L01_INO
#undef PROPEL_NRF24L01_INO
#undef REALACC_NRF24L01_INO
#undef SGF22_NRF24L01_INO
#undef SYMAX_NRF24L01_INO
#undef V761_NRF24L01_INO
#undef XERALL_NRF24L01_INO
#undef YD717_NRF24L01_INO
#undef ZSX_NRF24L01_INO
#undef GD00X_CCNRF_INO
#undef KF606_CCNRF_INO
#undef MJXQ_CCNRF_INO
#undef MT99XX_CCNRF_INO
#undef OMP_CCNRF_INO
#undef Q303_CCNRF_INO
#undef Q90C_CCNRF_INO
#undef V911S_CCNRF_INO
#undef SGF22_NRF24L01_INO
#undef YUXIANG_NRF24L01_INO
#endif
//OpenTX 2.3.x issue
#if defined (FRSKYD_CC2500_INO) || defined(FRSKYV_CC2500_INO) || defined(FRSKYX_CC2500_INO)
#define FRSKYX_CC2500_INO
#define FRSKY_RX_CC2500_INO
#endif
//Make sure telemetry is selected correctly
#ifndef TELEMETRY
#undef INVERT_TELEMETRY
#undef AFHDS2A_FW_TELEMETRY
#undef AFHDS2A_HUB_TELEMETRY
#undef HITEC_FW_TELEMETRY
#undef HITEC_HUB_TELEMETRY
#undef BAYANG_HUB_TELEMETRY
#undef CABELL_HUB_TELEMETRY
#undef HUBSAN_HUB_TELEMETRY
#undef BUGS_HUB_TELEMETRY
#undef NCC1701_HUB_TELEMETRY
#undef HUB_TELEMETRY
#undef SPORT_TELEMETRY
#undef SPORT_SEND
#undef DSM_TELEMETRY
#undef MULTI_TELEMETRY
#undef SCANNER_TELEMETRY
#undef SCANNER_CC2500_INO
#undef FRSKY_RX_TELEMETRY
#undef FRSKY_RX_CC2500_INO
#undef AFHDS2A_RX_TELEMETRY
#undef AFHDS2A_RX_A7105_INO
#undef HOTT_FW_TELEMETRY
#undef BAYANG_RX_TELEMETRY
#undef BAYANG_RX_NRF24L01_INO
#undef DEVO_HUB_TELEMETRY
#undef PROPEL_HUB_TELEMETRY
#undef OMP_HUB_TELEMETRY
#undef V761_HUB_TELEMETRY
#undef YUXIANG_HUB_TELEMETRY
#undef RLINK_HUB_TELEMETRY
#undef DSM_RX_CYRF6936_INO
#undef DSM_FWD_PGM
#undef WFLY2_HUB_TELEMETRY
#undef LOLI_HUB_TELEMETRY
#undef MT99XX_HUB_TELEMETRY
#undef MLINK_HUB_TELEMETRY
#undef MLINK_FW_TELEMETRY
#undef MULTI_CONFIG_INO
#else
#if not defined(SCANNER_CC2500_INO) || not defined(SCANNER_TELEMETRY)
#undef SCANNER_TELEMETRY
#undef SCANNER_CC2500_INO
#endif
#if not defined(FRSKY_RX_CC2500_INO) || not defined(FRSKY_RX_TELEMETRY)
#undef FRSKY_RX_TELEMETRY
#undef FRSKY_RX_CC2500_INO
#endif
#if not defined(AFHDS2A_RX_A7105_INO) || not defined(AFHDS2A_RX_TELEMETRY)
#undef AFHDS2A_RX_TELEMETRY
#undef AFHDS2A_RX_A7105_INO
#endif
#if not defined(BAYANG_RX_NRF24L01_INO) || not defined(BAYANG_RX_TELEMETRY)
#undef BAYANG_RX_TELEMETRY
#undef BAYANG_RX_NRF24L01_INO
#endif
#if not defined(BAYANG_NRF24L01_INO)
#undef BAYANG_HUB_TELEMETRY
#endif
#if not defined(DEVO_CYRF6936_INO)
#undef DEVO_HUB_TELEMETRY
#endif
#if not defined(OMP_CCNRF_INO)
#undef OMP_HUB_TELEMETRY
#endif
#if not defined(V761_NRF24L01_INO)
#undef V761_HUB_TELEMETRY
#endif
#if not defined(YUXIANG_NRF24L01_INO)
#undef YUXIANG_HUB_TELEMETRY
#endif
#if not defined(PROPEL_NRF24L01_INO)
#undef PROPEL_HUB_TELEMETRY
#endif
#if not defined(NCC1701_NRF24L01_INO)
#undef NCC1701_HUB_TELEMETRY
#endif
#if not defined(BUGS_A7105_INO) && not defined(BUGSMINI_NRF24L01_INO)
#undef BUGS_HUB_TELEMETRY
#endif
#if not defined(CABELL_NRF24L01_INO)
#undef CABELL_HUB_TELEMETRY
#endif
#if not defined(RLINK_CC2500_INO)
#undef RLINK_HUB_TELEMETRY
#endif
#if not defined(HUBSAN_A7105_INO)
#undef HUBSAN_HUB_TELEMETRY
#endif
#if not defined(AFHDS2A_A7105_INO)
#undef AFHDS2A_HUB_TELEMETRY
#undef AFHDS2A_FW_TELEMETRY
#endif
#if not defined(HITEC_CC2500_INO)
#undef HITEC_HUB_TELEMETRY
#undef HITEC_FW_TELEMETRY
#endif
#if not defined(FRSKYX_CC2500_INO) && not defined(FRSKYR9_SX1276_INO)
#undef SPORT_TELEMETRY
#undef SPORT_SEND
#endif
#if not defined (SPORT_TELEMETRY)
#undef SPORT_SEND
#endif
#if not defined(DSM_CYRF6936_INO)
#undef DSM_TELEMETRY
#undef DSM_FWD_PGM
#endif
#if not defined(MLINK_CYRF6936_INO)
#undef MLINK_HUB_TELEMETRY
#undef MLINK_FW_TELEMETRY
#endif
#if not defined(HOTT_CC2500_INO)
#undef HOTT_FW_TELEMETRY
#endif
#if not defined(WFLY2_A7105_INO)
#undef WFLY2_HUB_TELEMETRY
#endif
#if not defined(LOLI_NRF24L01_INO)
#undef LOLI_HUB_TELEMETRY
#endif
#if not defined(MT99XX_CCNRF_INO)
#undef MT99XX_HUB_TELEMETRY
#endif
#if not defined(FRSKYD_CC2500_INO) && not defined(MLINK_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY)
//protocols using FRSKYD user frames
#undef HUB_TELEMETRY
#endif
#if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(RLINK_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY) && not defined(BAYANG_RX_TELEMETRY) && not defined(DEVO_HUB_TELEMETRY) && not defined(PROPEL_HUB_TELEMETRY) && not defined(OMP_HUB_TELEMETRY) && not defined(V761_HUB_TELEMETRY) && not defined(YUXIANG_HUB_TELEMETRY) && not defined(WFLY2_HUB_TELEMETRY) && not defined(LOLI_HUB_TELEMETRY) && not defined(MLINK_HUB_TELEMETRY) && not defined(MLINK_FW_TELEMETRY) && not defined(MT99XX_HUB_TELEMETRY) && not defined(MULTI_CONFIG_INO)
#undef TELEMETRY
#undef INVERT_TELEMETRY
#undef MULTI_TELEMETRY
#endif
#endif
#if defined(MLINK_HUB_TELEMETRY) && defined(MLINK_FW_TELEMETRY)
#error "You must select MLINK_HUB_TELEMETRY or MLINK_FW_TELEMETRY, not both."
#endif
#ifdef SPORT_TELEMETRY
#define SPORT_SEND
#endif
#if not defined(STM32_BOARD)
#undef MULTI_SYNC
#endif
#if not defined(MULTI_TELEMETRY)
#undef MULTI_SYNC
#endif
//Make sure TX is defined correctly
#ifndef AILERON
#error You must select a correct channel order.
#endif
#if not defined(PPM_MAX_100) || not defined(PPM_MIN_100)
#error You must set correct PPM end points for your TX.
#endif
#if defined(ENABLE_BIND_CH)
#if BIND_CH<4
#error BIND_CH must be above 4.
#endif
#if BIND_CH>16
#error BIND_CH must be below or equal to 16.
#endif
#endif
#if defined(DSM_THROTTLE_KILL_CH)
#if DSM_THROTTLE_KILL_CH<4
#error DSM_THROTTLE_KILL_CH must be above 4.
#endif
#if DSM_THROTTLE_KILL_CH>16
#error DSM_THROTTLE_KILL_CH must be below or equal to 16.
#endif
#endif
#if defined(AFHDS2A_LQI_CH)
#if AFHDS2A_LQI_CH<4
#error AFHDS2A_LQI_CH must be above 4.
#endif
#if AFHDS2A_LQI_CH>14
#error AFHDS2A_LQI_CH must be below or equal to 14.
#endif
#endif
#if MIN_PPM_CHANNELS>16
#error MIN_PPM_CHANNELS must be below or equal to 16. The default for this value is 4.
#endif
#if MIN_PPM_CHANNELS<2
#error MIN_PPM_CHANNELS must be larger than 1. The default for this value is 4.
#endif
#if MAX_PPM_CHANNELS<MIN_PPM_CHANNELS
#error MAX_PPM_CHANNELS must be higher than MIN_PPM_CHANNELS. The default for this value is 16.
#endif
#if MAX_PPM_CHANNELS>16
#error MAX_PPM_CHANNELS must be below or equal to 16. The default for this value is 16.
#endif
#if defined (STM32_BOARD) && defined (DEBUG_SERIAL)
#undef SEND_CPPM
#ifdef NRF24L01_INSTALLED
#define XN297DUMP_NRF24L01_INO
#endif
#endif
#if not defined (STM32_BOARD) || not defined (TELEMETRY) || (not defined (FRSKY_RX_TELEMETRY) && not defined (AFHDS2A_RX_TELEMETRY) && not defined (BAYANG_RX_TELEMETRY) && not defined (DSM_RX_CYRF6936_INO))
#undef SEND_CPPM
#endif
//Check if Direct inputs defined correctly
#if defined (ENABLE_DIRECT_INPUTS)
#if not defined (STM32_BOARD) || not defined (ENABLE_PPM) || defined (ENABLE_SERIAL)
#error You can enable dirct inputs only in PPM mode and only for STM32 board.
#endif
#if not defined (DI1_PIN) && not defined (DI2_PIN) && not defined (DI3_PIN) && not defined (DI4_PIN)
#error You must define at least 1 direct input pin or undefine ENABLE_DIRECT_INPUTS in config.
#endif
#if not defined (DI_CH1_read) && not defined (DI_CH2_read) && not defined (DI_CH3_read) && not defined (DI_CH4_read)
#error You must define at least 1 direct input chanell read macros or undefine ENABLE_DIRECT_INPUTS in config.
#endif
#endif