Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 953 → Rev 954

/C-OSD/trunk/CHANGE.LOG
18,6 → 18,9
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
20110604-1615
+really ugly (untested) hack to get ACT DSL RSSI information in FC-Only mode
 
20110523-1635
*fixed statistics-accumulation in minimal-screen.
 
/C-OSD/trunk/main.c
341,7 → 341,6
// enable interrupts
sei();
 
 
//write_ascii_string(2,7, " CaScAdE");
//write_ascii_string(2,8, "is TESTING his open source");
//write_ascii_string(2,9, "EPi OSD Firmware");
451,8 → 450,6
usart0_puts(conv_array);
usart0_puts("\r\n");
#endif
 
 
rxd_buffer_locked = 0;
}
// handle keypress
/C-OSD/trunk/main.h
54,6 → 54,8
#define FCONLY 0 // set to 1 if you do NOT have a NaviCtrl and the OSD is
#endif // connected to the FC directly
 
//#define ACT_RSSI_FROM_LCD 1 // set to 1 to get the ACT RSSI from the FC-LCD in FC-Only mode... Really dirty!
 
#define HUD 1 // set to 0 to disable HUD by default
#define ARTHORIZON 0 // set to 1 to enable roll&nick artificial horizon by default
#define BIGVARIO 0 // set to 1 to enable the big vario bar on right side
/C-OSD/trunk/osd_fcmode_default.c
22,10 → 22,16
#include "max7456_software_spi.h"
#include "osd_helpers.h"
#include "osd_fcmode_default.h"
#include "usart1.h"
 
#if (!(ALLCHARSDEBUG || (WRITECHARS != -1)) && FCONLY)
 
int osd_fcmode_default() {
static signed int rc_quality = 0;
#ifndef ACT_RSSI_FROM_LCD
rc_quality = debugData.Analog[10];
#endif
 
if (COSD_FLAGS_MODES & COSD_FLAG_HUD) {
// write icons at init or after menu/mode-switch
if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) {
42,11 → 48,11
COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN;
}
 
write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0);
if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
write_ndigit_number_u(7, top_line, rc_quality, 3, 0);
if (rc_quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, BLINK);
} else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
} else if (rc_quality > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) {
for (uint8_t x = 0; x < 4; x++)
write_char_att_xy(7 + x, top_line, 0);
}
97,7 → 103,27
debugData.Analog[11]);// Gyro compass
*/
seconds_since_last_data = 0;
//
 
// really dirty way to get the RSSI out of the display
#ifdef ACT_RSSI_FROM_LCD
#define REQUEST_FC_LCD_8 "#al?===Dc\r"
usart1_request_blocking('L', PSTR(REQUEST_FC_LCD_8));
char* str = ((char*)pRxData) + 2;
/*
write_ascii_string_len(2, 5, str, 20);
write_ascii_string_len(2, 6, str + 20, 20);
write_ascii_string_len(2, 7, str + 40, 20);
write_ascii_string_len(2, 8, str + 60, 20);
*/
uint8_t rssi_index = 30; // middle of 2nd line
while (str[rssi_index] == 0) rssi_index++;
int lcd_rssi = atoi(str[rssi_index]);
write_ndigit_number_u(7, top_line, lcd_rssi, 3, 0);
rc_quality = lcd_rssi;
 
#endif
 
return 0;
}
 
/C-OSD/trunk/usart1.c
23,6 → 23,7
#include <avr/interrupt.h>
#include <util/delay.h>
#include "usart1.h"
#include "max7456_software_spi.h"
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
127,7 → 128,7
 
if ((c2 == '#') && (c1 == 'b' || c1 == 'c') &&
#if FCONLY
(c == 'V' || c == 'D' || c == 'Q')) { // version, debug, settings
(c == 'V' || c == 'D' || c == 'Q' || c == 'L')) { // version, debug, settings, LCD
#else
(c == 'V' || c == 'O' || c == 'Q')) { // version, OSD, settings
#endif
217,8 → 218,8
* Request Data through usart1 until a answer is received
*/
void usart1_request_blocking(unsigned char answer, const char* message) {
rxd_buffer[2] = answer + 1;
while (rxd_buffer[2] != answer) {
rxd_buffer[2] = answer + 1; // unvalidate answer
while (rxd_buffer[2] != answer || (rxd_buffer_locked != 1)) {
rxd_buffer_locked = 0;
usart1_EnableTXD();
usart1_puts_pgm(message);
229,6 → 230,7
wait++;
_delay_ms(50);
}
_delay_ms(100);
}
Decode64();
}