4
* Define modegroups for bistro
6
* Copyright (C) 2015 Selene Scriven
7
* Much work added by Texas Ace, and some minor format change by Flintrock.
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24
// ../../bin/level_calc.py 64 1 10 1300 y 3 0.23 140
26
#define TURBO RAMP_SIZE // Convenience code for turbo mode
28
//#define RAMP_PWM2 3,3,3,3,3,3,4,4,4,4,4,5,5,5,6,6,7,7,8,9,10,11,12,13,15,16,18,21,23,27,30,34,39,44,50,57,65,74,85,97,111,127,145,166,190,217,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
29
//#define RAMP_PWM3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,6,11,17,23,30,39,48,59,72,86,103,121,143,168,197,255
31
//#define RAMP_PWM2 3,5,8,12,17,24,32,41,51,63,75,90,105,121,139,158,178,200,223,247,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
32
//#define RAMP_PWM3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,6,9,12,16,19,22,26,30,33,37,41,45,50,54,59,63,68,73,78,84,89,94,100,106,111,117,123,130,136,142,149,156,162,169,176,184,191,198,206,214,221,255
34
// ../../bin/level_calc.py 3 40 7135 3 0.25 140 7135 3 1.5 840 FET 1 10 3000
35
// (with some manual tweaks to exactly hit 1x7135 and Nx7135 in the middle)
38
//#define RAMP_PWM2 3,4,7,11,18,25,35,55,75,100,133,169,211,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
39
//#define RAMP_PWM1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,22,35,49,64,82,101,122,144,169,195,224,255,255,255,255,255,255,255,255,255,255,255,255,255,0
40
//#define RAMP_PWM3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,24,39,55,73,91,111,132,154,177,202,228,255
42
// Same as above but with 20 ramp instead of 40 to save space for more mode groups
43
// ../../bin/level_calc.py 3 20 7135 3 0.25 140 7135 3 1.5 840 FET 1 10 3000
44
// (with some manual tweaks to exactly hit 1x7135 and Nx7135 in the middle, also adjustments to some lower modes to better space them)
47
// These don't define which PWM channels are enabled. Do that in FR-tk-attiny25.h
49
#define ONE7135 5 // not precisely true, but we need something defined for the strobe that uses it.
50
#define RAMP_PWM1 0, 0, 0, 0, 7, 56, 90,137,255
51
// PWM levels for the small circuit (1x7135)
52
#define RAMP_PWM2 3,20,110,230,255,255,255,255,0
55
//#define RAMP_PWM4 4,7,20,35,55,100,160,255,255,255,255,255,255,255,255,255,255,255,255,0 // just for testing/example, but doesn't hurt anything.
56
// testing only: First 3 modes show each channel individually
57
//#define RAMP_PWM2 255,0,0,255,18,27,40,57,77,103,133,169,211,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
58
//#define RAMP_PWM1 0,255,0,255,0,0,0,0,0,0,0,0,0,0,11,22,35,49,64,82,101,122,144,169,195,224,255,255,255,255,255,255,255,255,255,255,255,255,255,0
59
//#define RAMP_PWM3 0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,24,39,55,73,91,111,132,154,177,202,228,255
60
// 1200-lm single LED: ../../bin/level_calc.py 3 40 7135 3 0.25 160 7135 3 1.5 760 FET 1 3 1200
61
//#define RAMP_PWM2 3,4,5,7,10,14,19,25,33,43,54,67,83,101,121,144,170,198,230,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
62
//#define RAMP_PWM1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,18,28,40,52,65,78,92,107,124,143,163,184,207,230,255,255,255,255,0
63
//#define RAMP_PWM3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,103,177,255
67
//#define RAMP_PWM2 3,3,3,4,4,5,5,6,7,8,10,11,13,15,18,21,24,28,33,38,44,50,57,66,75,85,96,108,122,137,154,172,192,213,237,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
68
//#define RAMP_PWM3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,6,9,13,17,21,25,30,35,41,47,53,60,67,75,83,91,101,111,121,132,144,156,169,183,198,213,255
70
// uncomment to ramp up/down to a mode instead of jumping directly
71
// #define SOFT_START // Cause a flash during mode change with some drivers
74
// output to use for blinks on battery check (and other modes)
75
#define BLINK_BRIGHTNESS RAMP_SIZE/4
76
// ms per normal-speed blink
78
// Hidden modes are *before* the lowest (moon) mode, and should be specified
79
// in reverse order. So, to go backward from moon to turbo to strobe to
80
// battcheck, use BATTCHECK,STROBE,TURBO .
82
#ifndef HIDDENMODES // This will already be set as empty if no reverse clicks are enabled.
83
#define HIDDENMODES BIKING_STROBE,BATTCHECK,STROBE_10HZ,TURBO
84
//#define HIDDENMODES BATTCHECK,RAMP,TURBO
87
PROGMEM const uint8_t hiddenmodes[] = { HIDDENMODES };
89
// default values calculated by group_calc.py
90
// ONE7135 = 8, ALL7135s = 14, TURBO = 20
91
// Modes approx mA and lumen values for single XP-L LEDe
92
// 1 = 5.5ma = .5lm, 3 = 19ma = 4lm, 4 = 37mA = 12lm, 5 = 66ma = 24lm,
93
// 6 = 135ma = ~60lm, 8 (one7135) = 355ma = ~150lm
94
// Above this it will depend on how many 7135's are installed
95
// With 7x 7135 10 = 640ma, 12 = 1A = ~335lm, 14 (ALL7135s) = 2.55A = ~830lm
96
// Above this you are using the FET and it will vary wildy depending on the build, generally you only need turbo after ALL7135s unless it is a triple build
97
#define NUM_MODEGROUPS 2 // don't count muggle mode
98
// mode groups are now zero terminated rather than fixed length. Presently 8 modes max but this can change now.
99
// going too near the fast press limit could be annoying though as a full cycle requires pausing to avoid the menu.
101
// Define maximum modes per group
102
// Increasing this is not expensive, essentially free in program size.
103
// The memory usage depends only on total of actual used modes (plus the single trailing zero).
104
#define MAX_MODES 9 // includes moon mode, defined modes per group should be one less. The 0 terminator doesn't count though.
105
// Each group must end in one and ONLY one zero, and can include no other 0.
106
PROGMEM const uint8_t modegroups[] = {
107
1,2,3,5,6,8,9, 0, // 1: 7 modes
108
2,4,7,9,0 // 2: 4 modes
b'\\ No newline at end of file'