Rev 383 | Rev 386 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 383 | Rev 385 | ||
---|---|---|---|
Line 140... | Line 140... | ||
140 | 140 | ||
141 | /** |
141 | /** |
142 | * timer kicks in every 1000uS ^= 1ms |
142 | * timer kicks in every 1000uS ^= 1ms |
143 | */ |
143 | */ |
144 | ISR(TIMER0_OVF_vect) { |
144 | ISR(TIMER0_OVF_vect) { |
145 | OCR0 = 6; // preload |
145 | OCR0 = 15; // preload |
146 | if (!timer--) { |
146 | if (!timer--) { |
147 | uptime++; |
147 | uptime++; |
148 | timer = 999; |
148 | timer = 999; |
149 | seconds_since_last_data++; |
149 | seconds_since_last_data++; |
Line 619... | Line 619... | ||
619 | // init usart |
619 | // init usart |
620 | usart1_init(); |
620 | usart1_init(); |
Line 621... | Line 621... | ||
621 | 621 | ||
622 | // set up timer |
622 | // set up timer |
623 | TCCR0 |= (1 << CS00) | (1 << CS01); // timer0 prescaler 64 |
623 | TCCR0 |= (1 << CS00) | (1 << CS01); // timer0 prescaler 64 |
624 | OCR0 = 6; // preload |
624 | OCR0 = 15; // preload |
Line 625... | Line 625... | ||
625 | TIMSK |= (1 << TOIE0); // enable overflow timer0 |
625 | TIMSK |= (1 << TOIE0); // enable overflow timer0 |
626 | 626 | ||
627 | // enable interrupts |
627 | // enable interrupts |
Line 669... | Line 669... | ||
669 | 669 | ||
670 | // request OSD Data from NC every 100ms |
670 | // request OSD Data from NC every 100ms |
Line 671... | Line 671... | ||
671 | usart1_request_mk_data(1, 'o', 100); |
671 | usart1_request_mk_data(1, 'o', 100); |
672 | 672 | ||
Line 673... | Line 673... | ||
673 | // and disable debug... |
673 | // and disable debug... |
674 | //usart1_request_mk_data(0, 'd', 0); |
674 | usart1_request_mk_data(0, 'd', 0); |
Line 675... | Line 675... | ||
675 | 675 | ||
Line 696... | Line 696... | ||
696 | //write_ndigit_number_u(2,2, heading_fine_conv(45), 100, 0); |
696 | //write_ndigit_number_u(2,2, heading_fine_conv(45), 100, 0); |
Line 697... | Line 697... | ||
697 | 697 | ||
698 | while (1) { |
698 | while (1) { |
699 | // write icons at init or after menu/mode-switch |
699 | // write icons at init or after menu/mode-switch |
700 | if (!(COSD_FLAGS & COSD_ICONS_WRITTEN) && (COSD_FLAGS & COSD_FLAG_HUD)) { |
700 | if (!(COSD_FLAGS & COSD_ICONS_WRITTEN) && (COSD_FLAGS & COSD_FLAG_HUD)) { |
701 | write_char_xy(5, top_line, 203); // km/h |
701 | write_char_xy(5, top_line, 0xCB); // km/h |
702 | write_char_xy(10, top_line, 202); // RC-transmitter |
702 | write_char_xy(10, top_line, 0xCA); // RC-transmitter |
703 | write_char_xy(16, top_line, 208); // degree symbol |
703 | write_char_xy(16, top_line, 0xD0); // degree symbol |
704 | write_char_xy(27, top_line, 204); // small meters m height |
704 | write_char_xy(27, top_line, 0xCC); // small meters m height |
705 | write_char_xy(20, top_line+1, 0xb0); // left circle |
705 | write_char_xy(20, top_line+1, 0xB0); // left circle |
706 | write_char_xy(22, top_line+1, 0xb2); // right circle |
706 | write_char_xy(22, top_line+1, 0xB2); // right circle |
707 | write_char_xy(27, top_line+1, 204); // small meters m home |
707 | write_char_xy(27, top_line+1, 0xCC); // small meters m home |
708 | //write_ascii_string(6, bottom_line, "V"); // voltage |
708 | write_char_xy(7, bottom_line, 0x9E); // small v |
709 | write_char_xy(14, bottom_line, 209); // on clock |
709 | write_char_xy(14, bottom_line, 0xD1); // on clock |
710 | write_char_xy(22, bottom_line, 210); // fly clock |
710 | write_char_xy(22, bottom_line, 0xD2); // fly clock |
711 | write_char_xy(26, bottom_line, 200); // sat1 |
711 | write_char_xy(26, bottom_line, 0xC8); // sat1 |
712 | write_char_xy(27, bottom_line, 201); // sat2 |
712 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
713 | COSD_FLAGS |= COSD_ICONS_WRITTEN; |
713 | COSD_FLAGS |= COSD_ICONS_WRITTEN; |
714 | } |
714 | } |
715 | if (rxd_buffer_locked) { |
715 | if (rxd_buffer_locked) { |
716 | if (COSD_FLAGS & COSD_FLAG_HUD) { |
716 | if (COSD_FLAGS & COSD_FLAG_HUD) { |
Line 804... | Line 804... | ||
804 | if (COSD_FLAGS & COSD_FLAG_BIGVARIO) { |
804 | if (COSD_FLAGS & COSD_FLAG_BIGVARIO) { |
805 | draw_big_variometer(27, 8, naviData.Variometer); |
805 | draw_big_variometer(27, 8, naviData.Variometer); |
806 | } |
806 | } |
Line 807... | Line 807... | ||
807 | 807 | ||
- | 808 | // bottom line |
|
808 | // bottom line |
809 | draw_battery(2, bottom_line, naviData.UBat); |
809 | write_ndigit_number_u_10th(2, bottom_line, naviData.UBat, 100, 0); |
810 | write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 100, 0); |
810 | if (naviData.UBat <= UBAT_WRN && last_UBat > UBAT_WRN) { |
811 | if (naviData.UBat <= UBAT_WRN && last_UBat > UBAT_WRN) { |
811 | for (uint8_t x = 0; x < 7; x++) |
812 | for (uint8_t x = 2; x < 8; x++) |
812 | write_char_att_xy(x, bottom_line, BLINK); |
813 | write_char_att_xy(x, bottom_line, BLINK); |
813 | } else { |
814 | } else { |
814 | for (uint8_t x = 0; x < 7; x++) |
815 | for (uint8_t x = 2; x < 8; x++) |
815 | write_char_att_xy(x, bottom_line, 0); |
816 | write_char_att_xy(x, bottom_line, 0); |
816 | } |
- | |
- | 817 | } |
|
Line 817... | Line 818... | ||
817 | draw_battery(6, bottom_line, naviData.UBat); |
818 | |
818 | 819 | ||
Line 819... | Line 820... | ||
819 | write_time(8, bottom_line, uptime); |
820 | write_time(8, bottom_line, uptime); |