From: Martin Mares Date: Sun, 14 May 2023 12:38:17 +0000 (+0200) Subject: test-display2: Blink led on IR RX X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0e15780d4ab840b61133c46776df0122cc75c3c7;hp=a9d52ef421c6de4507ec8d294665e55fc83bfe49;p=home-hw.git test-display2: Blink led on IR RX --- 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(); }