From 0ae82501b7afe8333131e9daf7e2f09487e5ab87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sat, 19 Oct 2013 23:36:48 +0200 Subject: [PATCH] implement IR channel/brightness +/- --- firmware/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/firmware/main.c b/firmware/main.c index f162d1e..9e36e2e 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -593,6 +593,8 @@ error: void ir_action(uint8_t address, uint8_t command) { enum IR_ACTIONS ir_code = IR_ACTION_END; + static uint8_t channel = CHANNELS_1+CHANNELS_2; + uint8_t step = 0xff/LEVELS; for (ir_code=0; ir_codestep) { + brightness[mode][channel] -= step; + } else { + brightness[mode][channel] = 0x00; + } + printf("increasing brightness ch %u %u: %u\n",(channel/CHANNELS_1)+1,(channel%CHANNELS_1)+1,brightness[mode][channel]); + } + channel_flag = true; break; case CHANNEL_NEXT: + if (channel