Skip to content

Commit

Permalink
Merge pull request #473 from ligenxxxx/analog-support-16-9(15-9)
Browse files Browse the repository at this point in the history
analog video support 16:9
  • Loading branch information
ligenxxxx authored Jan 22, 2025
2 parents a2b67b8 + 65406bd commit 0b22320
Show file tree
Hide file tree
Showing 27 changed files with 9,882 additions and 8,667 deletions.
797 changes: 405 additions & 392 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_10.c

Large diffs are not rendered by default.

813 changes: 414 additions & 399 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_12.c

Large diffs are not rendered by default.

834 changes: 426 additions & 408 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_14.c

Large diffs are not rendered by default.

805 changes: 413 additions & 392 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_16.c

Large diffs are not rendered by default.

869 changes: 447 additions & 422 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_18.c

Large diffs are not rendered by default.

877 changes: 453 additions & 424 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_20.c

Large diffs are not rendered by default.

867 changes: 450 additions & 417 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_22.c

Large diffs are not rendered by default.

860 changes: 449 additions & 411 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_24.c

Large diffs are not rendered by default.

884 changes: 464 additions & 420 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_26.c

Large diffs are not rendered by default.

877 changes: 463 additions & 414 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_28.c

Large diffs are not rendered by default.

879 changes: 468 additions & 411 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_30.c

Large diffs are not rendered by default.

905 changes: 483 additions & 422 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_32.c

Large diffs are not rendered by default.

904 changes: 486 additions & 418 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_34.c

Large diffs are not rendered by default.

917 changes: 497 additions & 420 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_36.c

Large diffs are not rendered by default.

935 changes: 509 additions & 426 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_38.c

Large diffs are not rendered by default.

942 changes: 517 additions & 425 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_40.c

Large diffs are not rendered by default.

956 changes: 529 additions & 427 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_42.c

Large diffs are not rendered by default.

959 changes: 534 additions & 425 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_44.c

Large diffs are not rendered by default.

969 changes: 543 additions & 426 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_46.c

Large diffs are not rendered by default.

982 changes: 556 additions & 426 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_48.c

Large diffs are not rendered by default.

676 changes: 343 additions & 333 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_8.c

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mkapp/app/language/zh_hans.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Scanning ready = "扫频就绪"
Source = "信号源"
Expansion Module = "扩展模块"
Analog Video = "模拟制式"
Analog Ratio = "模拟比例"
HDZero Band = "HDZero频段"
Raceband = "竞速频段"
Lowband = "低频段"
Expand Down
1 change: 1 addition & 0 deletions mkapp/app/setting.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ power_ana_rx = 1

[source]
analog_format=0
analog_ratio=0
hdzero_band=0
hdzero_bw=0

