Skip to content

Commit

Permalink
Add new symbols to max7456_symbols.h (#8138)
Browse files Browse the repository at this point in the history
Add new symbols to max7456_symbols.h
  • Loading branch information
mikeller committed May 4, 2019
2 parents bcac7f2 + 6885d27 commit 9554415
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
18 changes: 13 additions & 5 deletions src/main/drivers/max7456_symbols.h
Expand Up @@ -25,6 +25,14 @@
#define SYM_END_OF_FONT 0xFF
#define SYM_BLANK 0x20
#define SYM_COLON 0x2D
#define SYM_BBLOG 0x10
//#define SYM_HOMEFLAG 0x11
//#define SYM_RPM 0x12
#define SYM_ROLL 0x14
#define SYM_PITCH 0x15
#define SYM_TEMPERATURE 0x7A
#define SYM_LAT 0x89
#define SYM_LON 0x98

// RSSI
#define SYM_RSSI 0x01
Expand Down Expand Up @@ -54,8 +62,8 @@
#define SYM_HEADING_LINE 0x1D

// AH Center screen Graphics
#define SYM_AH_CENTER_LINE 0x26
#define SYM_AH_CENTER_LINE_RIGHT 0x27
#define SYM_AH_CENTER_LINE 0x7B
#define SYM_AH_CENTER_LINE_RIGHT 0x7D
#define SYM_AH_CENTER 0x7E
#define SYM_AH_RIGHT 0x02
#define SYM_AH_LEFT 0x03
Expand Down Expand Up @@ -118,15 +126,15 @@
#define SYM_VOLT 0x06
#define SYM_AMP 0x9A
#define SYM_MAH 0x07
#define SYM_WATT 0x57
#define SYM_WATT 0x57 // 0x57 is 'W'

// Time
#define SYM_ON_M 0x9B
#define SYM_FLY_M 0x9C

// Speed
#define SYM_KPH 0x4B // we don't have a KPH symbol so use 'K'
#define SYM_MPH 0x4D // we don't have a MPH symbol so use 'M'
#define SYM_KPH 0x9E
#define SYM_MPH 0x9D

// Menu cursor
#define SYM_CURSOR SYM_AH_LEFT
Expand Down
16 changes: 7 additions & 9 deletions src/main/osd/osd_elements.c
Expand Up @@ -476,7 +476,7 @@ static void osdElementAltitude(osdElementParms_t *element)
static void osdElementAngleRollPitch(osdElementParms_t *element)
{
const int angle = (element->item == OSD_PITCH_ANGLE) ? attitude.values.pitch : attitude.values.roll;
tfp_sprintf(element->buff, "%c%02d.%01d", angle < 0 ? '-' : ' ', abs(angle / 10), abs(angle % 10));
tfp_sprintf(element->buff, "%c%c%02d.%01d", (element->item == OSD_PITCH_ANGLE) ? SYM_PITCH : SYM_ROLL , angle < 0 ? '-' : ' ', abs(angle / 10), abs(angle % 10));
}
#endif

Expand Down Expand Up @@ -530,7 +530,7 @@ static void osdElementCompassBar(osdElementParms_t *element)
#ifdef USE_ADC_INTERNAL
static void osdElementCoreTemperature(osdElementParms_t *element)
{
tfp_sprintf(element->buff, "%3d%c", osdConvertTemperatureToSelectedUnit(getCoreTemperatureCelsius()), osdGetTemperatureSymbolForSelectedUnit());
tfp_sprintf(element->buff, "%c%3d%c", SYM_TEMPERATURE, osdConvertTemperatureToSelectedUnit(getCoreTemperatureCelsius()), osdGetTemperatureSymbolForSelectedUnit());
}
#endif // USE_ADC_INTERNAL

Expand Down Expand Up @@ -754,14 +754,12 @@ static void osdElementGpsHomeDistance(osdElementParms_t *element)

static void osdElementGpsLatitude(osdElementParms_t *element)
{
// The SYM_LAT symbol in the actual font contains only blank, so we use the SYM_ARROW_NORTH
osdFormatCoordinate(element->buff, SYM_ARROW_NORTH, gpsSol.llh.lat);
osdFormatCoordinate(element->buff, SYM_LAT, gpsSol.llh.lat);
}

static void osdElementGpsLongitude(osdElementParms_t *element)
{
// The SYM_LON symbol in the actual font contains only blank, so we use the SYM_ARROW_EAST
osdFormatCoordinate(element->buff, SYM_ARROW_EAST, gpsSol.llh.lon);
osdFormatCoordinate(element->buff, SYM_LON, gpsSol.llh.lon);
}

static void osdElementGpsSats(osdElementParms_t *element)
Expand Down Expand Up @@ -810,11 +808,11 @@ static void osdElementLogStatus(osdElementParms_t *element)
{
if (IS_RC_MODE_ACTIVE(BOXBLACKBOX)) {
if (!isBlackboxDeviceWorking()) {
tfp_sprintf(element->buff, "L-");
tfp_sprintf(element->buff, "%c!", SYM_BBLOG);
} else if (isBlackboxDeviceFull()) {
tfp_sprintf(element->buff, "L>");
tfp_sprintf(element->buff, "%c>", SYM_BBLOG);
} else {
tfp_sprintf(element->buff, "L%d", blackboxGetLogNumber());
tfp_sprintf(element->buff, "%c%d", SYM_BBLOG, blackboxGetLogNumber());
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/unit/osd_unittest.cc
Expand Up @@ -826,7 +826,7 @@ TEST(OsdTest, TestElementCoreTemperature)
osdRefresh(simulationTime);

// then
displayPortTestBufferSubstring(1, 8, " 0%c", SYM_C);
displayPortTestBufferSubstring(1, 8, "%c 0%c", SYM_TEMPERATURE, SYM_C);

// given
simulationCoreTemperature = 33;
Expand All @@ -836,7 +836,7 @@ TEST(OsdTest, TestElementCoreTemperature)
osdRefresh(simulationTime);

// then
displayPortTestBufferSubstring(1, 8, " 33%c", SYM_C);
displayPortTestBufferSubstring(1, 8, "%c 33%c", SYM_TEMPERATURE, SYM_C);

// given
osdConfigMutable()->units = OSD_UNIT_IMPERIAL;
Expand All @@ -846,7 +846,7 @@ TEST(OsdTest, TestElementCoreTemperature)
osdRefresh(simulationTime);

// then
displayPortTestBufferSubstring(1, 8, " 91%c", SYM_F);
displayPortTestBufferSubstring(1, 8, "%c 91%c", SYM_TEMPERATURE, SYM_F);
}

/*
Expand Down

5 comments on commit 9554415

@Jetrell
Copy link

@Jetrell Jetrell commented on 9554415 May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikeller When you get the time. Can you look over the BB log code. I have never used the log capacity on the OSD before. So i'm not sure if the issue is related to the changes here, or it was a previous issue.
The log capacity does not increase. It is just staying a Zero. But when checked in the configurator. The log memory has been used.
Thanks

@mikeller
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jetrell: Can you please specify what you mean by 'log capacity'?

@Jetrell
Copy link

@Jetrell Jetrell commented on 9554415 May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capture 3
The number stays at Zero. And does not increase.

@mikeller
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the capacity, that's the log file number. If you are logging into a flash chip it will stay at 0.

@Jetrell
Copy link

@Jetrell Jetrell commented on 9554415 May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh...Thanks for that. I am using a flash chip in this case. That explains it. Sorry for the false alarm :-)

Please sign in to comment.