Skip to content

Commit fe434f9

Browse files
author
marqs
committed
expose SDP gain mode options
1 parent d00d03c commit fe434f9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

software/sys_controller/inc/avconfig.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
#include "si2177.h"
4242
#endif
4343

44-
#define SIGNED_NUMVAL_ZERO 128
44+
#define SIGNED_NUMVAL_ZERO 128
45+
#define SIGNED16_NUMVAL_ZERO 32768
4546

4647
#define SCANLINESTR_MAX 15
4748
#define SL_HYBRIDSTR_MAX 28

software/sys_controller/src/menu.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ static const char* const comb_ctapsn_desc[] = { "3->2", "5->3", "5->4" };
185185
static const char* const comb_ctapsp_desc[] = { "5->3 (2-tap)", "5->3 (3-tap)", "5->4 (4-tap)" };
186186
static const char* const comb_mode_desc[] = { "Adaptive", "Off", "Fixed (top)", "Fixed (all)", "Fixed (bottom)" };
187187
static const char* const cti_ab_desc[] = { "Sharpest", "Sharp", "Smooth", "Smoothest" };
188+
static const char* const y_gain_mode_desc[] = { "Manual", "Auto w/o peak white", "Auto w/ peak white" };
189+
static const char* const c_gain_mode_desc[] = { "Manual", "As luma", "Auto" };
188190
static const char* const if_comp_desc[] = { "Off", "NTSC -3dB", "NTSC -6dB", "NTSC -10dB", "PAL -2dB", "PAL -5dB", "PAL -7dB" };
189191
static const char* const rf_cvbs_gain_sel[] = { "Normal", "EXT-75ohm" };
190192
static const char* const audio_demod_mode_desc[] = { "AM", "FM1", "FM2" };
@@ -203,6 +205,7 @@ static void pixels_disp(uint8_t v) { sniprintf(menu_row2, US2066_ROW_LEN+1, LNG(
203205
static void value_disp(uint8_t v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%u", v); }
204206
static void value16_disp(uint16_t *v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%u", *v); }
205207
static void signed_disp(uint8_t v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%d", (int8_t)(v-SIGNED_NUMVAL_ZERO)); }
208+
static void signed16_disp(uint16_t *v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%d", (int16_t)(*v-SIGNED16_NUMVAL_ZERO)); }
206209
static void pct_x10_disp(uint8_t v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%u.%u%%", (v/10), (v%10) ); }
207210
#ifdef INC_PCM186X
208211
static void aud_db_disp(uint8_t v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%d dB", ((int8_t)v-PCM_GAIN_0DB)); }
@@ -556,8 +559,10 @@ MENU(menu_sdp, P99_PROTECT({
556559
{ "Brightness", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.brightness, OPT_NOWRAP, 0, 0xff, signed_disp } } },
557560
{ "Contrast", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.contrast, OPT_NOWRAP, 0, 0xff, value_disp } } },
558561
{ "Hue", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.hue, OPT_NOWRAP, 0, 0xff, signed_disp } } },
559-
{ "Y gain", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.y_gain, OPT_NOWRAP, 0, 0xff, signed_disp } } },
560-
{ "C gain", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.c_gain, OPT_NOWRAP, 0, 0xff, signed_disp } } },
562+
{ "Y gain mode", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.y_gain_mode, OPT_WRAP, SETTING_ITEM(y_gain_mode_desc) } } },
563+
{ "C gain mode", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.c_gain_mode, OPT_WRAP, SETTING_ITEM(c_gain_mode_desc) } } },
564+
{ "Y gain", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc.sdp_cfg.y_gain, (0x8000-241), (0x8000+1024), signed16_disp } } },
565+
{ "C gain", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc.sdp_cfg.c_gain, (0x8000-512), (0x8000+1024), signed16_disp } } },
561566
{ "Filtering opt.", OPT_SUBMENU, { .sub = { &menu_sdp_filter, NULL, NULL } } },
562567
{ "RF SAW compensation", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.if_comp, OPT_NOWRAP, SETTING_ITEM(if_comp_desc) } } },
563568
{ "RF cvbs gain", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sirf_cfg.cvbs_gain_sel, OPT_NOWRAP, SETTING_ITEM(rf_cvbs_gain_sel) } } },

0 commit comments

Comments
 (0)