* - ( 9) RB3 - CCP1 PWM for red LED
* - (10) RB4 - rocker switch position B (right)
* - (11) RB5 - rocker switch position A (left)
- * - (12) RB6 - unused
- * - (13) RB7 - unused
+ * - (12) RB6 - unused (future crystal)
+ * - (13) RB7 - unused (future crystal)
* - (14) Vdd
* - (15) RA6 - unused
* - (16) RA7 - CCP2 PWM for grn LED
#include "buttons.h"
#include "rgb.h"
#include "timer.h"
+#include "adc_random.h"
#define AUTO_OFF_COUNT 549316UL /* 5 hrs in 32.768 ms units */
#define reset_steps() do { incolor_steps = 1; fade_steps = 0; } \
typedef struct {
int value;
int increment;
- char remainder;
+ signed char remainder;
} led_t;
#define INIT_LED { 0, 0, 0 }
int fade_steps;
unsigned long auto_off = 0;
-
pic_init();
unused_init();
buttons_init();
timer_init();
dbgpin_init();
+ srand((adc_random() << 8) + adc_random());
reset_steps();
if (buttons_on())
rgb_on();