~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to Flintrock/bistro-hd/modegroups/modegroups-classic.h

  • Committer: Selene Scriven
  • Date: 2017-09-12 23:34:36 UTC
  • mto: (188.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 331.
  • Revision ID: bzr@toykeeper.net-20170912233436-d3w6nln0ts1subue
Added Flintrock's Bistro-HD 1.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __MODEGROUPS_H
 
2
#define __MODEGROUPS_H
 
3
/*
 
4
* Define modegroups for bistro classic
 
5
*
 
6
* Copyright (C) 2015 Selene Scriven
 
7
*
 
8
* This program is free software: you can redistribute it and/or modify
 
9
* it under the terms of the GNU General Public License as published by
 
10
* the Free Software Foundation, either version 3 of the License, or
 
11
* (at your option) any later version.
 
12
*
 
13
* This program is distributed in the hope that it will be useful,
 
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
* GNU General Public License for more details.
 
17
*
 
18
* You should have received a copy of the GNU General Public License
 
19
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
*
 
21
*/
 
22
 
 
23
// ../../bin/level_calc.py 64 1 10 1300 y 3 0.23 140
 
24
#define RAMP_SIZE  64
 
25
#define TURBO     RAMP_SIZE      // Convenience code for turbo mode
 
26
// log curve
 
27
//#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
 
28
//#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
 
29
// x**2 curve
 
30
//#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
 
31
//#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
 
32
// x**3 curve
 
33
// ../../bin/level_calc.py 3 40 7135 3 0.25 140 7135 3 1.5 840 FET 1 10 3000
 
34
// (with some manual tweaks to exactly hit 1x7135 and Nx7135 in the middle)
 
35
//#define ONE7135 14
 
36
//#define ALL7135s 27
 
37
//#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
 
38
//#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
 
39
//#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
 
40
//X**3 curve
 
41
// Same as above but with 20 ramp instead of 40 to save space for more mode groups
 
42
// ../../bin/level_calc.py 3 20 7135 3 0.25 140 7135 3 1.5 840 FET 1 10 3000
 
43
// (with some manual tweaks to exactly hit 1x7135 and Nx7135 in the middle, also adjustments to some lower modes to better space them)
 
44
// These don't define which PWM channels are enabled.  Do that in FR-tk-attiny25.h
 
45
 
 
46
// 7135
 
47
#define ONE7135 29
 
48
#define RAMP_PWM2  3,3,4,5,6,8,10,12,15,19,23,28,33,40,47,55,63,73,84,95,108,122,137,153,171,190,210,232,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
 
49
//FET
 
50
#define RAMP_PWM1   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,5,8,11,14,18,22,26,30,34,39,44,49,54,59,65,71,77,84,91,98,105,113,121,129,137,146,155,164,174,184,194,205,216,255
 
51
 
 
52
//#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.
 
53
// testing only: First 3 modes show each channel individually
 
54
//#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
 
55
//#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
 
56
//#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
 
57
// 1200-lm single LED: ../../bin/level_calc.py 3 40 7135 3 0.25 160 7135 3 1.5 760 FET 1 3 1200
 
58
//#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
 
59
//#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
 
60
//#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
 
61
//#define ONE7135 20
 
62
//#define ALL7135s 36
 
63
// x**5 curve
 
64
//#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
 
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,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
 
66
 
 
67
// uncomment to ramp up/down to a mode instead of jumping directly
 
68
// #define SOFT_START          // Cause a flash during mode change with some drivers
 
69
 
 
70
 
 
71
// output to use for blinks on battery check (and other modes)
 
72
#define BLINK_BRIGHTNESS    17
 
73
// ms per normal-speed blink
 
74
 
 
75
// Hidden modes are *before* the lowest (moon) mode, and should be specified
 
76
// in reverse order.  So, to go backward from moon to turbo to strobe to
 
77
// battcheck, use BATTCHECK,STROBE,TURBO .
 
78
 
 
79
#ifndef HIDDENMODES // This will already be set as empty if no reverse clicks are enabled.
 
80
#define HIDDENMODES         BIKING_STROBE,BATTCHECK,POLICE_STROBE,TURBO
 
81
//#define HIDDENMODES         BATTCHECK,RAMP,TURBO
 
82
#endif
 
83
 
 
84
PROGMEM const uint8_t hiddenmodes[] = { HIDDENMODES };
 
85
 
 
86
// default values calculated by group_calc.py
 
87
// ONE7135 = 8, ALL7135s = 14, TURBO = 20
 
88
// Modes approx mA and lumen values for single XP-L LEDe
 
89
// 1 = 5.5ma = .5lm, 3 = 19ma = 4lm, 4 = 37mA = 12lm, 5 = 66ma = 24lm,
 
90
// 6 = 135ma = ~60lm, 8 (one7135) = 355ma = ~150lm
 
91
// Above this it will depend on how many 7135's are installed
 
92
// With 7x 7135 10 = 640ma, 12 = 1A = ~335lm, 14 (ALL7135s) = 2.55A = ~830lm
 
93
// 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
 
94
#define NUM_MODEGROUPS 9  // don't count muggle mode
 
95
// mode groups are now zero terminated rather than fixed length.  Presently 8 modes max but this can change now.
 
96
// going too near the fast press limit could be annoying though as a full cycle requires pausing to avoid the menu.
 
97
//
 
98
// Define maximum modes per group
 
99
// Increasing this is not expensive, essentially free in program size.
 
100
// The memory usage depends only on total of actual used modes (plus the single trailing zero).
 
101
#define MAX_MODES 9 // includes moon mode, defined modes per group should be one less. The 0 terminator doesn't count though.
 
102
// Each group must end in one and ONLY one zero, and can include no other 0.
 
103
PROGMEM const uint8_t modegroups[] = {
 
104
        64,  0,
 
105
        11, 64,  0,
 
106
        11, 35, 64,  0,
 
107
        11, 26, 46, 64,  0,
 
108
        11, 23, 36, 50, 64,  0,
 
109
        11, 20, 31, 41, 53, 64,  0,
 
110
        29, 64,POLICE_STROBE,0,  // 7: special group A
 
111
        BIKING_STROBE,BATTCHECK,11,29,64,0,  // 8: special group B
 
112
        9, 18, 29, 46, 64,  0,  // 9: special group C
 
113
        11, 29, 50,  0                  // muggle mode
 
114
};
 
115
 
 
116
#endif
 
 
b'\\ No newline at end of file'