Subversion Repositories Projects

Rev

Rev 1804 | Rev 1866 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1804 Rev 1805
Line 131... Line 131...
131
 
131
 
Line 132... Line 132...
132
paramset_serial setting;
132
paramset_serial setting;
133
 
133
 
-
 
134
//#define NOFCOMMUNICATION
-
 
135
#ifndef NOFCOMMUNICATION
-
 
136
    usart1_request_blocking('Q', PSTR(REQUEST_CURRENT_SETTING));
-
 
137
        memcpy((char*)(&setting), (char*)pRxData, sizeof(paramset_serial));
-
 
138
    //setting = *((paramset_serial*)pRxData);
-
 
139
#else 
-
 
140
        // manual stuff?        
-
 
141
        memcpy((char*)setting.param.Name, "NO FC COMMUN", 12);
-
 
142
        setting.param.UnterspannungsWarnung = 94;
-
 
143
#endif // #ifndef NOFCOMMUNICATION
Line -... Line 144...
-
 
144
    //write_ascii_char(4 + 12 * 30, rxd_buffer[2]);
-
 
145
 
-
 
146
   
-
 
147
 
-
 
148
    write_ndigit_number_u(10, 7, setting.SettingsIndex, 1, 1);
-
 
149
    write_ascii_string_len(13, 7, setting.param.Name, 12);
-
 
150
 
-
 
151
    uint8_t cells = 0;
-
 
152
    if (CELL_NUM == -1) {
-
 
153
#define MAX_CELL_VOLTAGE 43 // max cell volatage for LiPO
-
 
154
 
-
 
155
        if (setting.param.UnterspannungsWarnung < 50) {
-
 
156
            // up to 6s LiPo, less than 2s is technical impossible
-
 
157
            for (cells = 2; cells < 7; cells++) {
-
 
158
                if (UBat < cells * MAX_CELL_VOLTAGE) break;
-
 
159
            }
-
 
160
 
-
 
161
            min_voltage = cells * setting.param.UnterspannungsWarnung;
-
 
162
        } else {
-
 
163
            min_voltage = setting.param.UnterspannungsWarnung;
-
 
164
            cells = min_voltage / CELL_VOLT_MIN;
-
 
165
        }
-
 
166
        //write_ndigit_number_u(10, 13, setting.param.UnterspannungsWarnung, 3, 1);
-
 
167
    } else {
-
 
168
        cells = CELL_NUM;
-
 
169
        min_voltage = cells * CELL_VOLT_MIN;
-
 
170
    }
-
 
171
 
-
 
172
    max_voltage = cells * CELL_VOLT_MAX;
-
 
173
 
-
 
174
    write_ndigit_number_u(11, 8, cells, 1, 0);
Line 134... Line 175...
134
//#define NOFCOMMUNICATION
175
    write_ndigit_number_s_10th(8, 9, min_voltage, 3, 0);
135
#ifndef NOFCOMMUNICATION
176
    write_ndigit_number_s_10th(20, 9, max_voltage, 3, 0);
136
   
177
 
137
 
178
 
138
 
179
 
139
    // request version from board
180
    // request version from board
140
#if FCONLY
181
#if FCONLY
141
    //usart1_request_mk_data(0, 'v', 0);
182
    //usart1_request_mk_data(0, 'v', 0);
142
    write_ascii_string_pgm(2, 11, PSTR("FC VERSION: ........"));
183
    write_ascii_string_pgm(2, 11, PSTR("FC VERSION: ........"));