Expand Down
2 changes: 2 additions & 0 deletions src/core/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ const setting_t g_setting_defaults = {
},
.source = {
.analog_format = SETTING_SOURCES_ANALOG_FORMAT_NTSC,
.analog_ratio = SETTING_SOURCES_ANALOG_RATIO_4_3,
.hdzero_band = SETTING_SOURCES_HDZERO_BAND_RACEBAND,
.hdzero_bw = SETTING_SOURCES_HDZERO_BW_WIDE,
},
Expand Down Expand Up @@ -333,6 +334,7 @@ void settings_load(void) {

// source
g_setting.source.analog_format = ini_getl("source", "analog_format", g_setting_defaults.source.analog_format, SETTING_INI);
g_setting.source.analog_ratio = ini_getl("source", "analog_ratio", g_setting_defaults.source.analog_ratio, SETTING_INI);
g_setting.source.hdzero_band = ini_getl("source", "hdzero_band", g_setting_defaults.source.hdzero_band, SETTING_INI);
g_setting.source.hdzero_bw = ini_getl("source", "hdzero_bw", g_setting_defaults.source.hdzero_bw, SETTING_INI);

Expand Down
6 changes: 6 additions & 0 deletions src/core/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ typedef enum {
SETTING_SOURCES_ANALOG_FORMAT_NTSC = 0,
SETTING_SOURCES_ANALOG_FORMAT_PAL = 1
} setting_sources_analog_format_t;

typedef enum {
SETTING_SOURCES_ANALOG_RATIO_4_3 = 0,
SETTING_SOURCES_ANALOG_RATIO_16_9 = 1
} setting_sources_analog_ratio_t;
typedef enum {
SETTING_SOURCES_HDZERO_BAND_RACEBAND = 0,
SETTING_SOURCES_HDZERO_BAND_LOWBAND = 1
Expand All @@ -241,6 +246,7 @@ typedef enum {

typedef struct {
setting_sources_analog_format_t analog_format; // 0=NTSC, 1= PAL
setting_sources_analog_ratio_t analog_ratio; // 0=4:3, 1=16:9
setting_sources_hdzero_band_t hdzero_band;
setting_sources_hdzero_bw_t hdzero_bw;
} setting_sources_t;
Expand Down
5 changes: 5 additions & 0 deletions src/driver/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,11 @@ void Source_AV(uint8_t sel) // 0=AV in, 1=AV module
HDZero_Close();
OLED_SetTMG(1);

if (g_setting.source.analog_ratio == SETTING_SOURCES_ANALOG_RATIO_4_3)
I2C_Write(ADDR_FPGA, 0x8f, 0x80); // bit[7]: 0=16:9, 1=original
else
I2C_Write(ADDR_FPGA, 0x8f, 0x00); // bit[7]: 0=16:9, 1=original

I2C_Write(ADDR_FPGA, 0x8C, 0x02);

g_hw_stat.source_mode = SOURCE_MODE_AV;
Expand Down
27 changes: 18 additions & 9 deletions src/ui/page_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static lv_coord_t row_dsc[] = {60, 60, 60, 60, 60, 60, 60, 60, 60, 60, LV_GRID_T
static lv_obj_t *label[5];
static uint8_t oled_tst_mode = 0; // 0=Normal,1=CB; 2-Grid; 3=All Black; 4=All White,5=Boot logo
static bool in_sourcepage = false;
static btn_group_t btn_group0, btn_group1, btn_group2;
static btn_group_t btn_group0, btn_group1, btn_group2, btn_group3;

static lv_obj_t *page_source_create(lv_obj_t *parent, panel_arr_t *arr) {
char buf[128];
Expand All @@ -41,13 +41,13 @@ static lv_obj_t *page_source_create(lv_obj_t *parent, panel_arr_t *arr) {

lv_obj_t *section = lv_menu_section_create(page);
lv_obj_add_style(section, &style_submenu, LV_PART_MAIN);
lv_obj_set_size(section, 1053, 894);
lv_obj_set_size(section, 960, 894);

snprintf(buf, sizeof(buf), "%s:", _lang("Source"));
create_text(NULL, section, false, buf, LV_MENU_ITEM_BUILDER_VARIANT_2);

lv_obj_t *cont = lv_obj_create(section);
lv_obj_set_size(cont, 960, 600);
lv_obj_set_size(cont, 960, 894);
lv_obj_set_pos(cont, 0, 0);
lv_obj_set_layout(cont, LV_LAYOUT_GRID);
lv_obj_clear_flag(cont, LV_OBJ_FLAG_SCROLLABLE);
Expand All @@ -74,15 +74,18 @@ static lv_obj_t *page_source_create(lv_obj_t *parent, panel_arr_t *arr) {
create_btn_group_item(&btn_group2, cont, 2, _lang("HDZero BW"), _lang("Wide"), _lang("Narrow"), "", "", 6);
btn_group_set_sel(&btn_group2, g_setting.source.hdzero_bw);

create_btn_group_item(&btn_group3, cont, 2, _lang("Analog Ratio"), _lang("4:3"), _lang("16:9"), "", "", 7);
btn_group_set_sel(&btn_group3, g_setting.source.analog_ratio);

snprintf(buf, sizeof(buf), "< %s", _lang("Back"));
if (g_setting.storage.selftest) {
pp_source.p_arr.max = 9;
label[4] = create_label_item(cont, "OLED Pattern: Normal", 1, 7, 3);
create_label_item(cont, buf, 1, 8, 3);
pp_source.p_arr.max = 10;
label[4] = create_label_item(cont, "OLED Pattern: Normal", 1, 8, 3);
create_label_item(cont, buf, 1, 9, 3);
} else {
pp_source.p_arr.max = 8;
pp_source.p_arr.max = 9;
label[4] = NULL;
create_label_item(cont, buf, 1, 7, 3);
create_label_item(cont, buf, 1, 8, 3);
}
return page;
}
Expand Down Expand Up @@ -242,7 +245,13 @@ static void page_source_on_click(uint8_t key, int sel) {
ini_putl("source", "hdzero_bw", g_setting.source.hdzero_bw, SETTING_INI);
break;

case 7:
case 7: // Analog video format
btn_group_toggle_sel(&btn_group3);
g_setting.source.analog_ratio = btn_group_get_sel(&btn_group3);
ini_putl("source", "analog_ratio", g_setting.source.analog_ratio, SETTING_INI);
break;

case 8:
if (g_setting.storage.selftest && label[4]) {
uint8_t oled_te = (oled_tst_mode != 0);
uint8_t oled_tm = (oled_tst_mode & 0x0F) - 1;
Expand Down

0 comments on commit 0b22320

Please sign in to comment.