1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

Make OSD items configurable

This commit is contained in:
Evgeny Sychov 2016-03-13 17:31:33 -07:00
parent 98bd0f18b3
commit e2ec4ce2be
13 changed files with 124 additions and 28 deletions

View file

@ -46,7 +46,7 @@ uint8_t max7456_send(uint8_t add, uint8_t data) {
// ============================================================ WRITE TO SCREEN
void max7456_init(void) {
void max7456_init(uint8_t system) {
uint8_t max7456_reset=0x02;
uint8_t max_screen_rows;
uint8_t srdata = 0;
@ -68,6 +68,16 @@ void max7456_init(void) {
video_signal_type = VIDEO_MODE_NTSC;
}
// Override detected type: 0-AUTO, 1-PAL, 2-NTSC
switch(system) {
case 1:
video_signal_type = VIDEO_MODE_PAL;
break;
case 2:
video_signal_type = VIDEO_MODE_NTSC;
break;
}
max7456_reset |= video_signal_type;
if (video_signal_type) { //PAL
@ -94,8 +104,13 @@ void max7456_init(void) {
}
// Copy string from ram into screen buffer
void max7456_write_string(const char *string, int address) {
char *dest = screen + address;
void max7456_write_string(const char *string, int16_t address) {
char *dest;
if (address >= 0)
dest = screen + address;
else
dest = screen + (max_screen_size + address);
while(*string)
*dest++ = *string++;