kopia lustrzana https://github.com/hoglet67/RGBtoHDMI
Pi Firmware: Updated cpld_atom offset to 4 bits
Change-Id: Ia32dc5dbd6a2f104628284f1b9f86188ade81f48pull/11/head
rodzic
f7fa4bd189
commit
ac921f0796
|
|
@ -9,6 +9,8 @@
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "rpi-gpio.h"
|
#include "rpi-gpio.h"
|
||||||
|
|
||||||
|
#define RANGE 16
|
||||||
|
|
||||||
// The number of frames to compute differences over
|
// The number of frames to compute differences over
|
||||||
#define NUM_CAL_FRAMES 10
|
#define NUM_CAL_FRAMES 10
|
||||||
|
|
||||||
|
|
@ -36,10 +38,10 @@ static config_t *config;
|
||||||
static char message[80];
|
static char message[80];
|
||||||
|
|
||||||
// Per-Offset calibration metrics (i.e. errors) for mode 0..6
|
// Per-Offset calibration metrics (i.e. errors) for mode 0..6
|
||||||
static int raw_metrics_default[8][NUM_OFFSETS];
|
static int raw_metrics_default[RANGE][NUM_OFFSETS];
|
||||||
|
|
||||||
// Aggregate calibration metrics (i.e. errors summed across all offsets) for mode 0..6
|
// Aggregate calibration metrics (i.e. errors summed across all offsets) for mode 0..6
|
||||||
static int sum_metrics_default[8]; // Last two not used
|
static int sum_metrics_default[RANGE]; // Last two not used
|
||||||
|
|
||||||
// Error count for final calibration values for mode 0..6
|
// Error count for final calibration values for mode 0..6
|
||||||
static int errors_default;
|
static int errors_default;
|
||||||
|
|
@ -68,7 +70,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
static param_t default_sampling_params[] = {
|
static param_t default_sampling_params[] = {
|
||||||
{ OFFSET, "Offset", 0, 7 },
|
{ OFFSET, "Offset", 0, 15 },
|
||||||
{ -1, NULL, 0, 0 }
|
{ -1, NULL, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -93,8 +95,8 @@ static param_t default_geometry_params[] = {
|
||||||
|
|
||||||
static void write_config(config_t *config) {
|
static void write_config(config_t *config) {
|
||||||
int sp = 0;
|
int sp = 0;
|
||||||
int scan_len = 3;
|
int scan_len = 4;
|
||||||
sp |= config->sp_offset & 7;
|
sp |= config->sp_offset & 15;
|
||||||
for (int i = 0; i < scan_len; i++) {
|
for (int i = 0; i < scan_len; i++) {
|
||||||
RPI_SetGpioValue(SP_DATA_PIN, sp & 1);
|
RPI_SetGpioValue(SP_DATA_PIN, sp & 1);
|
||||||
for (int j = 0; j < 1000; j++);
|
for (int j = 0; j < 1000; j++);
|
||||||
|
|
@ -147,7 +149,7 @@ static void cpld_init(int version) {
|
||||||
default_config.divider = 0;
|
default_config.divider = 0;
|
||||||
default_config.sp_offset = 2;
|
default_config.sp_offset = 2;
|
||||||
config = &default_config;
|
config = &default_config;
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < RANGE; i++) {
|
||||||
sum_metrics_default[i] = -1;
|
sum_metrics_default[i] = -1;
|
||||||
for (int j = 0; j < NUM_OFFSETS; j++) {
|
for (int j = 0; j < NUM_OFFSETS; j++) {
|
||||||
raw_metrics_default[i][j] = -1;
|
raw_metrics_default[i][j] = -1;
|
||||||
|
|
@ -176,10 +178,10 @@ static void cpld_calibrate(capture_info_t *capinfo, int elk) {
|
||||||
int *sum_metrics;
|
int *sum_metrics;
|
||||||
int *errors;
|
int *errors;
|
||||||
|
|
||||||
int (*raw_metrics)[8][NUM_OFFSETS];
|
int (*raw_metrics)[RANGE][NUM_OFFSETS];
|
||||||
|
|
||||||
log_info("Calibrating...");
|
log_info("Calibrating...");
|
||||||
range = 8;
|
range = RANGE;
|
||||||
raw_metrics = &raw_metrics_default;
|
raw_metrics = &raw_metrics_default;
|
||||||
sum_metrics = &sum_metrics_default[0];
|
sum_metrics = &sum_metrics_default[0];
|
||||||
errors = &errors_default;
|
errors = &errors_default;
|
||||||
|
|
@ -343,7 +345,7 @@ static void cpld_show_cal_summary(int line) {
|
||||||
|
|
||||||
static void cpld_show_cal_details(int line) {
|
static void cpld_show_cal_details(int line) {
|
||||||
int *sum_metrics = sum_metrics_default;
|
int *sum_metrics = sum_metrics_default;
|
||||||
int range = (*sum_metrics < 0) ? 0 : 8;
|
int range = (*sum_metrics < 0) ? 0 : RANGE;
|
||||||
if (range == 0) {
|
if (range == 0) {
|
||||||
sprintf(message, "No calibration data for this mode");
|
sprintf(message, "No calibration data for this mode");
|
||||||
osd_set(line, 0, message);
|
osd_set(line, 0, message);
|
||||||
|
|
@ -356,8 +358,8 @@ static void cpld_show_cal_details(int line) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpld_show_cal_raw(int line) {
|
static void cpld_show_cal_raw(int line) {
|
||||||
int (*raw_metrics)[8][NUM_OFFSETS] = &raw_metrics_default;
|
int (*raw_metrics)[RANGE][NUM_OFFSETS] = &raw_metrics_default;
|
||||||
int range = ((*raw_metrics)[0][0] < 0) ? 0 : 8;
|
int range = ((*raw_metrics)[0][0] < 0) ? 0 : RANGE;
|
||||||
if (range == 0) {
|
if (range == 0) {
|
||||||
sprintf(message, "No calibration data for this mode");
|
sprintf(message, "No calibration data for this mode");
|
||||||
osd_set(line, 0, message);
|
osd_set(line, 0, message);
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ sampling06=3 sampling7=0,2,2,2,2,2,2,0,5 info=1 palette=0 deinterlace=5 scanline
|
||||||
#sampling06=5 geometry06=24,16,76,240,608,480,85909091,5472,524,0 nbuffers=2 m7disable=1
|
#sampling06=5 geometry06=24,16,76,240,608,480,85909091,5472,524,0 nbuffers=2 m7disable=1
|
||||||
#
|
#
|
||||||
# Here's an example that might work with an Atom (Atom CPLD)
|
# Here's an example that might work with an Atom (Atom CPLD)
|
||||||
#sampling06=7 geometry06=19,11,76,240,608,480,57272720,3648,524,0 nbuffers=2 m7disable=1
|
#sampling06=2 geometry06=19,11,76,240,608,480,57272720,3648,524,0 nbuffers=2 m7disable=1
|
||||||
#
|
#
|
||||||
# Here's an example that might work with a ZX80/ZX81
|
# Here's an example that might work with a ZX80/ZX81
|
||||||
#sampling06=4 geometry06=9,18,84,270,672,540,78000000,4968,620,0 nbuffers=2 m7disable=1 keymap=1323232 return=0
|
#sampling06=4 geometry06=9,18,84,270,672,540,78000000,4968,620,0 nbuffers=2 m7disable=1 keymap=1323232 return=0
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue