kopia lustrzana https://github.com/hoglet67/RGBtoHDMI
Pi Firmware: Moved input_mux setting into sampling menu
Change-Id: I11e5639523e0834ee77a4c86e4313d36f0353ca5pllc_direct_access
rodzic
e5e57711d6
commit
40053dd27f
|
@ -18,6 +18,7 @@ typedef struct {
|
|||
int sp_offset[NUM_OFFSETS];
|
||||
int half_px_delay; // 0 = off, 1 = on, all modes
|
||||
int divider; // cpld divider, 6 or 8
|
||||
int mux; // 0 = direct, 1 = via the 74LS08 buffer
|
||||
int full_px_delay; // 0..15
|
||||
int rate; // 0 = normal psync rate (3 bpp), 1 = double psync rate (6 bpp), 2 = sub-sample (even), 3=sub-sample(odd)
|
||||
} config_t;
|
||||
|
@ -95,6 +96,7 @@ enum {
|
|||
F_OFFSET,
|
||||
HALF,
|
||||
DIVIDER,
|
||||
MUX,
|
||||
DELAY,
|
||||
RATE,
|
||||
};
|
||||
|
@ -109,6 +111,7 @@ static param_t params[] = {
|
|||
{ F_OFFSET, "F Offset", "f_offset", 0, 0, 1 },
|
||||
{ HALF, "Half", "half", 0, 1, 1 },
|
||||
{ DIVIDER, "Divider", "divider", 6, 8, 2 },
|
||||
{ MUX, "Input Mux", "input_mux", 0, 1, 1 },
|
||||
{ DELAY, "Delay", "delay", 0, 15, 1 },
|
||||
{ RATE, "Sample Mode", "sample_mode", 0, 3, 1 },
|
||||
{ -1, NULL, NULL, 0, 0, 1 }
|
||||
|
@ -160,6 +163,7 @@ static void write_config(config_t *config) {
|
|||
sp >>= 1;
|
||||
}
|
||||
RPI_SetGpioValue(SP_DATA_PIN, 0);
|
||||
RPI_SetGpioValue(MUX_PIN, config->mux);
|
||||
}
|
||||
|
||||
static void osd_sp(config_t *config, int line, int metric) {
|
||||
|
@ -291,6 +295,8 @@ static void cpld_init(int version) {
|
|||
mode7_config.half_px_delay = 0;
|
||||
default_config.divider = 6;
|
||||
mode7_config.divider = 8;
|
||||
default_config.mux = 0;
|
||||
mode7_config.mux = 0;
|
||||
default_config.full_px_delay = 5; // Correct for the master
|
||||
mode7_config.full_px_delay = 8; // Correct for the master
|
||||
default_config.rate = 0;
|
||||
|
@ -609,6 +615,8 @@ static int cpld_get_value(int num) {
|
|||
return config->half_px_delay;
|
||||
case DIVIDER:
|
||||
return config->divider;
|
||||
case MUX:
|
||||
return config->mux;
|
||||
case DELAY:
|
||||
return config->full_px_delay;
|
||||
case RATE:
|
||||
|
@ -665,11 +673,22 @@ static void cpld_set_value(int num, int value) {
|
|||
config->divider = value;
|
||||
update_param_range();
|
||||
break;
|
||||
case MUX:
|
||||
config->mux = value;
|
||||
// Disallow illegal combinations
|
||||
if (config->mux == 1 && config->rate == 1) {
|
||||
config->rate = 0;
|
||||
}
|
||||
break;
|
||||
case DELAY:
|
||||
config->full_px_delay = value;
|
||||
break;
|
||||
case RATE:
|
||||
config->rate = value;
|
||||
// Disallow illegal combinations
|
||||
if (config->mux == 1 && config->rate == 1) {
|
||||
config->mux = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
write_config(config);
|
||||
|
|
12
src/osd.c
12
src/osd.c
|
@ -195,7 +195,6 @@ enum {
|
|||
F_SCALING,
|
||||
F_FONTSIZE,
|
||||
F_BORDER,
|
||||
F_MUX,
|
||||
F_VSYNCTYPE,
|
||||
F_VSYNC,
|
||||
F_VLOCKMODE,
|
||||
|
@ -224,7 +223,6 @@ static param_t features[] = {
|
|||
{ F_SCALING, "Scaling", "scaling", 0, NUM_SCALING - 1, 1 },
|
||||
{ F_FONTSIZE, "Font Size", "font_size", 0, NUM_FONTSIZE - 1, 1 },
|
||||
{ F_BORDER, "Border Colour", "border_colour", 0, 127, 1 },
|
||||
{ F_MUX,"Input Mux (3 Bit)", "input_mux", 0, 1, 1 },
|
||||
{ F_VSYNCTYPE, "V Sync Type", "vsync_type", 0, NUM_VSYNCTYPES - 1, 1 },
|
||||
{ F_VSYNC, "V Sync Indicator", "vsync_indicator", 0, 1, 1 },
|
||||
{ F_VLOCKMODE, "V Lock Mode", "vlock_mode", 0, NUM_HDMI - 1, 1 },
|
||||
|
@ -338,7 +336,6 @@ static param_menu_item_t colour_ref = { I_FEATURE, &features[F_COLOUR]
|
|||
static param_menu_item_t invert_ref = { I_FEATURE, &features[F_INVERT] };
|
||||
static param_menu_item_t fontsize_ref = { I_FEATURE, &features[F_FONTSIZE] };
|
||||
static param_menu_item_t vsynctype_ref = { I_FEATURE, &features[F_VSYNCTYPE] };
|
||||
static param_menu_item_t mux_ref = { I_FEATURE, &features[F_MUX] };
|
||||
static param_menu_item_t vsync_ref = { I_FEATURE, &features[F_VSYNC] };
|
||||
static param_menu_item_t vlockmode_ref = { I_FEATURE, &features[F_VLOCKMODE] };
|
||||
static param_menu_item_t vlockline_ref = { I_FEATURE, &features[F_VLOCKLINE] };
|
||||
|
@ -380,7 +377,6 @@ static menu_t settings_menu = {
|
|||
(base_menu_item_t *) &vlockadj_ref,
|
||||
(base_menu_item_t *) &nbuffers_ref,
|
||||
(base_menu_item_t *) &debug_ref,
|
||||
(base_menu_item_t *) &mux_ref,
|
||||
|
||||
NULL
|
||||
}
|
||||
|
@ -546,8 +542,6 @@ static int current_item[MAX_MENU_DEPTH];
|
|||
|
||||
// Currently selected palette setting
|
||||
static int palette = PALETTE_RGB;
|
||||
// Currently selected input mux setting
|
||||
static int mux = 0;
|
||||
|
||||
// Default action map, maps from physical key press to action
|
||||
static osd_state_t action_map[] = {
|
||||
|
@ -628,8 +622,6 @@ static int get_feature(int num) {
|
|||
return get_invert();
|
||||
case F_VSYNCTYPE:
|
||||
return get_elk();
|
||||
case F_MUX:
|
||||
return mux;
|
||||
case F_VSYNC:
|
||||
return get_vsync();
|
||||
case F_VLOCKMODE:
|
||||
|
@ -719,10 +711,6 @@ static void set_feature(int num, int value) {
|
|||
case F_VSYNCTYPE:
|
||||
set_elk(value);
|
||||
break;
|
||||
case F_MUX:
|
||||
mux = value;
|
||||
RPI_SetGpioValue(MUX_PIN, mux);
|
||||
break;
|
||||
case F_VSYNC:
|
||||
set_vsync(value);
|
||||
break;
|
||||
|
|
Ładowanie…
Reference in New Issue