From 0e15780d4ab840b61133c46776df0122cc75c3c7 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 14 May 2023 14:38:17 +0200 Subject: [PATCH 1/1] test-display2: Blink led on IR RX --- test-display2/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test-display2/main.c b/test-display2/main.c index e12ee02..50ce567 100644 --- a/test-display2/main.c +++ b/test-display2/main.c @@ -282,6 +282,8 @@ static u32 ir_get_pulse(void) // Decoder for Onkyo RC-748S +static u32 ir_blink_start; + static void ir_decode(void) { u32 pulse = ir_get_pulse(); @@ -330,7 +332,8 @@ static void ir_decode(void) } if (ir_bits == 33) { debug_printf("IR: => %08x\n", (uint)ir_code); - disp[3] ^= 0x01; + disp[3] |= 0x01; + ir_blink_start = ms_ticks; display_update(); ir_bits = IR_ERR; ep82_send(ir_code); @@ -606,7 +609,11 @@ int main(void) disp[3] = (disp[3] & 0x01) | 0x10; } } - disp[0] ^= 0x01; + display_update(); + } + + if ((disp[3] & 0x01) && ms_ticks - ir_blink_start >= 100) { + disp[3] &= 0xfe; display_update(); } -- 2.39.2