40 #include "modulesettings.h"
42 #include "physical_constants.h"
45 #include "attitudeactual.h"
46 #include "baroaltitude.h"
47 #include "flightstatus.h"
48 #include "flightbatterystate.h"
49 #include "flightbatterysettings.h"
50 #include "flightstats.h"
51 #include "gpsposition.h"
52 #include "positionactual.h"
54 #include "gpssatellites.h"
55 #include "gpsvelocity.h"
56 #include "homelocation.h"
57 #include "magnetometer.h"
58 #include "manualcontrolcommand.h"
59 #include "modulesettings.h"
60 #include "stabilizationdesired.h"
61 #include "stabilizationsettings.h"
62 #include "stateestimation.h"
63 #include "systemalarms.h"
64 #include "systemstats.h"
65 #include "tabletinfo.h"
67 #include "velocityactual.h"
70 #include "waypointactive.h"
74 #define STACK_SIZE_BYTES 3072
75 #define TASK_PRIORITY PIOS_THREAD_PRIO_LOW
77 #define SPLASH_TIME_MS (5*1000)
83 if (panel <= CHARONSCREENDISPLAYSETTINGS_PANELTYPE_MAXOPTVAL) {
95 for (uint8_t
i = 0;
i < CHARONSCREENDISPLAYSETTINGS_PANELTYPE_NUMELEM;
97 panel_draw(state, page->PanelType[
i], page->X[
i], page->Y[
i]);
105 #ifndef CHAROSD_FONT_MINIMAL
120 case CHARONSCREENDISPLAYSETTINGS_VIDEOSTANDARD_AUTODETECTPREFERPAL:
124 case CHARONSCREENDISPLAYSETTINGS_VIDEOSTANDARD_AUTODETECTPREFERNTSC:
128 case CHARONSCREENDISPLAYSETTINGS_VIDEOSTANDARD_FORCEPAL:
132 case CHARONSCREENDISPLAYSETTINGS_VIDEOSTANDARD_FORCENTSC:
143 #define FONT_CHAR_SIZE ((12 * 18 * 2) / 8)
147 const char *loaded_txt =
"";
150 bool changed =
false;
153 case CHARONSCREENDISPLAYSETTINGS_FONT_THIN:
154 #ifndef CHAROSD_FONT_MINIMAL
156 loaded_txt =
"loaded thin font";
159 case CHARONSCREENDISPLAYSETTINGS_FONT_SMALL:
160 #ifndef CHAROSD_FONT_MINIMAL
162 loaded_txt =
"loaded small font";
165 case CHARONSCREENDISPLAYSETTINGS_FONT_REGULAR:
167 loaded_txt =
"loaded regular font";
172 for (
int i = 0;
i < 256;
i++) {
176 if ((
i & 0x7) == 0) {
204 ModuleSettingsData module_settings;
205 ModuleSettingsGet(&module_settings);
220 if (module_settings.AdminState[MODULESETTINGS_ADMINSTATE_BATTERY] &&
221 FlightBatteryStateHandle()) {
224 if (module_settings.AdminState[MODULESETTINGS_ADMINSTATE_AIRSPEED]) {
229 StateEstimationNavigationFilterGet(&filter);
230 if (filter != STATEESTIMATION_NAVIGATIONFILTER_NONE) {
264 const char *welcome_msg =
"Welcome to dRonin";
266 SystemAlarmsData alarm;
267 SystemAlarmsGet(&alarm);
285 state->
dev = pios_max7456_id;
292 CharOnScreenDisplaySettingsData page;
293 CharOnScreenDisplaySettingsGet(&page);
303 CharOnScreenDisplaySettingsGet(&page);
310 set_mode(state, page.VideoStandard);
331 CharOnScreenDisplaySettingsInitialize();
333 if (pios_max7456_id) {
static void program_characters(charosd_state_t state, uint8_t font)
static struct pios_thread * taskHandle
struct telemetry_t::@9 system
static const uint8_t charosd_font_thin_data[]
struct telemetry_t::@7 manual
static void splash_screen(charosd_state_t state)
bool PIOS_MAX7456_stall_detect(max7456_dev_t dev)
Detects whether the OSD chip has stalled and attempts to restart it.
VelocityActualData velocity_actual
bool PIOS_Modules_IsEnabled(enum pios_modules module)
AttitudeActualData attitude_actual
static void CharOnScreenDisplayTask(void *parameters)
GPSPositionData gps_position
void * PIOS_malloc(size_t size)
FlightStatusArmedOptions arm_status
int32_t CharOnScreenDisplayInitialize(void)
static const uint8_t charosd_font_small_data[]
MODULE_INITCALL(CharOnScreenDisplayInitialize, CharOnScreenDisplayStart)
static void update_availability(charosd_state_t state)
PositionActualData position_actual
bool PIOS_SENSORS_IsRegistered(enum pios_sensor_type type)
Checks if a sensor type is registered with the PIOS_SENSORS interface.
void PIOS_MAX7456_set_mode(max7456_dev_t dev, bool force, uint8_t fallback)
Allows overriding the video mode used by OSD.
void PIOS_MAX7456_puts(max7456_dev_t dev, uint8_t col, uint8_t row, const char *s, uint8_t attr)
Sets a string into character memory.
#define MAX7456_MODE_NTSC
struct telemetry_t::@8 flight_status
static const uint8_t charosd_font_data[]
static void set_mode(charosd_state_t state, uint8_t video_std)
struct pios_thread * PIOS_Thread_Create(void(*fp)(void *), const char *namep, size_t stack_bytes, void *argp, enum pios_thread_prio_e prio)
void PIOS_MAX7456_clear(max7456_dev_t dev)
Clear the screen.
int32_t TaskMonitorAdd(TaskInfoRunningElem task, struct pios_thread *threadp)
const char * AlarmBootReason(uint8_t reason)
static void panel_draw(charosd_state_t state, uint8_t panel, uint8_t x, uint8_t y)
static void update_telemetry(charosd_state_t state)
void PIOS_MAX7456_download_char(max7456_dev_t dev, uint8_t char_index, uint8_t *data)
Download a character from the device.
void PIOS_Thread_Sleep(uint32_t time_ms)
#define HAS_SENSOR(available, required)
#define MAX7456_FMT_H_CENTER
Includes PiOS and core architecture components.
void PIOS_MAX7456_upload_char(max7456_dev_t dev, uint8_t char_index, const uint8_t *data)
Upload a character to the device.
Generic interface for sensors.
static void screen_draw(charosd_state_t state, CharOnScreenDisplaySettingsData *page)
SharedDefsFlightModeOptions mode
#define PIOS_Assert(test)
void PIOS_MAX7456_wait_vsync()
FlightBatteryStateData battery
int32_t CharOnScreenDisplayStart(void)