Skip to content

Commit

Permalink
Cometics
Browse files Browse the repository at this point in the history
Empty Nickname
"No connection to KISS FC" message
  • Loading branch information
awolf78 committed Jan 2, 2017
1 parent 8c2b403 commit 872af05
Show file tree
Hide file tree
Showing 9 changed files with 878 additions and 874 deletions.
17 changes: 10 additions & 7 deletions KISS_OSD/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ void CSettings::LoadDefaults()
m_xOffset = 0; // Center OSD offsets
m_yOffset = 0;
m_stats = 1;
m_DISPLAY_DV[DISPLAY_NICKNAME] = 3;
m_DISPLAY_DV[DISPLAY_NICKNAME] = 8;
m_DISPLAY_DV[DISPLAY_TIMER] = 2;
m_DISPLAY_DV[DISPLAY_RC_THROTTLE] = 7;
m_DISPLAY_DV[DISPLAY_COMB_CURRENT] = 5;
m_DISPLAY_DV[DISPLAY_COMB_CURRENT] = 4;
m_DISPLAY_DV[DISPLAY_LIPO_VOLTAGE] = 0;
m_DISPLAY_DV[DISPLAY_MA_CONSUMPTION] = 1;
m_DISPLAY_DV[DISPLAY_ESC_KRPM] = 4;
m_DISPLAY_DV[DISPLAY_ESC_CURRENT] = 6;
m_DISPLAY_DV[DISPLAY_ESC_TEMPERATURE] = 8;
strcpy(m_nickname, "nickname");
m_nickname[8] = 0x00;
m_DISPLAY_DV[DISPLAY_ESC_KRPM] = 3;
m_DISPLAY_DV[DISPLAY_ESC_CURRENT] = 5;
m_DISPLAY_DV[DISPLAY_ESC_TEMPERATURE] = 6;
uint8_t i;
for(i=0; i < NICKNAME_STR_SIZE; i++)
{
m_nickname[i] = 0x00;
}
m_OSDItems[ESC1kr][0] = 0;
m_OSDItems[ESC1kr][1] = 1;
m_OSDItems[ESC1voltage][0] = 0;
Expand Down
2 changes: 1 addition & 1 deletion KISS_OSD/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// vTx config
//=============================
#define IMPULSERC_VTX
//#define IMPULSERC_VTX

#ifdef IMPULSERC_VTX
# define MAX7456RESET 9 // RESET
Expand Down
28 changes: 22 additions & 6 deletions KISS_OSD/KISS_OSD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static boolean fcSettingChanged = false;
static void* activePage = NULL;
static boolean batterySelect = false;
static boolean shiftOSDactive = false;
static boolean triggerCleanScreen = false;
static boolean triggerCleanScreen = true;
static uint8_t activeMenuItem = 0;
static uint8_t stopWatch = 0x94;
static char batterySymbol[] = { 0xE7, 0xEC, 0xEC, 0xED, 0x00 };
Expand All @@ -302,6 +302,8 @@ static uint8_t currentDVItem = 0;
static bool symbolOnOffChanged = false;
static int16_t bufminus1 = 0;
static int16_t checkCalced = 0;
static uint16_t fcNotConnectedCount = 0;
static bool telemetryReceived = false;

#ifdef DEBUG
static int16_t versionProto = 0;
Expand Down Expand Up @@ -361,39 +363,53 @@ void loop(){
{
NewSerial.write(0x30); // request settings
ReadFCSettings(fcSettingChanged);
if(!fcSettingsReceived) fcNotConnectedCount++;
else fcNotConnectedCount = 0;
#ifdef PROTODEBUG
if(checkCalced != bufminus1)
{
OSD.printInt16(8, -4, checkCalced, 0, 1);
OSD.printInt16(8, -3, bufminus1, 0, 1);
}
#endif
return;
}
else
{
if(!fcSettingChanged || menuActive)
{
NewSerial.write(0x20); // request telemetry
}
if(!ReadTelemetry())
telemetryReceived = ReadTelemetry();
if(!telemetryReceived)
{
if(fcSettingChanged && !menuActive)
{
SendFCSettings();
fcSettingChanged = false;
}
else fcNotConnectedCount++;
#ifdef DEBUG
/*static char Aux1[15];
OSD.setCursor(8,-3);
OSD.print(fixStr("tele"));*/
#endif
return;
}
}
else fcNotConnectedCount = 0;
}

