Subversion Repositories FlightCtrl

Rev

Rev 1805 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1805 Rev 1821
Line 79... Line 79...
79
 
79
 
80
#define DISPLAYBUFFSIZE 80
80
#define DISPLAYBUFFSIZE 80
81
int8_t DisplayBuff[DISPLAYBUFFSIZE] = "Hello World";
81
int8_t DisplayBuff[DISPLAYBUFFSIZE] = "Hello World";
Line 82... Line -...
82
uint8_t DispPtr = 0;
-
 
83
 
82
uint8_t DispPtr = 0;
84
 
83
 
85
/************************************/
84
/************************************/
86
/*        Clear LCD Buffer          */
85
/*        Clear LCD Buffer          */
87
/************************************/
86
/************************************/
88
void LCD_Clear(void) {
87
void LCD_Clear(void) {
-
 
88
        uint8_t i;
89
 uint8_t i;
89
        for (i = 0; i < DISPLAYBUFFSIZE; i++)
Line 90... Line -...
90
 for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' ';
-
 
91
}
90
                DisplayBuff[i] = ' ';
92
 
91
}
93
 
92
 
94
/************************************/
93
/************************************/
95
/*        Update Menu on LCD        */
94
/*        Update Menu on LCD        */
96
/************************************/
95
/************************************/
97
// Display with 20 characters in 4 lines
96
// Display with 20 characters in 4 lines
-
 
97
void LCD_PrintMenu(void) {
-
 
98
        if (RemoteKeys & KEY1) {
98
void LCD_PrintMenu(void) {
99
                if (MenuItem)
99
  if(RemoteKeys & KEY1) {
100
                        MenuItem--;
Line 100... Line 101...
100
    if(MenuItem) MenuItem--;
101
                else
101
    else MenuItem = MaxMenuItem;
102
                        MenuItem = MaxMenuItem;
-
 
103
        }
-
 
104
 
102
  }
105
        if (RemoteKeys & KEY2) {
103
 
106
                if (MenuItem == MaxMenuItem)
104
  if(RemoteKeys  & KEY2) {
107
                        MenuItem = 0;
-
 
108
                else
Line 105... Line 109...
105
    if(MenuItem == MaxMenuItem) MenuItem = 0;
109
                        MenuItem++;
Line 106... Line 110...
106
    else MenuItem++;
110
        }
-
 
111
        if ((RemoteKeys & KEY1) && (RemoteKeys & KEY2))
107
  }
112
                MenuItem = 0;
108
  if((RemoteKeys  & KEY1) && (RemoteKeys  & KEY2)) MenuItem = 0;
113
 
109
 
114
        LCD_Clear();
110
  LCD_Clear();
115
 
111
 
116
        if (MenuItem > MaxMenuItem)
112
  if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem;
117
                MenuItem = MaxMenuItem;
Line 113... Line 118...
113
  // print menu item number in the upper right corner
118
        // print menu item number in the upper right corner
114
  if(MenuItem < 10) {
119
        if (MenuItem < 10) {
115
    LCD_printfxy(17,0,"[%i]",MenuItem);
120
                LCD_printfxy(17,0,"[%i]",MenuItem);
-
 
121
        } else {
116
  } else {
122
                LCD_printfxy(16,0,"[%i]",MenuItem);
-
 
123
        }
117
    LCD_printfxy(16,0,"[%i]",MenuItem);
124
 
-
 
125
        switch (MenuItem) {
118
  }
126
        case 0:// Version Info Menu Item
119
 
127
                LCD_printfxy(0,0,"+ MikroKopter +")
120
  switch(MenuItem) {
128
                ;
121
  case 0:// Version Info Menu Item
129
                LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",BoardRelease/10,BoardRelease%10,VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a')
122
    LCD_printfxy(0,0,"+ MikroKopter +");
-
 
123
    LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",BoardRelease/10,BoardRelease%10,VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a');
130
                ;
124
    LCD_printfxy(0,2,"Setting: %d %s", getActiveParamSet(), Mixer.Name);
131
                LCD_printfxy(0,2,"Setting: %d %s", getActiveParamSet(), Mixer.Name)
125
    if(I2CTimeout < 6) {
132
                ;
126
      LCD_printfxy(0,3,"I2C Error!!!");
133
                if (I2CTimeout < 6) {
127
    } else if (missingMotor) {
134
                        LCD_printfxy(0,3,"I2C Error!!!");
128
      LCD_printfxy(0,3,"Missing BL-Ctrl:%d", missingMotor);
135
                } else if (missingMotor) {
Line 235... Line 242...
235
  case 13://BL Overview
242
        case 13://BL Overview
236
    LCD_printfxy(0,0,"BL-Ctrl found " );
243
                LCD_printfxy(0,0,"BL-Ctrl found " );
237
    LCD_printfxy(0,1," %c   %c   %c   %c ",motor[0].Present + '-',motor[1].Present + '-',motor[2].Present + '-',motor[3].Present + '-');
244
                LCD_printfxy(0,1," %c   %c   %c   %c ",motor[0].Present + '-',motor[1].Present + '-',motor[2].Present + '-',motor[3].Present + '-');
238
    LCD_printfxy(0,2," %c   %c   %c   %c ",motor[4].Present + '-',motor[5].Present + '-',motor[6].Present + '-',motor[7].Present + '-');
245
                LCD_printfxy(0,2," %c   %c   %c   %c ",motor[4].Present + '-',motor[5].Present + '-',motor[6].Present + '-',motor[7].Present + '-');
239
    LCD_printfxy(0,3," %c   -   -   - ",motor[8].Present + '-');
246
                LCD_printfxy(0,3," %c   -   -   - ",motor[8].Present + '-');
-
 
247
                if (motor[9].Present)
240
    if(motor[9].Present)  LCD_printfxy(4,3,"10");
248
                        LCD_printfxy(4,3,"10");
-
 
249
                if (motor[10].Present)
241
    if(motor[10].Present) LCD_printfxy(8,3,"11");
250
                        LCD_printfxy(8,3,"11");
-
 
251
                if (motor[11].Present)
242
    if(motor[11].Present) LCD_printfxy(12,3,"12");
252
                        LCD_printfxy(12,3,"12");
243
    break;
253
                break;
Line 244... Line 254...
244
   
254
 
245
#if (defined (USE_NAVICTRL))
255
#if (defined (USE_NAVICTRL))
246
  case 14://GPS Lat/Lon coords
256
                case 14://GPS Lat/Lon coords