Rev 2496 | Rev 2531 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2496 | Rev 2527 | ||
---|---|---|---|
Line 61... | Line 61... | ||
61 | unsigned char ToNC_Load_SingePoint = 0, ToNC_Store_SingePoint = 0; |
61 | unsigned char ToNC_Load_SingePoint = 0, ToNC_Store_SingePoint = 0; |
62 | char WPL_Name[10];// = {" \0"}; |
62 | char WPL_Name[10];// = {" \0"}; |
63 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
63 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
Line 64... | Line 64... | ||
64 | 64 | ||
65 | #define HoTT_printf(format, args...) { _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
65 | #define HoTT_printf(format, args...) { _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
66 | #define HoTT_printfxy(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
66 | #define HoTT_printfxy(x,y,format, args...) { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
67 | #define HoTT_printfxy_INV(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
67 | #define HoTT_printfxy_INV(x,y,format, args...) { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
68 | #define HoTT_printfxy_BLINK(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
68 | #define HoTT_printfxy_BLINK(x,y,format, args...) { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
69 | #define HoTT_printf_BLINK(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
69 | #define HoTT_printf_BLINK(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
Line 70... | Line 70... | ||
70 | #define HoTT_printf_INV(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
70 | #define HoTT_printf_INV(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
71 | 71 | ||
Line 183... | Line 183... | ||
183 | {SPEAK_ERR_MOTOR,0}, // "BL-Selftest \0" // 32 |
183 | {SPEAK_ERR_MOTOR,0}, // "BL-Selftest \0" // 32 |
184 | {SPEAK_ERR_COMPASS,0}, // "no ext. compass" // 33 |
184 | {SPEAK_ERR_COMPASS,0}, // "no ext. compass" // 33 |
185 | {SPEAK_ERR_COMPASS,0} // "compass sensor" // 34 |
185 | {SPEAK_ERR_COMPASS,0} // "compass sensor" // 34 |
186 | }; |
186 | }; |
Line -... | Line 187... | ||
- | 187 | ||
- | 188 | /* |
|
- | 189 | //------------------------------------------------------------------------------------------ |
|
- | 190 | // HoTT-Plus |
|
- | 191 | //------------------------------------------------------------------------------------------ |
|
- | 192 | char dummy=0; |
|
- | 193 | const Parameter_List_t Parameter_List[] = |
|
- | 194 | { //offset,min,max,name,variable |
|
- | 195 | {127, 0, 247,"SP1", (unsigned char *) &PPM_in[13] }, |
|
- | 196 | {127, 0, 247,"SP2", (unsigned char *) &PPM_in[14] }, |
|
- | 197 | {127, 0, 247,"SP3", (unsigned char *) &PPM_in[15] }, |
|
- | 198 | {127, 0, 247,"SP4", (unsigned char *) &PPM_in[16] }, |
|
- | 199 | { 0, 0, 247,"HD ", (unsigned char *) &EE_Parameter.Luftdruck_D }, |
|
- | 200 | { 0, 0, 247,"HP ", (unsigned char *) &EE_Parameter.Hoehe_P }, |
|
- | 201 | { 0, 0, 247,"HA ", (unsigned char *) &EE_Parameter.Hoehe_ACC_Wirkung }, |
|
- | 202 | { 0, 0, 247,"HM ", (unsigned char *) &EE_Parameter.Hoehe_MinGas }, |
|
- | 203 | { 0, 0, 247,"HV ", (unsigned char *) &EE_Parameter.Hoehe_HoverBand }, |
|
- | 204 | { 0, 0, 247,"HG ", (unsigned char *) &EE_Parameter.Hoehe_Verstaerkung }, |
|
- | 205 | { 0, 0, 247,"NG ", (unsigned char *) &EE_Parameter.NotGas }, |
|
- | 206 | { 0, 0, 247,"StP", (unsigned char *) &EE_Parameter.Stick_P }, |
|
- | 207 | { 0, 0, 247,"StD", (unsigned char *) &EE_Parameter.Stick_D }, |
|
- | 208 | { 0, 0, 247,"SGP", (unsigned char *) &EE_Parameter.StickGier_P }, |
|
- | 209 | { 0, 0, 247,"DrC", (unsigned char *) &EE_Parameter.Driftkomp }, |
|
- | 210 | { 0, 0, 247,"GYP", (unsigned char *) &EE_Parameter.Gyro_P }, |
|
- | 211 | { 0, 0, 247,"GYD", (unsigned char *) &EE_Parameter.Gyro_D }, |
|
- | 212 | { 0, 0, 247,"GYI", (unsigned char *) &EE_Parameter.Gyro_I }, |
|
- | 213 | { 0, 0, 247,"MaI", (unsigned char *) &EE_Parameter.I_Faktor }, |
|
- | 214 | { 0, 0, 247,"GGP", (unsigned char *) &EE_Parameter.Gyro_Gier_P }, |
|
- | 215 | { 0, 0, 247,"GGI", (unsigned char *) &EE_Parameter.Gyro_Gier_I }, |
|
- | 216 | { 0, 0, 15,"GSt", (unsigned char *) &EE_Parameter.Gyro_Stability }, |
|
- | 217 | { 0, 0, 247,"DSt", (unsigned char *) &EE_Parameter.DynamicStability }, |
|
- | 218 | { 0, 0, 247,"NGG", (unsigned char *) &EE_Parameter.NaviGpsGain }, |
|
- | 219 | { 0, 0, 247,"NWC", (unsigned char *) &EE_Parameter.NaviWindCorrection }, |
|
- | 220 | { 0, 0, 247,"NSC", (unsigned char *) &EE_Parameter.NaviAccCompensation }, |
|
- | 221 | { 0, 0, 247,"NAL", (unsigned char *) &EE_Parameter.NaviAngleLimitation }, |
|
- | 222 | { 0, 0, 247,"NP ", (unsigned char *) &EE_Parameter.NaviGpsP }, |
|
- | 223 | { 0, 0, 247,"ND ", (unsigned char *) &EE_Parameter.NaviGpsI }, |
|
- | 224 | { 0, 0, 247,"NI ", (unsigned char *) &EE_Parameter.NaviGpsD }, |
|
- | 225 | { 0, 0, 247,"LGL", (unsigned char *) &EE_Parameter.LoopGasLimit }, |
|
- | 226 | { 0, 0, 247,"LHy", (unsigned char *) &EE_Parameter.LoopHysterese }, |
|
- | 227 | { 0, 0, 247,"LTh", (unsigned char *) &EE_Parameter.LoopThreshold }, |
|
- | 228 | { 0, 0, 0," ", (unsigned char *) &dummy }, |
|
- | 229 | { 0, 0, 247,"FGP", (unsigned char *) &EE_Parameter.AchsKopplung1}, |
|
- | 230 | { 0, 0, 247,"FNR", (unsigned char *) &EE_Parameter.AchsKopplung2}, |
|
- | 231 | { 0, 0, 247,"CYC", (unsigned char *) &EE_Parameter.CouplingYawCorrection}, |
|
- | 232 | { 0, 0, 247,"MSH", (unsigned char *) &EE_Parameter.MotorSmooth}, |
|
- | 233 | { 0, 0, 247,"NCT", (unsigned char *) &EE_Parameter.ServoNickControl }, |
|
- | 234 | { 0, 0, 247,"NCP", (unsigned char *) &EE_Parameter.ServoNickComp }, |
|
- | 235 | { 0, 0, 247,"RCT", (unsigned char *) &EE_Parameter.ServoRollControl }, |
|
- | 236 | { 0, 0, 247,"RCP", (unsigned char *) &EE_Parameter.ServoRollComp } |
|
- | 237 | }; |
|
- | 238 | unsigned char settingdest = 0; |
|
- | 239 | //------------------------------------------------------------------------------------------ |
|
- | 240 | // HoTT-Plus |
|
187 | 241 | //------------------------------------------------------------------------------------------ |
|
188 | 242 | */ |
|
189 | void GetHottestBl(void) |
243 | void GetHottestBl(void) |
190 | { |
244 | { |
191 | static unsigned char search = 0,tmp_max,tmp_min,who; |
245 | static unsigned char search = 0,tmp_max,tmp_min,who; |
192 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
246 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
Line 760... | Line 814... | ||
760 | case 14: |
814 | case 14: |
761 | case 15: |
815 | case 15: |
762 | case 16: |
816 | case 16: |
763 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
817 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
764 | else |
818 | else |
765 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;} |
819 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
766 | else |
820 | else |
767 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;} |
821 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
768 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
822 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
769 | HottKeyboard = 0; |
823 | HottKeyboard = 0; |
770 | break; |
824 | break; |
771 | default: line = 0; |
825 | default: line = 0; |
772 | break; |
826 | break; |
Line 853... | Line 907... | ||
853 | case 14: |
907 | case 14: |
854 | case 15: |
908 | case 15: |
855 | case 16: |
909 | case 16: |
856 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
910 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
857 | else |
911 | else |
858 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 3; line = 0;} |
912 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
859 | else |
913 | else |
860 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
914 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
861 | HottKeyboard = 0; |
915 | HottKeyboard = 0; |
862 | break; |
916 | break; |
863 | default: line = 0; |
917 | default: line = 0; |
864 | break; |
918 | break; |
865 | } |
919 | } |
Line 903... | Line 957... | ||
903 | if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;} |
957 | if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;} |
904 | } else HoTT_printfxy(0,4,"!No GPS-Fix! "); |
958 | } else HoTT_printfxy(0,4,"!No GPS-Fix! "); |
905 | } |
959 | } |
906 | if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < NaviData_MaxWpListIndex) { changed2 = 1; load_waypoint_tmp2++;HoTTBlink = 0;} |
960 | if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < NaviData_MaxWpListIndex) { changed2 = 1; load_waypoint_tmp2++;HoTTBlink = 0;} |
907 | if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2 > 1) { changed2 = 1; load_waypoint_tmp2--;HoTTBlink = 0;}; |
961 | if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2 > 1) { changed2 = 1; load_waypoint_tmp2--;HoTTBlink = 0;}; |
908 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 4; line = 0;} |
962 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
909 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}; |
963 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
910 | HottKeyboard = 0; |
964 | HottKeyboard = 0; |
911 | break; |
965 | break; |
912 | default: line = 0; |
966 | default: line = 0; |
913 | break; |
967 | break; |
914 | } |
968 | } |
Line 1064... | Line 1118... | ||
1064 | } |
1118 | } |
1065 | } |
1119 | } |
1066 | if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;} |
1120 | if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;} |
1067 | if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;}; |
1121 | if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;}; |
1068 | if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Load_SingePoint = wp_tmp; changed = 0;} |
1122 | if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Load_SingePoint = wp_tmp; changed = 0;} |
1069 | // if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
1123 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
1070 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
1124 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
1071 | HottKeyboard = 0; |
1125 | HottKeyboard = 0; |
1072 | break; |
1126 | break; |
1073 | default: line = 0; |
1127 | default: line = 0; |
1074 | break; |
1128 | break; |
1075 | } |
1129 | } |
1076 | break; |
1130 | break; |
- | 1131 | case 7: |
|
- | 1132 | switch(line++) |
|
- | 1133 | { |
|
- | 1134 | static unsigned char i=0,test=0,set=0; |
|
- | 1135 | ||
- | 1136 | case 0: HoTT_printfxy(0,0,"Motortest / Setpoints");break; |
|
- | 1137 | case 1: //HoTT_printfxy(0,1,"Motor Setpoint Strom "); |
|
- | 1138 | case 2: |
|
- | 1139 | case 3: |
|
- | 1140 | case 4: i=((line-2)*2)+1; |
|
- | 1141 | if(MotorenEin) |
|
- | 1142 | { |
|
- | 1143 | HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,Motor[i-1].SetPoint,Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,Motor[i].SetPoint,Motor[i].Current/10,Motor[i].Current%10); |
|
- | 1144 | } |
|
- | 1145 | else |
|
- | 1146 | { |
|
- | 1147 | HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,MotorTest[i-1],Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,MotorTest[i],Motor[i].Current/10,Motor[i].Current%10); |
|
- | 1148 | } |
|
- | 1149 | break; |
|
- | 1150 | case 5: if(test) |
|
- | 1151 | { |
|
- | 1152 | HoTT_printfxy(0,6,"!!!Motortest Aktiv!!!"); |
|
- | 1153 | } |
|
- | 1154 | case 6: if(test) |
|
- | 1155 | { |
|
- | 1156 | PC_MotortestActive = 254; |
|
- | 1157 | HoTT_printfxy(0,7,"Motor %i",test); |
|
- | 1158 | MotorTest[test-1]=set; |
|
- | 1159 | } |
|
- | 1160 | case 7: |
|
- | 1161 | case 8: |
|
- | 1162 | case 9: |
|
- | 1163 | case 10: |
|
- | 1164 | case 11: |
|
- | 1165 | case 12: |
|
- | 1166 | case 13: |
|
- | 1167 | case 14: |
|
- | 1168 | case 15: |
|
- | 1169 | case 16: |
|
- | 1170 | if(HottKeyboard == HOTT_KEY_RIGHT) |
|
- | 1171 | { |
|
- | 1172 | if(test) |
|
- | 1173 | { |
|
- | 1174 | set=0; |
|
- | 1175 | MotorTest[test-1]=set; |
|
- | 1176 | if(test<8) test++; |
|
- | 1177 | } |
|
- | 1178 | else |
|
- | 1179 | { |
|
- | 1180 | LIBFC_HoTT_Clear(); |
|
- | 1181 | page--; |
|
- | 1182 | line=0; |
|
- | 1183 | } |
|
- | 1184 | } |
|
- | 1185 | else |
|
- | 1186 | if(HottKeyboard == HOTT_KEY_LEFT) |
|
- | 1187 | { |
|
- | 1188 | if(test) |
|
- | 1189 | { |
|
- | 1190 | set=0; |
|
- | 1191 | MotorTest[test-1]=set; |
|
- | 1192 | if(test>1) test--; |
|
- | 1193 | } |
|
- | 1194 | else |
|
- | 1195 | { |
|
- | 1196 | LIBFC_HoTT_Clear(); |
|
- | 1197 | page++; |
|
- | 1198 | line = 0; |
|
- | 1199 | } |
|
- | 1200 | } |
|
- | 1201 | else |
|
- | 1202 | if((HottKeyboard == HOTT_KEY_UP) && (set <98 ) && test) set+=2;//GESCHW |
|
- | 1203 | else |
|
- | 1204 | if((HottKeyboard == HOTT_KEY_DOWN) && (set >0 ) && test) set-=2; |
|
- | 1205 | else |
|
- | 1206 | if((HottKeyboard == HOTT_KEY_SET) && !MotorenEin) |
|
- | 1207 | { |
|
- | 1208 | if(test) test = 0; else test = 1; |
|
- | 1209 | set=0; |
|
- | 1210 | Hott_ClearLine(6); Hott_ClearLine(7); |
|
- | 1211 | } |
|
- | 1212 | HottKeyboard = 0; |
|
- | 1213 | break; |
|
- | 1214 | default: line = 0; |
|
- | 1215 | break; |
|
- | 1216 | //HoTT_printfxy(10 ,line,"I"); |
|
- | 1217 | //line++; |
|
- | 1218 | } |
|
- | 1219 | break; |
|
- | 1220 | case 8: |
|
- | 1221 | switch(line++) |
|
- | 1222 | { |
|
- | 1223 | #define MD_OFF 1 |
|
- | 1224 | #define MD_CAL 2 |
|
- | 1225 | #define MD_SAV 3 |
|
- | 1226 | static unsigned char mode=MD_OFF,cursor=MD_OFF; |
|
- | 1227 | ||
- | 1228 | case 0: HoTT_printfxy(0,0,"ACC calibration");break; |
|
- | 1229 | case 1: HoTT_printfxy(0,1," ACC Stick");break; |
|
- | 1230 | case 2: HoTT_printfxy(0,2,"Nick = %3i %4i",NeutralAccX,ChannelNick);break; |
|
- | 1231 | case 3: HoTT_printfxy(0,3,"Roll = %3i %4i",NeutralAccY,ChannelRoll);break; |
|
- | 1232 | case 4: HoTT_printfxy(2,4,"Off");break; |
|
- | 1233 | case 5: HoTT_printfxy(2,5,"Calibrate");break; |
|
- | 1234 | case 6: HoTT_printfxy(2,6,"Save"); |
|
- | 1235 | if(mode == MD_SAV && cursor == MD_SAV) HoTT_printfxy(7,6,"(SET)"); |
|
- | 1236 | break; |
|
- | 1237 | case 7: |
|
- | 1238 | case 8: HoTT_printfxy(0,cursor+3,">");break; |
|
- | 1239 | case 9: HoTT_printfxy(1,mode+3,"*");break; |
|
- | 1240 | case 10: |
|
- | 1241 | case 11: |
|
- | 1242 | case 12: |
|
- | 1243 | case 13: |
|
- | 1244 | case 14: |
|
- | 1245 | case 15: |
|
- | 1246 | case 16: |
|
- | 1247 | if(HottKeyboard == HOTT_KEY_RIGHT) |
|
- | 1248 | { |
|
- | 1249 | switch(mode) |
|
- | 1250 | { |
|
- | 1251 | case MD_OFF: LIBFC_HoTT_Clear(); |
|
- | 1252 | page--; // leave menu |
|
- | 1253 | line = 0; |
|
- | 1254 | break; |
|
- | 1255 | case MD_CAL: NeutralAccY++; |
|
- | 1256 | break; |
|
- | 1257 | case MD_SAV: break; |
|
- | 1258 | default: mode=MD_OFF;break; |
|
- | 1259 | } |
|
- | 1260 | } |
|
- | 1261 | else |
|
- | 1262 | if(HottKeyboard == HOTT_KEY_LEFT) |
|
- | 1263 | { |
|
- | 1264 | switch(mode) |
|
- | 1265 | { |
|
- | 1266 | case MD_OFF: LIBFC_HoTT_Clear(); |
|
- | 1267 | page++; // leave menu |
|
- | 1268 | line = 0; |
|
- | 1269 | break; |
|
- | 1270 | case MD_CAL: NeutralAccY--; |
|
- | 1271 | break; |
|
- | 1272 | case MD_SAV: break; |
|
- | 1273 | default: mode=MD_OFF; |
|
- | 1274 | break; |
|
- | 1275 | } |
|
- | 1276 | } |
|
- | 1277 | else |
|
- | 1278 | if(HottKeyboard == HOTT_KEY_UP) |
|
- | 1279 | { |
|
- | 1280 | switch(mode) |
|
- | 1281 | { |
|
- | 1282 | case MD_CAL: NeutralAccX++; |
|
- | 1283 | break; |
|
- | 1284 | case MD_OFF: |
|
- | 1285 | case MD_SAV: if(cursor>1) {HoTT_printfxy(0,cursor+3," ");cursor--;} |
|
- | 1286 | HoTT_printfxy(2,6," "); |
|
- | 1287 | break; |
|
- | 1288 | default: mode=MD_OFF; |
|
- | 1289 | break; |
|
- | 1290 | } |
|
- | 1291 | } |
|
- | 1292 | else |
|
- | 1293 | if(HottKeyboard == HOTT_KEY_DOWN) |
|
- | 1294 | { |
|
- | 1295 | switch(mode) |
|
- | 1296 | { |
|
- | 1297 | case MD_CAL: NeutralAccX--; |
|
- | 1298 | break; |
|
- | 1299 | case MD_SAV: |
|
- | 1300 | case MD_OFF: if(cursor<MD_SAV) {HoTT_printfxy(0,cursor+3," ");cursor++;} |
|
- | 1301 | break; |
|
- | 1302 | default: mode=MD_OFF; |
|
- | 1303 | break; |
|
- | 1304 | } |
|
- | 1305 | } |
|
- | 1306 | else |
|
- | 1307 | if(HottKeyboard == HOTT_KEY_SET) |
|
- | 1308 | { |
|
- | 1309 | switch(mode) |
|
- | 1310 | { |
|
- | 1311 | case MD_OFF: HoTT_printfxy(1,mode+3," "); |
|
- | 1312 | mode = cursor; |
|
- | 1313 | if(mode == MD_CAL && !EE_Parameter.Driftkomp) EE_Parameter.Driftkomp = 6; // enables the Gyro-Drift compensation to make sure that a litlte calibration error won't effect the attitude |
|
- | 1314 | break; |
|
- | 1315 | case MD_CAL: HoTT_printfxy(1,mode+3," "); |
|
- | 1316 | mode = MD_OFF; |
|
- | 1317 | break; |
|
- | 1318 | case MD_SAV: |
|
- | 1319 | Hott_ClearLine(7); |
|
- | 1320 | if(cursor == MD_SAV) |
|
- | 1321 | { |
|
- | 1322 | if(!MotorenEin) |
|
- | 1323 | { |
|
- | 1324 | SetParamWord(PID_ACC_NICK, (uint16_t)NeutralAccX); |
|
- | 1325 | SetParamWord(PID_ACC_ROLL, (uint16_t)NeutralAccY); |
|
- | 1326 | BoatNeutralNick = AdNeutralNick; |
|
- | 1327 | BoatNeutralRoll = AdNeutralRoll; |
|
- | 1328 | BoatNeutralGier = AdNeutralGier; |
|
- | 1329 | SetParamWord(PID_GYRO_NICK,(uint16_t)BoatNeutralNick); |
|
- | 1330 | SetParamWord(PID_GYRO_ROLL,(uint16_t)BoatNeutralRoll); |
|
- | 1331 | SetParamWord(PID_GYRO_YAW,(uint16_t)BoatNeutralGier); |
|
- | 1332 | HoTT_printfxy(7,6," okay "); |
|
- | 1333 | HoTT_printfxy(1,mode+3," "); |
|
- | 1334 | mode = MD_OFF; |
|
- | 1335 | } |
|
- | 1336 | else |
|
- | 1337 | { |
|
- | 1338 | HoTT_printfxy(0,7,"Motors running!!!"); |
|
- | 1339 | mode = MD_OFF; |
|
- | 1340 | } |
|
- | 1341 | } |
|
- | 1342 | else |
|
- | 1343 | { |
|
- | 1344 | HoTT_printfxy(1,mode+3," "); |
|
- | 1345 | mode=cursor; |
|
- | 1346 | } |
|
- | 1347 | break; |
|
- | 1348 | default: mode=MD_OFF; |
|
- | 1349 | break; |
|
- | 1350 | } |
|
- | 1351 | } |
|
- | 1352 | HottKeyboard = 0; |
|
- | 1353 | break; |
|
- | 1354 | default: line = 0; |
|
- | 1355 | break; |
|
- | 1356 | //HoTT_printfxy(10 ,line,"I"); |
|
- | 1357 | //line++; |
|
- | 1358 | } |
|
- | 1359 | break; |
|
- | 1360 | /* |
|
- | 1361 | //------------------------------------------------------------------------------------------ |
|
- | 1362 | // HoTT-Plus |
|
- | 1363 | //------------------------------------------------------------------------------------------ |
|
- | 1364 | case 9: |
|
- | 1365 | switch(line++) |
|
- | 1366 | { |
|
- | 1367 | case 0: HoTT_printfxy(0,0,"I2C Schwerpunkt GAS"); |
|
- | 1368 | break; |
|
- | 1369 | case 1: HoTT_printfxy(0,1,"I2C%3i%3i%3i%3i",Motor[0].State & MOTOR_STATE_ERROR_MASK,Motor[1].State & MOTOR_STATE_ERROR_MASK, Motor[2].State & MOTOR_STATE_ERROR_MASK, Motor[3].State & MOTOR_STATE_ERROR_MASK); |
|
- | 1370 | break; |
|
- | 1371 | case 2: HoTT_printfxy(0,2," %3i%3i%3i%3i",Motor[4].State & MOTOR_STATE_ERROR_MASK,Motor[5].State & MOTOR_STATE_ERROR_MASK, Motor[6].State & MOTOR_STATE_ERROR_MASK, Motor[7].State & MOTOR_STATE_ERROR_MASK); |
|
- | 1372 | break; |
|
- | 1373 | |
|
- | 1374 | case 3: { //0123456789ABCDEF |
|
- | 1375 | int r=0; |
|
- | 1376 | int n=0; |
|
- | 1377 | int g=0; |
|
- | 1378 | n=SummeNick >> 9; |
|
- | 1379 | r=SummeRoll >> 9; |
|
- | 1380 | g=Mess_Integral_Gier >> 9; |
|
- | 1381 | ||
- | 1382 | HoTT_printfxy(0,5,"%3iN %3iR %3iG",n ,r ,g); |
|
- | 1383 | } |
|
- | 1384 | ||
- | 1385 | break; |
|
- | 1386 | case 4: { //0123456789ABCDEF |
|
- | 1387 | HoTT_printfxy(0,4,"+ ^ + <"); |
|
- | 1388 | } |
|
- | 1389 | break; |
|
- | 1390 | case 5: { //0123456789ABCDEF |
|
- | 1391 | HoTT_printfxy(0,6,"- v - >"); |
|
- | 1392 | } |
|
- | 1393 | break; |
|
- | 1394 | case 6: HoTT_printfxy(0,7,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas); |
|
- | 1395 | ||
- | 1396 | break; |
|
- | 1397 | case 7: |
|
- | 1398 | case 8: |
|
- | 1399 | case 9: |
|
- | 1400 | case 10: |
|
- | 1401 | case 11: |
|
- | 1402 | case 12: |
|
- | 1403 | case 13: |
|
- | 1404 | case 14: |
|
- | 1405 | case 15: |
|
- | 1406 | case 16: |
|
- | 1407 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
|
- | 1408 | else |
|
- | 1409 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
|
- | 1410 | HottKeyboard = 0; |
|
- | 1411 | break; |
|
- | 1412 | default: line = 0; |
|
- | 1413 | break; |
|
- | 1414 | } |
|
- | 1415 | break; |
|
- | 1416 | //--------------------------------------------------------------------------------------------------- |
|
- | 1417 | case 10: |
|
- | 1418 | { |
|
- | 1419 | static signed char i=0,j=0,Changepos=0; |
|
- | 1420 | |
|
- | 1421 | if(line==9) |
|
- | 1422 | { |
|
- | 1423 | line=0; |
|
- | 1424 | if(HottKeyboard == HOTT_KEY_SET ) { if(Changepos) Changepos = 0; else Changepos = 1;} |
|
- | 1425 | else |
|
- | 1426 | if(Changepos) |
|
- | 1427 | { |
|
- | 1428 | unsigned char temp=0; |
|
- | 1429 | temp=(Changepos+j)-1; |
|
- | 1430 | if((HottKeyboard == HOTT_KEY_RIGHT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) >= Parameter_List[temp].max )) {*Parameter_List[temp].Variable += 1;} |
|
- | 1431 | else |
|
- | 1432 | if((HottKeyboard == HOTT_KEY_LEFT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) <= Parameter_List[temp].min )) {*Parameter_List[temp].Variable -= 1;} |
|
- | 1433 | else |
|
- | 1434 | if(HottKeyboard == HOTT_KEY_UP ) |
|
- | 1435 | { |
|
- | 1436 | Changepos--; |
|
- | 1437 | line = Changepos/2; |
|
- | 1438 | if(Changepos< 1 ) {Changepos=16;} |
|
- | 1439 | } |
|
- | 1440 | else |
|
- | 1441 | if(HottKeyboard == HOTT_KEY_DOWN) |
|
- | 1442 | { |
|
- | 1443 | Changepos++; |
|
- | 1444 | line = Changepos/2; |
|
- | 1445 | if(Changepos >= 17 ) {Changepos=1;} |
|
- | 1446 | } |
|
- | 1447 | } |
|
- | 1448 | else |
|
- | 1449 | { |
|
- | 1450 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
|
- | 1451 | else |
|
- | 1452 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
|
- | 1453 | else |
|
- | 1454 | if(HottKeyboard == HOTT_KEY_UP ) |
|
- | 1455 | { |
|
- | 1456 | j-=16; |
|
- | 1457 | line = 0; |
|
- | 1458 | if(j< 0 ) {j=0;} |
|
- | 1459 | } |
|
- | 1460 | else |
|
- | 1461 | if(HottKeyboard == HOTT_KEY_DOWN) |
|
- | 1462 | { |
|
- | 1463 | LIBFC_HoTT_Clear(); |
|
- | 1464 | j+=16; |
|
- | 1465 | line = 0; |
|
- | 1466 | if(j+14> MAXPARAM ) {j=MAXPARAM-15;} |
|
- | 1467 | } |
|
- | 1468 | } |
|
- | 1469 | |
|
- | 1470 | Debug("line=%i Changepos=%i j=%i Key=%i",line,Changepos,j,HottKeyboard); |
|
- | 1471 | HottKeyboard = 0; |
|
- | 1472 | } |
|
- | 1473 | |
|
- | 1474 | HoTT_printfxy(10 ,line,"I"); |
|
- | 1475 | i=(line*2)+(j); |
|
- | 1476 | if(Changepos==(line*2)+1) |
|
- | 1477 | { |
|
- | 1478 | HoTT_printfxy(0 ,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i ].Variable + Parameter_List[i ].offset),&Parameter_List[i ].name); |
|
- | 1479 | } |
|
- | 1480 | else |
|
- | 1481 | { |
|
- | 1482 | HoTT_printfxy(0 ,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i ].Variable + Parameter_List[i ].offset),&Parameter_List[i ].name); |
|
- | 1483 | } |
|
- | 1484 | if(Changepos==(line*2)+2) |
|
- | 1485 | { |
|
- | 1486 | HoTT_printfxy(11,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name); |
|
- | 1487 | } |
|
- | 1488 | else |
|
- | 1489 | { |
|
- | 1490 | HoTT_printfxy(11,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name); |
|
- | 1491 | } |
|
- | 1492 | ||
- | 1493 | line++; |
|
- | 1494 | |
|
- | 1495 | } |
|
- | 1496 | break; |
|
- | 1497 | case 11: |
|
- | 1498 | switch(line++) |
|
- | 1499 | { |
|
- | 1500 | case 0: HoTT_printfxy(0,0,"Setting speichern"); |
|
- | 1501 | break; |
|
- | 1502 | case 1: HoTT_printfxy(0,1,"Setting%1i= %-11.11s",GetActiveParamSet(),EE_Parameter.Name); |
|
- | 1503 | break; //123456789012345678901 |
|
- | 1504 | case 2: HoTT_printfxy(0,2,"Speichern nach Set %i",settingdest); |
|
- | 1505 | break; |
|
- | 1506 | case 3: HoTT_printfxy(0,4,"\"SET\" zum speichern"); |
|
- | 1507 | break; |
|
- | 1508 | case 4: HoTT_printfxy(0,5,"^ v zum auswaehlen"); |
|
- | 1509 | break; |
|
- | 1510 | case 5: HoTT_printfxy(0,6," HOTT+ sponsored by "); |
|
- | 1511 | break; |
|
- | 1512 | case 6: HoTT_printfxy(0,7,"--- Flyinghigh.ch ---"); |
|
- | 1513 | break; |
|
- | 1514 | case 7: |
|
- | 1515 | case 8: |
|
- | 1516 | case 9: |
|
- | 1517 | case 10: |
|
- | 1518 | case 11: |
|
- | 1519 | case 12: |
|
- | 1520 | case 13: |
|
- | 1521 | case 14: |
|
- | 1522 | case 15: |
|
- | 1523 | case 16: |
|
- | 1524 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
|
- | 1525 | else |
|
- | 1526 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
|
- | 1527 | else |
|
- | 1528 | if((HottKeyboard == HOTT_KEY_UP) & (settingdest <5 )) settingdest++; |
|
- | 1529 | else |
|
- | 1530 | if((HottKeyboard == HOTT_KEY_DOWN) & (settingdest >1 )) settingdest--; |
|
- | 1531 | else |
|
- | 1532 | if((HottKeyboard == HOTT_KEY_SET) && !MotorenEin) |
|
- | 1533 | { |
|
- | 1534 | ParamSet_WriteToEEProm(settingdest); |
|
- | 1535 | //JetiBeep = jetibeepcode[GetActiveParamSet()-1]; |
|
- | 1536 | Piep(GetActiveParamSet(),120); |
|
- | 1537 | HoTT_printfxy(0,7,"Gespeichert!"); |
|
- | 1538 | } |
|
- | 1539 | HottKeyboard = 0; |
|
- | 1540 | break; |
|
- | 1541 | default: line = 0; |
|
- | 1542 | break; |
|
- | 1543 | } |
|
- | 1544 | break; |
|
- | 1545 | //------------------------------------------------------------------------------------------ |
|
- | 1546 | // HoTT-Plus |
|
- | 1547 | //------------------------------------------------------------------------------------------ |
|
- | 1548 | */ |
|
1077 | default: page = 0; |
1549 | default: page = 0; |
1078 | break; |
1550 | break; |
1079 | } |
1551 | } |
1080 | } |
1552 | } |