-int maxval[8]; // Stores maximum values read during calibration, setup() sets 1024
-int minval[8]; // Stores minimum values read during calibration, setup() sets 0
-int rev[8];
-int dr[8]; // The Dual-rate array uses magic numbers :P
-/* dr[0] = Input channel #1 of 2 for D/R switch #1. 0 means off, 1-4 valid values.
- dr[1] = Input channel #2 of 2 for D/R switch #1. 0 means off, 1-4 valid values.
- dr[2] = Input channel #1 of 2 for D/R switch #2. 0 means off, 1-4 valid values.
- dr[3] = Input channel #2 of 2 for D/R switch #2. 0 means off, 1-4 valid values.
- dr[4] = D/R value for switch # 1 LOW(off). Value -100 to 100 in steps of 5.
- dr[5] = D/R value for switch # 1 HIGH(on). Value -100 to 100 in steps of 5.
- dr[6] = D/R value for switch # 1 LOW(off). Value -100 to 100 in steps of 5.
- dr[7] = D/R value for switch # 1 HIGH(on). Value -100 to 100 in steps of 5.
-*/
-
-volatile float channel[8];
+struct input_cal_t // Struct type for input calibration values
+{
+ int min[MAX_INPUTS];
+ int max[MAX_INPUTS];
+ int center[MAX_INPUTS];
+} ;
+input_cal_t input_cal;
+
+struct model_t
+{
+ int channels; // How many channels should PPM generate for this model ...
+ float stick[8]; // The (potentially recalc'ed) value of stick/input channel.
+ boolean rev[8];
+ int dr[8]; // The Dual-rate array uses magic numbers :P
+ /* dr[0] = Input channel #1 of 2 for D/R switch #1. 0 means off, 1-4 valid values.
+ dr[1] = Input channel #2 of 2 for D/R switch #1. 0 means off, 1-4 valid values.
+ dr[2] = Input channel #1 of 2 for D/R switch #2. 0 means off, 1-4 valid values.
+ dr[3] = Input channel #2 of 2 for D/R switch #2. 0 means off, 1-4 valid values.
+ dr[4] = D/R value for switch # 1 LOW(off). Value -100 to 100 in steps of 5.
+ dr[5] = D/R value for switch # 1 HIGH(on). Value -100 to 100 in steps of 5.
+ dr[6] = D/R value for switch # 1 LOW(off). Value -100 to 100 in steps of 5.
+ dr[7] = D/R value for switch # 1 HIGH(on). Value -100 to 100 in steps of 5.
+ */
+};
+volatile model_t model;