From c91988e5fb3366660961bd5c109a288121e0929e Mon Sep 17 00:00:00 2001 From: marqs Date: Mon, 16 Apr 2018 20:08:11 +0300 Subject: [PATCH] some desperate code size savings --- software/sys_controller/ossc/controls.c | 10 +++++++--- software/sys_controller/ossc/menu.c | 4 ++-- software/sys_controller/tvp7002/tvp7002.c | 3 +-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/software/sys_controller/ossc/controls.c b/software/sys_controller/ossc/controls.c index dabc71f..35b49df 100644 --- a/software/sys_controller/ossc/controls.c +++ b/software/sys_controller/ossc/controls.c @@ -157,12 +157,16 @@ int parse_control() fpga_ilace = !!(fpga_status & (1<<11)); sniprintf(menu_row1, LCD_ROW_LEN+1, "Prof.%u %9s", profile_sel, video_modes[cm.id].name); if (cm.sync_active) { - fpga_v_hz_x100 = (100*TVP_EXTCLK_HZ)/IORD_ALTERA_AVALON_PIO_DATA(PIO_8_BASE); - sniprintf(menu_row2, LCD_ROW_LEN+1, "%4lu%c%c %3lu.%.2luHz", (((fpga_status & 0x7ff)+1)<> 16) & 0x3) ? '*' : ' ', fpga_v_hz_x100/100, - fpga_v_hz_x100%100); + fpga_v_hz_x100%100);*/ + sniprintf(menu_row2, LCD_ROW_LEN+1, "%4lu%c%c %u", (((fpga_status & 0x7ff)+1)<> 16) & 0x3) ? '*' : ' ', + IORD_ALTERA_AVALON_PIO_DATA(PIO_8_BASE)); } lcd_write_menu(); break; diff --git a/software/sys_controller/ossc/menu.c b/software/sys_controller/ossc/menu.c index 3f5ea1b..a5cc849 100644 --- a/software/sys_controller/ossc/menu.c +++ b/software/sys_controller/ossc/menu.c @@ -80,7 +80,7 @@ static void lt_disp(alt_u8 v) { strncpy(menu_row2, lt_desc[v], LCD_ROW_LEN+1); } static void aud_db_disp(alt_u8 v) { sniprintf(menu_row2, LCD_ROW_LEN+1, "%d dB", ((alt_8)v-AUDIO_GAIN_0DB)); } static void vm_display_name (alt_u8 v) { strncpy(menu_row2, video_modes[v].name, LCD_ROW_LEN+1); } static void link_av_desc (avinput_t v) { strncpy(menu_row2, v == AV_LAST ? "No link" : avinput_str[v], LCD_ROW_LEN+1); } -static void coarse_gain_disp(alt_u8 v) { sniprintf(menu_row2, LCD_ROW_LEN+1, "%u.%u", ((v*10)+50)/100, (((v*10)+50)%100)/10); } +//static void coarse_gain_disp(alt_u8 v) { sniprintf(menu_row2, LCD_ROW_LEN+1, "%u.%u", ((v*10)+50)/100, (((v*10)+50)%100)/10); } static const arg_info_t vm_arg_info = {&vm_sel, VIDEO_MODES_CNT-1, vm_display_name}; static const arg_info_t profile_arg_info = {&profile_sel_menu, MAX_PROFILE, value_disp}; @@ -107,7 +107,7 @@ MENU(menu_vinputproc, P99_PROTECT({ \ { LNG("R/Pr gain","R/Pr ゲイン"), OPT_AVCONFIG_NUMVALUE, { .num = { &tc.col.r_f_gain, OPT_NOWRAP, 0, 0xFF, value_disp } } }, { LNG("G/Y gain","G/Y ゲイン"), OPT_AVCONFIG_NUMVALUE, { .num = { &tc.col.g_f_gain, OPT_NOWRAP, 0, 0xFF, value_disp } } }, { LNG("B/Pb gain","B/Pb ゲイン"), OPT_AVCONFIG_NUMVALUE, { .num = { &tc.col.b_f_gain, OPT_NOWRAP, 0, 0xFF, value_disp } } }, - { LNG("Pre-ADC Gain","Pre-ADC Gain"), OPT_AVCONFIG_NUMVALUE, { .num = { &tc.col.c_gain, OPT_NOWRAP, 0, COARSE_GAIN_MAX, coarse_gain_disp } } }, + { LNG("Pre-ADC Gain","Pre-ADC Gain"), OPT_AVCONFIG_NUMVALUE, { .num = { &tc.col.c_gain, OPT_NOWRAP, 0, COARSE_GAIN_MAX, value_disp } } }, })) MENU(menu_sampling, P99_PROTECT({ \ diff --git a/software/sys_controller/tvp7002/tvp7002.c b/software/sys_controller/tvp7002/tvp7002.c index 8b3a8c8..c8682d3 100644 --- a/software/sys_controller/tvp7002/tvp7002.c +++ b/software/sys_controller/tvp7002/tvp7002.c @@ -207,7 +207,7 @@ void tvp_init() } void tvp_set_gain_offset(color_setup_t *col) { - tvp_writereg(TVP_BG_CGAIN, ((col->c_gain << 4) | (col->c_gain & 0xF))); + tvp_writereg(TVP_BG_CGAIN, ((col->c_gain << 4) | col->c_gain)); tvp_writereg(TVP_R_CGAIN, col->c_gain); tvp_writereg(TVP_R_FGAIN, col->r_f_gain); tvp_writereg(TVP_G_FGAIN, col->g_f_gain); @@ -215,7 +215,6 @@ void tvp_set_gain_offset(color_setup_t *col) { tvp_writereg(TVP_R_FOFFSET_MSB, col->r_f_off); tvp_writereg(TVP_G_FOFFSET_MSB, col->g_f_off); tvp_writereg(TVP_B_FOFFSET_MSB, col->b_f_off); - } // Configure H-PLL (sampling rate, VCO gain and charge pump current)