~toykeeper/flashlight-firmware/trunk

188.5.1 by Selene Scriven
First working PL47 build. Does aux LEDs on pin 7 but not pin 3.
1
// Fireflies PL47 config options for Anduril
188.7.1 by Selene Scriven
Reworked the config file include system so it'll include the #defined value
2
#include "hwdef-FF_PL47.h"
188.5.1 by Selene Scriven
First working PL47 build. Does aux LEDs on pin 7 but not pin 3.
3
4
// the button lights up
5
#define USE_INDICATOR_LED
6
// the aux LEDs are in the same place as the main LEDs
7
#ifdef USE_INDICATOR_LED_WHILE_RAMPING
8
#undef USE_INDICATOR_LED_WHILE_RAMPING
9
#endif
10
//#define USE_INDICATOR_LED_WHILE_RAMPING
11
// enable blinking indicator LED while off?
12
#define TICK_DURING_STANDBY
13
14
// If TICK_DURING_STANDBY is enabled...
15
// off mode: high (2)
16
// lockout: blinking (3)
17
#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
18
188.5.2 by Selene Scriven
Added option to skip "low" mode for aux LEDs.
19
// the "low" mode doesn't work on this light's aux LEDs
20
// (but it does work on the switch LEDs)
188.5.5 by Selene Scriven
PL47 doesn't need "low" mode for aux LED / switch LED
21
// Fireflies wants to skip aux LED mode 1 (low)
22
#define INDICATOR_LED_SKIP_LOW
188.5.2 by Selene Scriven
Added option to skip "low" mode for aux LEDs.
23
188.5.1 by Selene Scriven
First working PL47 build. Does aux LEDs on pin 7 but not pin 3.
24
// ... or if TICK_DURING_STANDBY is turned off:
25
// off mode: high (2)
26
// lockout: off (0)
27
//#define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2)
28
29
30
#define RAMP_LENGTH 150
31
32
// driver is a FET + 3x7135, ~400 lm at highest regulated level
33
// ramp copied from Emisar D4S ramp
34
#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,29,31,32,34,36,38,40,42,44,46,49,51,54,56,59,62,65,68,71,74,78,81,85,89,93,97,101,106,110,115,120,125,130,136,141,147,153,160,166,173,180,187,195,202,210,219,227,236,245,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,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
35
#define PWM2_LEVELS 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,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,1,3,4,5,7,8,10,11,13,14,16,18,19,21,23,25,27,29,31,34,36,38,41,43,46,48,51,54,57,60,63,66,69,72,76,79,83,87,91,95,99,103,107,112,116,121,126,131,136,141,146,152,158,163,169,175,182,188,195,202,209,216,223,231,239,247,255
36
#define MAX_1x7135 83
37
#define HALFSPEED_LEVEL 13
38
#define QUARTERSPEED_LEVEL 6
39
40
// thermal regulation parameters
41
#ifdef MIN_THERM_STEPDOWN
42
#undef MIN_THERM_STEPDOWN  // this should be lower, because 3x7135 instead of 1x7135
43
#endif
44
#define MIN_THERM_STEPDOWN 60  // lowest value it'll step down to
45
188.1.194 by Selene Scriven
Adjusted FF PL47 config. Made muggle floor/ceiling configurable per config file.
46
// ceiling is level 120/150
47
#define RAMP_SMOOTH_CEIL 120
48
49
// 10, 28, 46, 65, 83, 101, 120  (83 is highest regulated)
50
#define RAMP_DISCRETE_FLOOR 10
51
#define RAMP_DISCRETE_CEIL 120
52
#define RAMP_DISCRETE_STEPS 7
53
54
// ~25 lm to ~300 lm
55
#define MUGGLE_FLOOR 30
56
#define MUGGLE_CEILING MAX_1x7135
57
// ~50 lm to ~500 lm
58
//#define MUGGLE_FLOOR 40
59
//#define MUGGLE_CEILING 90
60
188.5.1 by Selene Scriven
First working PL47 build. Does aux LEDs on pin 7 but not pin 3.
61
// regulate down faster when the FET is active, slower otherwise
188.1.230 by Selene Scriven
Rewrote thermal regulation. Seems to be much more stable now... doesn't bounce, doesn't overshoot, doesn't lag.
62
#define THERM_FASTER_LEVEL 135  // throttle back faster when high
188.5.1 by Selene Scriven
First working PL47 build. Does aux LEDs on pin 7 but not pin 3.
63
64
// don't do this
188.9.3 by Selene Scriven
made mid-ramp blinks more configurable per build target
65
#undef BLINK_AT_RAMP_MIDDLE
188.5.1 by Selene Scriven
First working PL47 build. Does aux LEDs on pin 7 but not pin 3.
66
#undef BLINK_AT_RAMP_CEILING
67