// It is possible that an option has been read in
// which is not compatible with the hardware.
// Change setting to reasonable value then.
+// This could possibly be moved to radioRestoreState().
//
+// Sanity Check #1: restrict buffer size in new protocol
//
switch (protocol) {
case ORIGINAL_PROTOCOL:
break;
#endif
}
+//
+// Sanity Check #2: enable diversity only if there are two RX and two ADCs
+//
+ if (RECEIVERS < 2 || n_adc < 2) {
+ diversity_enabled=0;
+ }
radio_change_region(region);
fprintf(stderr,"sem_wait: returner\n");
loadProperties(property_path);
+ value=getProperty("diversity_enabled");
+ if (value) diversity_enabled=atoi(value);
+ value=getProperty("diversity_gain");
+ if (value) div_gain=atof(value);
+ value=getProperty("diversity_phase");
+ if (value) div_phase=atof(value);
+ value=getProperty("diversity_cos");
+ if (value) div_cos=atof(value);
+ value=getProperty("diversity_sin");
+ if (value) div_sin=atof(value);
value=getProperty("new_pa_board");
if (value) new_pa_board=atoi(value);
value=getProperty("region");
sem_wait(&property_sem);
#endif
fprintf(stderr,"sem_wait: returned\n");
+ sprintf(value,"%d",diversity_enabled);
+ setProperty("diversity_enabled",value);
+ sprintf(value,"%f",div_gain);
+ setProperty("diversity_gain",value);
+ sprintf(value,"%f",div_phase);
+ setProperty("diversity_phase",value);
+ sprintf(value,"%f",div_cos);
+ setProperty("diversity_cos",value);
+ sprintf(value,"%f",div_sin);
+ setProperty("diversity_sin",value);
sprintf(value,"%d",new_pa_board);
setProperty("new_pa_board",value);
sprintf(value,"%d",region);