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/>.
26
// ../../bin/level_calc.py 64 1 10 1300 y 3 0.23 140
28
#define TURBO RAMP_SIZE // Convenience code for turbo mode
30
//#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
31
//#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
33
//#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
34
//#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
36
// ../../bin/level_calc.py 3 40 7135 3 0.25 140 7135 3 1.5 840 FET 1 10 3000
37
// (with some manual tweaks to exactly hit 1x7135 and Nx7135 in the middle)
40
//#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
41
//#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
42
//#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
44
// Same as above but with 20 ramp instead of 40 to save space for more mode groups
45
// ../../bin/level_calc.py 3 20 7135 3 0.25 140 7135 3 1.5 840 FET 1 10 3000
46
// (with some manual tweaks to exactly hit 1x7135 and Nx7135 in the middle, also adjustments to some lower modes to better space them)
49
// These don't define which PWM channels are enabled. Do that in FR-tk-attiny25.h
50
#define RAMP_PWM2 4,7,20,35,55,100,160,255,255,255,255,255,255,255,255,255,255,255,255,0
51
#define RAMP_PWM1 0,0,0,0,0,0,0,0,35,64,95,122,180,255,255,255,255,255,255,0
52
#define RAMP_PWM3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,69,108,152,201,255
53
#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.
54
// testing only, separate channels:
55
//#define RAMP_PWM2 4,7,20,35,55,100,160,0,0,0,0,0,0,0,0,0,0,0,0,0 // for testing individual channels
56
//#define RAMP_PWM1 0,0,0,0,0,0,0,0,35,64,95,122,180,0,0,0,0,0,0,0 // for testing individual channels
57
//#define RAMP_PWM3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,69,108,152,201,255
58
// testing only: First 3 modes show each channel individually
59
//#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
60
//#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
61
//#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
62
// 1200-lm single LED: ../../bin/level_calc.py 3 40 7135 3 0.25 160 7135 3 1.5 760 FET 1 3 1200
63
//#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
64
//#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
65
//#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
69
//#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
70
//#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
72
// uncomment to ramp up/down to a mode instead of jumping directly
73
// #define SOFT_START // Cause a flash during mode change with some drivers
76
// output to use for blinks on battery check (and other modes)
77
#define BLINK_BRIGHTNESS RAMP_SIZE/4
78
#define BLINK_BRIGHTNESS 1
79
// ms per normal-speed blink
81
// Hidden modes are *before* the lowest (moon) mode, and should be specified
82
// in reverse order. So, to go backward from moon to turbo to strobe to
83
// battcheck, use BATTCHECK,STROBE,TURBO .
85
#ifndef HIDDENMODES // This will already be set as empty if no reverse clicks are enabled.
86
#define HIDDENMODES STROBE_CREEPY,STROBE_OLD_MOVIE,STROBE_16HZ,STROBE_10HZ,BIKING_STROBE,BATTCHECK,TURBO
87
//#define HIDDENMODES BATTCHECK,RAMP,TURBO
90
PROGMEM const uint8_t hiddenmodes[] = { HIDDENMODES };
92
// default values calculated by group_calc.py
93
// ONE7135 = 8, ALL7135s = 14, TURBO = 20
94
// Modes approx mA and lumen values for single XP-L LEDe
95
// 1 = 5.5ma = .5lm, 3 = 19ma = 4lm, 4 = 37mA = 12lm, 5 = 66ma = 24lm,
96
// 6 = 135ma = ~60lm, 8 (one7135) = 355ma = ~150lm
97
// Above this it will depend on how many 7135's are installed
98
// With 7x 7135 10 = 640ma, 12 = 1A = ~335lm, 14 (ALL7135s) = 2.55A = ~830lm
99
// 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
100
#define NUM_MODEGROUPS 24 // don't count muggle mode
101
// mode groups are now zero terminated rather than fixed length. Presently 8 modes max but this can change now.
102
// going too near the fast press limit could be annoying though as a full cycle requires pausing to avoid the menu.
104
// Define maximum modes per group
105
// Increasing this is not expensive, essentially free in program size.
106
// The memory usage depends only on total of actual used modes (plus the single trailing zero).
107
#define MAX_MODES 9 // includes moon mode, defined modes per group should be one less. The 0 terminator doesn't count though.
108
// Each group must end in one and ONLY one zero, and can include no other 0.
109
PROGMEM const uint8_t modegroups[] = {
110
ALL7135s, 0, // 1: 1 mode group
111
ONE7135, TURBO, 0, // 2: 2 mode Group
112
ONE7135, ALL7135s, TURBO, 0, // 3: You should get the idea by now....
113
4, ONE7135, ALL7135s, TURBO, 0, // 4: 4 mode group that has turbo in the main modes instead of just in the hidden modes.
114
3, 5, ONE7135, ALL7135s, TURBO, 0, // 5: Wild guess on # of modes?
115
3, 5, ONE7135, 10, ALL7135s, TURBO, 0, // 6: If you guessed right before, you should be able to figure this one out
116
3, 5, ONE7135, 10, ALL7135s, 16, TURBO, 0, // 7: 7 modes for triple builds, the high modes are too close together on single emitter builds
117
3, 5, ONE7135, 10, ALL7135s, 16, 18, TURBO,0, // 8: 8 modes for triple builds, the high modes are too close together on single emitter builds
118
ONE7135, 0, // 9: Basic Non-PWM ~150 lumen low regulated mode
119
ALL7135s, 0, // 10: Basic non-PWM ~800 lumen regulated mode
120
ONE7135, ALL7135s, 0, // 11: Only non-PWM modes
121
4, ONE7135, ALL7135s, 0, // 12: Defualt mode group 3 mode regulated, Recomended mode group for single emitter lights, you can accsess turbo via the hidden modes
122
3, 5, ONE7135, ALL7135s, 0, // 13: 4 mode regulated
123
3, 5, ONE7135, 10, ALL7135s, 0, // 14: I kinda think you get it by now
124
4, ONE7135, ALL7135s, 16, TURBO, 0, // 15: A more basic group for triple builds.
125
BIKING_STROBE,BATTCHECK,4,ONE7135,ALL7135s,16,18,TURBO,0,// 16: Biking group
126
ONE7135, 10, 12, ALL7135s, 15, 16, 18, TURBO,0, // 17: Lots of steady modes biking group for fine tuning heat mangagement. Adjust number of 7135's for finer current control.
127
ONE7135, ALL7135s, STROBE_10HZ, TURBO, 0, // 18: Tactical group
128
2, 3, 4, 5, 0, // 19: Super sneaker low modes, .5 - 24 lumens
129
4, TURBO, 0, // 20: Security guard speical, highly requested mode group for guards
130
4, ALL7135s, TURBO, 0, // 21: 3 mode group setup without a 1x 7135 mode, jumps from low ~13 lumens, to the bank of 7135's. It is recomended you only install 2-4 7135's on the bank so that the mode is a good mid range between low and turbo.
131
4, ONE7135, 16, TURBO, 0, // 22: 4 mode group setup for using the driver as a normal FET+1 with no 7135's on the bottom
132
4, ONE7135, 15, 17, TURBO, 0, // 23: 5 mode group setup for using the driver as a normal FET+1 with no 7135's on the bottom
133
// ALL7135s, 0, // 24: ???????????
134
// ALL7135s, 0, // 25: ???????????
135
// ALL7135s, 0, // 26: ???????????
136
// ALL7135s, 0, // 27: ???????????
137
// ALL7135s, 0, // 28: ???????????
138
// ALL7135s, 0, // 29: ???????????
139
STROBE_10HZ,STROBE_16HZ,STROBE_OLD_MOVIE,STROBE_CREEPY,TURBO,ALL7135s,ONE7135,4,0, // 30: Disco party mode! Lots o fun for the whole party with all sorts of strobe modes to play with!
141
// 2, 5, ONE7135, 11, ALL7135s, 16, 18, TURBO,0, // 31: Custom mode group so the rest of the groups can stay the same for easy referance later
142
4, ONE7135, ALL7135s, 0 // muggle mode
b'\\ No newline at end of file'