if(fcNotConnectedCount <= 500 && (!fcSettingsReceived || !telemetryReceived)) return;

while (!OSD.notInVSync());

if(fcNotConnectedCount > 500)
{
FLASH_STRING(FC_NOT_CONNECTED_STR, "no connection to kiss fc");
OSD.printFS(COLS/2 - FC_NOT_CONNECTED_STR.length()/2, ROWS/2, &FC_NOT_CONNECTED_STR);
triggerCleanScreen = true;
fcNotConnectedCount = 0;
return;
}

#ifdef IMPULSERC_VTX
/*if(changevTxTime > 0)
{
Expand Down Expand Up @@ -507,7 +523,7 @@ void loop(){
}
}

if(batterySelect || (!menuActive && !armOnYaw && yaw > 1750 && armed == 0))
if(batterySelect || (!menuActive && !armOnYaw && (code & inputChecker.YAW_RIGHT) && armed == 0))
{
if(!showBat)
{
Expand Down
17 changes: 10 additions & 7 deletions KISS_OSD_CONFIG/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ void CSettings::LoadDefaults()
m_xOffset = 0; // Center OSD offsets
m_yOffset = 0;
m_stats = 1;
m_DISPLAY_DV[DISPLAY_NICKNAME] = 3;
m_DISPLAY_DV[DISPLAY_NICKNAME] = 8;
m_DISPLAY_DV[DISPLAY_TIMER] = 2;
m_DISPLAY_DV[DISPLAY_RC_THROTTLE] = 7;
m_DISPLAY_DV[DISPLAY_COMB_CURRENT] = 5;
m_DISPLAY_DV[DISPLAY_COMB_CURRENT] = 4;
m_DISPLAY_DV[DISPLAY_LIPO_VOLTAGE] = 0;
m_DISPLAY_DV[DISPLAY_MA_CONSUMPTION] = 1;
m_DISPLAY_DV[DISPLAY_ESC_KRPM] = 4;
m_DISPLAY_DV[DISPLAY_ESC_CURRENT] = 6;
m_DISPLAY_DV[DISPLAY_ESC_TEMPERATURE] = 8;
strcpy(m_nickname, "nickname");
m_nickname[8] = 0x00;
m_DISPLAY_DV[DISPLAY_ESC_KRPM] = 3;
m_DISPLAY_DV[DISPLAY_ESC_CURRENT] = 5;
m_DISPLAY_DV[DISPLAY_ESC_TEMPERATURE] = 6;
uint8_t i;
for(i=0; i < NICKNAME_STR_SIZE; i++)
{
m_nickname[i] = 0x00;
}
m_OSDItems[ESC1kr][0] = 0;
m_OSDItems[ESC1kr][1] = 1;
m_OSDItems[ESC1voltage][0] = 0;
Expand Down
4 changes: 3 additions & 1 deletion KISS_OSD_CONFIG/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// vTx config
//=============================
#define IMPULSERC_VTX
//#define IMPULSERC_VTX
#ifdef IMPULSERC_VTX
# define MAX7456RESET 9 // RESET
#endif
Expand All @@ -23,4 +23,6 @@ static const uint8_t ROWS = MAX7456_ROWS_N0;
static const uint8_t COLS = MAX7456_COLS_N1;
#endif

//#define UPDATE_FONT_ONLY

#endif
Loading

0 comments on commit 872af05

Please sign in to comment.