diff --git a/firmware/main.c b/firmware/main.c index 9e36e2e..971e755 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -72,9 +72,12 @@ PGM_P const help_table[] PROGMEM = { help_16 }; -volatile uint8_t* PORTS[CHANNELS_1+CHANNELS_2] = {&PORTC,&PORTC,&PORTC,&PORTC,&PORTC,&PORTD,&PORTD,&PORTD,&PORTD,&PORTD}; -volatile uint8_t* DDRS[CHANNELS_1+CHANNELS_2] = {&DDRC,&DDRC,&DDRC,&DDRC,&DDRC,&DDRD,&DDRD,&DDRD,&DDRD,&DDRD}; -const uint8_t BITS[CHANNELS_1+CHANNELS_2] = {PC0,PC1,PC2,PC3,PC4}; +//volatile uint8_t* PORTS[CHANNELS_1+CHANNELS_2] = {&PORTC,&PORTC,&PORTC,&PORTC,&PORTC,&PORTD,&PORTD,&PORTD,&PORTD,&PORTD}; +volatile uint8_t* PORTS[CHANNELS_1+CHANNELS_2] = {&PORTC,&PORTC,&PORTC,&PORTD,&PORTD,&PORTD}; +//volatile uint8_t* DDRS[CHANNELS_1+CHANNELS_2] = {&DDRC,&DDRC,&DDRC,&DDRC,&DDRC,&DDRD,&DDRD,&DDRD,&DDRD,&DDRD}; +volatile uint8_t* DDRS[CHANNELS_1+CHANNELS_2] = {&DDRC,&DDRC,&DDRC,&DDRD,&DDRD,&DDRD}; +//const uint8_t BITS[CHANNELS_1+CHANNELS_2] = {PC0,PC1,PC2,PC3,PC4,PD2,PD3,PD4,PD5,PD7}; +const uint8_t BITS[CHANNELS_1+CHANNELS_2] = {PC0,PC1,PC2,PD2,PD3,PD4}; /* global variables */ #define INPUT_MAX 255 /* max length for user input string */ @@ -624,6 +627,15 @@ void ir_action(uint8_t address, uint8_t command) brightness[mode][channel] = 0xff; } printf("increasing brightness ch %u %u: %u\n",(channel/CHANNELS_1)+1,(channel%CHANNELS_1)+1,brightness[mode][channel]); + } else if (channel==CHANNELS_1+CHANNELS_2) { + for (uint8_t i=0; istep) { + brightness[mode][i] -= step; + } else { + brightness[mode][i] = 0x00; + } + } + printf("decreasing brightness all channels\n"); } channel_flag = true; break; case CHANNEL_NEXT: - if (channel