Arm with both sticks min/min, Normalizing stickvalue <min becomes 0 >max becomes 1000

Piele [2013-11-03 14:56]
Arm with both sticks min/min, Normalizing stickvalue <min becomes 0 >max becomes 1000
Filename
flight-controller/fc_receiver.c
flight-controller/fc_stickcom.c
diff --git a/flight-controller/fc_receiver.c b/flight-controller/fc_receiver.c
index 7905c1d..519944d 100644
--- a/flight-controller/fc_receiver.c
+++ b/flight-controller/fc_receiver.c
@@ -192,9 +192,9 @@ static inline rec_width_t RECNormalize(rec_names_t name, uint16_t val)
   if (val > rec_trans_table[name].max+30 || val < rec_trans_table[name].min-30) {
       retval = 0xFFFF;
   } else if(val > rec_trans_table[name].max) {
-		retval = rec_trans_table[name].max;
+		retval = 1000;
   } else if(val < rec_trans_table[name].min) {
-		retval = rec_trans_table[name].min;
+		retval = 0;
 	} else {
 		retval = val-rec_trans_table[name].min;
 		retval *= 1000;
diff --git a/flight-controller/fc_stickcom.c b/flight-controller/fc_stickcom.c
index 5fcdd23..54c5679 100644
--- a/flight-controller/fc_stickcom.c
+++ b/flight-controller/fc_stickcom.c
@@ -141,7 +141,7 @@ static stc_command_t STCDecodeCommand(stc_pos_t pitch, stc_pos_t roll, stc_pos_t
 {
 	stc_command_t command = nocommand;

-	if((throttle == min) && (yaw == max) && (pitch == mid) && (roll == mid)){
+	if((throttle == min) && (yaw == max) && (pitch == min) && (roll == min)){
 		command = arm;
 	}
   /* Since disarming can be done in an emergency, pitch and roll do not need to be centered.  */