Rev 471 | Rev 477 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 471 | Rev 474 | ||
---|---|---|---|
Line 161... | Line 161... | ||
161 | DDRC &= ~(1 << PC4); // PC4 input (MODE) |
161 | DDRC &= ~(1 << PC4); // PC4 input (MODE) |
162 | PORTC |= (1 << PC4); // pullup |
162 | PORTC |= (1 << PC4); // pullup |
163 | DDRC &= ~(1 << PC5); // PC5 input (SET) |
163 | DDRC &= ~(1 << PC5); // PC5 input (SET) |
164 | PORTC |= (1 << PC5); // pullup |
164 | PORTC |= (1 << PC5); // pullup |
Line 165... | Line -... | ||
165 | - | ||
166 | // set up top and bottom lines |
- | |
167 | if (COSD_FLAGS & COSD_FLAG_NTSC) { |
- | |
168 | bottom_line = 12; |
- | |
169 | } else { |
- | |
170 | bottom_line = 14; |
- | |
171 | } |
- | |
172 | 165 | ||
173 | // reset the MAX7456 to be sure any undefined states do no harm |
166 | // reset the MAX7456 to be sure any undefined states do no harm |
174 | MAX_RESET_LOW |
167 | MAX_RESET_LOW |
Line 175... | Line 168... | ||
175 | MAX_RESET_HIGH |
168 | MAX_RESET_HIGH |
176 | 169 | ||
177 | // give the FC/NC and the maxim time to come up |
170 | // give the FC/NC and the maxim time to come up |
178 | LED4_ON |
- | |
179 | _delay_ms(2000); |
171 | LED4_ON |
Line 180... | Line -... | ||
180 | - | ||
181 | LED4_OFF |
172 | _delay_ms(2000); |
182 | 173 | LED4_OFF |
|
183 | 174 | ||
184 | //Pushing NEW chars to the MAX7456 |
175 | //Pushing NEW chars to the MAX7456 |
185 | #if (WRITECHARS != -1) |
176 | #if (WRITECHARS != -1) |
- | 177 | // DISABLE display (VM0) |
|
- | 178 | spi_send_byte(0x00, 0b00000000); |
|
- | 179 | #include "characters.c" |
|
186 | // DISABLE display (VM0) |
180 | #else |
Line 187... | Line 181... | ||
187 | spi_send_byte(0x00, 0b00000000); |
181 | // read out config for NTSC/PAL distinguishing |
188 | #include "characters.c" |
182 | get_eeprom(0); |
189 | #endif |
183 | #endif |
190 | 184 | ||
- | 185 | // Setup Video Mode |
|
- | 186 | if (COSD_FLAGS & COSD_FLAG_NTSC) { |
|
191 | // Setup Video Mode |
187 | // NTSC + enable display immediately (VM0) |
192 | if (COSD_FLAGS & COSD_FLAG_NTSC) { |
188 | spi_send_byte(0x00, 0b00001000); |
193 | // NTSC + enable display immediately (VM0) |
189 | |
- | 190 | bottom_line = 12; |
|
- | 191 | } else { |
|
194 | spi_send_byte(0x00, 0b00001000); |
192 | // PAL + enable display immediately (VM0) |
Line 195... | Line 193... | ||
195 | } else { |
193 | spi_send_byte(0x00, 0b01001000); |
196 | // PAL + enable display immediately (VM0) |
194 | |
Line 197... | Line 195... | ||
197 | spi_send_byte(0x00, 0b01001000); |
195 | bottom_line = 14; |
Line 282... | Line 280... | ||
282 | ampere_wasted |= spi_cmd_buffer[6]; |
280 | ampere_wasted |= spi_cmd_buffer[6]; |
283 | //ampere = *((int16_t *) spi_cmd_buffer + 1); |
281 | //ampere = *((int16_t *) spi_cmd_buffer + 1); |
284 | //ampere_wasted = *((int32_t *) &spi_cmd_buffer + 3); |
282 | //ampere_wasted = *((int32_t *) &spi_cmd_buffer + 3); |
285 | // if this is the first receival we should print the small A |
283 | // if this is the first receival we should print the small A |
286 | if (!(COSD_FLAGS2 & COSD_FLAG_STROMREC)) { |
284 | if (!(COSD_FLAGS2 & COSD_FLAG_STROMREC)) { |
- | 285 | clear(); |
|
287 | COSD_FLAGS2 &= ~COSD_ICONS_WRITTEN; |
286 | COSD_FLAGS2 &= ~COSD_ICONS_WRITTEN; |
288 | // update this flag |
287 | // update this flag |
289 | COSD_FLAGS2 |= COSD_FLAG_STROMREC; |
288 | COSD_FLAGS2 |= COSD_FLAG_STROMREC; |
290 | } |
289 | } |
291 | //write_ascii_char(8+4*30, 'v'); // valid |
290 | //write_ascii_char(8+4*30, 'v'); // valid |