8 #define N_PWMLED_MODES 4
14 void init_log(unsigned char mcusr);
15 void log_set_state(unsigned char val);
17 void log_byte(unsigned char byte);
18 void log_word(uint16_t word);
20 void inline init_log(unsigned char mcusr) { }
21 void inline log_set_state(unsigned char val) { }
22 void inline log_flush() { }
23 void inline log_byte(unsigned char byte) { }
24 void inline log_word(uint16_t word) { }
28 #define PWMLED_ADC_SHIFT 1 /* 1<<1 measurements per single callback */
31 void timer_start_slow_adcs();
32 extern volatile unsigned char adc_is_on;
36 * The real Timer/Counter 1 frequency should not be too close to the
37 * A/D converter frequency (125 kHz). Note that this is not the Top
38 * value of T/C 1, it is shifted by PWM_STEP_SHIFT as described in pwm.c
41 extern volatile unsigned char channels_running;
42 #define PWM_IS_ON(n) (channels_running & (1 << (n)))
43 #define TIMER1_IS_ON() (channels_running)
46 void pwm_off(unsigned char n);
47 void pwm_set(unsigned char n, uint16_t stride);
49 void pwm_disable_if_not_needed();
52 extern volatile uint16_t jiffies;
58 void pwmled_adc(unsigned char n, uint16_t adcval);
59 void pwmled_set_mode(unsigned char n, unsigned char mode);
64 void gpio_set(unsigned char n, unsigned char on);
67 #define AMBIENT_ADC_SHIFT 0 /* 1 measurement per callback */
70 void ambient_log_min_max();
71 extern volatile unsigned char ambient_zone;
72 void ambient_adc(uint16_t adc_val);
76 unsigned char mode: 5;
77 unsigned char duration_fib: 3;
80 #define PATTERN_END { 0, 0 }
90 void patterns_next_tick();
91 void led_set_pattern(unsigned char led, pattern_t *pattern);
92 pattern_t *number_pattern(unsigned char num, unsigned char inv);
93 void pattern_reload();
96 #define MAX_USER_PARAMS 3
99 void timer_check_buttons();
100 void button_adc(uint16_t adcval);
101 unsigned char get_user_param(unsigned char param);
102 unsigned char buttons_wait_for_release();
103 unsigned char buttons_setup_in_progress();
104 pattern_t *buttons_setup_status0_pattern_select();
105 pattern_t *buttons_setup_status1_pattern_select();
108 extern volatile unsigned char battery_critical;
111 unsigned char battery_gauge();
114 extern pattern_t on1_pattern[];
119 void toggle_dim_mode();
120 void set_panic_mode();
121 pattern_t *pwmled0_pattern_select();
122 pattern_t *pwmled1_pattern_select();
123 pattern_t *pwmled2_pattern_select();
124 pattern_t *status_led_pattern_select();
125 pattern_t *illumination_led_pattern_select();
126 pattern_t *laser_pattern_select();
129 void power_down(unsigned char err);
131 #endif /* !LIGHTS_H__ */