Pi Firmware: Use LED1 and a genlock indicator

Change-Id: Iada75ebaa8492e7322947813751a156af951c381
pull/22/head
David Banks 2018-12-05 11:33:16 +00:00
rodzic e7eff3cf46
commit f75ab12bd6
5 zmienionych plików z 28 dodań i 5 usunięć

Wyświetl plik

@ -155,7 +155,7 @@ typedef struct {
// LED1 is left LED, driven by the Pi
// LED2 is the right LED, driven by the CPLD, as a copy of mode 7
// both LEDs are active low
// both LEDs are active high
#define LED1_PIN (27)
#define SW1_MASK (1 << SW1_PIN)
@ -163,6 +163,7 @@ typedef struct {
#define SW3_MASK (1 << SW3_PIN)
#define PSYNC_MASK (1 << PSYNC_PIN)
#define CSYNC_MASK (1 << CSYNC_PIN)
#define LED1_MASK (1 << LED1_PIN)
#define INTERLACED_FLAG (1 << 31)

Wyświetl plik

@ -861,7 +861,6 @@ void osd_clear() {
memset(buffer, 0, sizeof(buffer));
osd_update((uint32_t *)capinfo->fb, capinfo->pitch);
active = 0;
RPI_SetGpioValue(LED1_PIN, active);
osd_update_palette();
}
}
@ -869,7 +868,6 @@ void osd_clear() {
void osd_set(int line, int attr, char *text) {
if (!active) {
active = 1;
RPI_SetGpioValue(LED1_PIN, active);
osd_update_palette();
}
attributes[line] = attr;

Wyświetl plik

@ -492,6 +492,22 @@ skip_osd_update:
push {r0-r12, lr}
bl recalculate_hdmi_clock_line_locked_update
// Returns:
// r0=0 genlock disabled - LED off
// r0=1 genlock enabled (unlocked) - LED flash
// r0=2 genlock enabled (locked) - LED on
READ_CYCLE_COUNTER r1
mov r2, #LED1_MASK
tst r0, #1 // should LED flash?
tstne r1, #(1 << 26) // flash rate ~ 8Hz
tsteq r0, #2 // should LED be on?
ldrne r1, =GPSET0 // LED on
ldreq r1, =GPCLR0 // LED off
str r2, [r1]
pop {r0-r12, lr}
ldr r0, lock_fail

Wyświetl plik

@ -33,6 +33,6 @@ extern int default_vsync_line;
extern int lock_fail;
void recalculate_hdmi_clock_line_locked_update();
int recalculate_hdmi_clock_line_locked_update();
#endif

Wyświetl plik

@ -525,7 +525,7 @@ static void recalculate_hdmi_clock_once(int vlockmode) {
}
}
void recalculate_hdmi_clock_line_locked_update() {
int recalculate_hdmi_clock_line_locked_update() {
lock_fail = 0;
if (vlockmode != HDMI_EXACT) {
genlocked = 0;
@ -576,6 +576,14 @@ void recalculate_hdmi_clock_line_locked_update() {
}
}
}
if (vlockmode != HDMI_EXACT) {
// Return 0 if genlock disabled
return 0;
} else {
// Return 1 if genlock enabled but not yet locked
// Return 2 if genlock enabled and locked
return 1 + genlocked;
}
}
static void init_hardware() {