LEDs now operating on button push
Fixed several bugs: - TCB wasn't running. The datasheet steps were not complete. - TCA was waking the MCU and causing the main program to run. Added checks to ensure program only runs on button or TCB wakeup. - Fixed some peculiarities with specific RGBLED programs
This commit is contained in:
@@ -19,8 +19,9 @@
|
||||
|
||||
|
||||
|
||||
#define enable_rgb_timer() {TCB0.CNT = 0; TCB0.CTRLA |= 1;};
|
||||
#define disable_rgb_timer() {TCB0.CTRLA &= ~1;};
|
||||
#define enable_rgb_timer() {TCB0.CNT = 0; TCB0.INTFLAGS = 0xff; \
|
||||
TCB0.INTCTRL = TCB_CAPT_bm; TCB0.CTRLA |= TCB_ENABLE_bm;};
|
||||
#define disable_rgb_timer() {TCB0.INTCTRL = 0; TCB0.CTRLA &= ~TCB_ENABLE_bm;};
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +32,10 @@ extern uint8_t (*rgb_program[PROG_COUNT])(uint8_t);
|
||||
|
||||
|
||||
|
||||
extern volatile uint8_t rgb_run_next;
|
||||
|
||||
|
||||
|
||||
void conf_rgb_timer();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user