dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
panel.c File Reference
#include <openpilot.h>
#include <math.h>
#include <string.h>
#include <misc_math.h>
#include "charosd.h"
#include "physical_constants.h"
#include "airspeedactual.h"
#include "flightstatus.h"
#include "systemalarms.h"
#include "modulesettings.h"

Go to the source code of this file.

Macros

#define ERR_STR   "---"
 
#define terminate_buffer()   do { buffer [sizeof(buffer) - 1] = 0; } while (0)
 
#define STD_UPDATE(__name, n, fmt,...)
 
#define STD_PANEL(__name, bs, fmt,...)   STD_UPDATE(__name, bs, fmt, __VA_ARGS__);
 
#define _PAN_CLIMB_SYMB   0x03
 
#define _PAN_GPS_2D   0x01
 
#define _PAN_GPS_3D   0x02
 
#define PANEL_HORIZON_WIDTH   14
 
#define PANEL_HORIZON_HEIGHT   5
 
#define _PAN_HORZ_LINE   0x16
 
#define _PAN_HORZ_TOP   0x0e
 
#define _PAN_HORZ_CHAR_LINES   18
 
#define _PAN_HORZ_VRES   9
 
#define _PAN_HORZ_INT_WIDTH   (PANEL_HORIZON_WIDTH - 2)
 
#define _PAN_HORZ_LINES   (PANEL_HORIZON_HEIGHT * _PAN_HORZ_VRES)
 
#define _PAN_HORZ_TOTAL_LINES   (PANEL_HORIZON_HEIGHT * _PAN_HORZ_CHAR_LINES)
 
#define _ARROWS   CHAROSD_CHAR_ARROW_NL
 
#define MAX_ALARM_LEN   MAX7456_COLUMNS
 
#define declare_panel(__name, __req)
 

Functions

static float pythag (float a, float b)
 
static void draw_rect (charosd_state_t state, uint8_t l, uint8_t t, uint8_t w, uint8_t h, bool filled, uint8_t attr)
 
 STD_PANEL (ALTITUDE, 8,"\x85%d\x8d",(int16_t) round(-state->telemetry.position_actual.Down))
 
static void CLIMB_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void FLIGHTMODE_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void ARMEDFLAG_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void FLIGHTTIME_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (ROLL, 7,"\xb2%d\xb0",(int16_t) state->telemetry.attitude_actual.Roll)
 
 STD_PANEL (PITCH, 7,"\xb1%d\xb0",(int16_t) state->telemetry.attitude_actual.Pitch)
 
static void GPS_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (LATITUDE, 11,"\x83%02.6f",(double) state->telemetry.gps_position.Latitude/10000000.0)
 
 STD_PANEL (LONGITUDE, 11,"\x84%02.6f",(double) state->telemetry.gps_position.Longitude/10000000.0)
 
void HORIZON_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (THROTTLE, 7,"\x87%d%%",(int) MAX(-99, state->telemetry.manual.thrust *100))
 
 STD_PANEL (GROUNDSPEED, 7,"\x80%d\x81",(int) roundf(pythag(state->telemetry.velocity_actual.North, state->telemetry.velocity_actual.East)*3.6f))
 
 STD_PANEL (BATTERYVOLT, 8,"%.2f\x8e",(double) state->telemetry.battery.Voltage)
 
 STD_PANEL (BATTERYCURRENT, 8,"%.2f\x8f",(double) state->telemetry.battery.Current)
 
 STD_PANEL (BATTERYCONSUMED, 8,"%u\x82",(uint16_t) state->telemetry.battery.ConsumedEnergy)
 
static void RSSIFLAG_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void HOMEDISTANCE_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void HOMEDIRECTION_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (HEADING, 6,"%d%c",(int)(round(state->telemetry.attitude_actual.Yaw)+360)%360, CHAROSD_CHAR_DEG)
 
 STD_PANEL (CALLSIGN, 11,"%s", state->custom_text)
 
 STD_PANEL (TEMPERATURE, 9,"\xfd%.1f\x8a", 0.0)
 
static void RSSI_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void COMPASS_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void AIRSPEED_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (CROSSHAIR, 2,"%c", 0x0a)
 
static void ALARMS_update (charosd_state_t state, uint8_t x, uint8_t y)
 

Variables

const char _horz_line [PANEL_HORIZON_WIDTH+1] = "\xb8 \xb9"
 
const char _horz_center [PANEL_HORIZON_WIDTH+1] = "\xc8 \xc9"
 
const panel_t panels [CHARONSCREENDISPLAYSETTINGS_PANELTYPE_MAXOPTVAL+1]
 
const uint8_t count = sizeof (panels) / sizeof (panel_t)
 

Detailed Description

Author
dRonin, http://dronin.org Copyright (C) 2016
and MultiOSD
See Also
The GNU Public License (GPL) Version 3

Definition in file panel.c.