~toykeeper/flashlight-firmware/trunk

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/cfg-emisar-d4v2.h

  • Committer: Selene Scriven
  • Date: 2019-08-05 07:44:30 UTC
  • mfrom: (188.12.1 d4v2)
  • mto: (188.17.1 fsm)
  • mto: This revision was merged to the branch mainline in revision 234.
  • Revision ID: bzr@toykeeper.net-20190805074430-sobvfu2kpbbttmwo
merged Emisar D4v2 branch, or at least a sanitized version of it

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Emisar D4 config options for Anduril
 
2
#include "hwdef-Emisar_D4v2.h"
 
3
// ATTINY: 1634
 
4
 
 
5
// this light has three aux LED channels: R, G, B
 
6
#define USE_AUX_RGB_LEDS
 
7
// the aux LEDs are front-facing, so turn them off while main LEDs are on
 
8
#ifdef USE_INDICATOR_LED_WHILE_RAMPING
 
9
#undef USE_INDICATOR_LED_WHILE_RAMPING
 
10
#endif
 
11
// enable blinking aux LEDs
 
12
#define TICK_DURING_STANDBY
 
13
#define STANDBY_TICK_SPEED 3  // every 0.128 s
 
14
//#define STANDBY_TICK_SPEED 4  // every 0.256 s
 
15
//#define STANDBY_TICK_SPEED 5  // every 0.512 s
 
16
 
 
17
 
 
18
// copied from original D4, since it's also a FET+1 and has the same host
 
19
// ../../bin/level_calc.py 1 65 7135 1 0.8 150
 
20
// ... mixed with this:
 
21
// ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500
 
22
#define RAMP_LENGTH 150
 
23
#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,6,7,8,9,10,12,13,14,15,17,19,20,22,24,26,29,31,34,36,39,42,45,48,51,55,59,62,66,70,75,79,84,89,93,99,104,110,115,121,127,134,140,147,154,161,168,176,184,192,200,209,217,226,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
 
24
#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,1,3,4,5,7,8,9,11,12,14,15,17,19,20,22,24,25,27,29,31,33,35,37,39,41,43,45,48,50,52,55,57,59,62,64,67,70,72,75,78,81,84,87,90,93,96,99,102,105,109,112,115,119,122,126,129,133,137,141,144,148,152,156,160,165,169,173,177,182,186,191,195,200,205,209,214,219,224,229,234,239,244,250,255
 
25
#define MAX_1x7135 65
 
26
#define HALFSPEED_LEVEL 14
 
27
#define QUARTERSPEED_LEVEL 6
 
28
 
 
29
#define RAMP_SMOOTH_FLOOR 1
 
30
#define RAMP_SMOOTH_CEIL 120
 
31
// 10, 28, 46, [65], 83, 101, 120
 
32
#define RAMP_DISCRETE_FLOOR 10
 
33
#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
 
34
#define RAMP_DISCRETE_STEPS 7
 
35
 
 
36
// optional, makes initial turbo step-down faster so first peak isn't as hot
 
37
// the D4 runs very very hot, so be extra careful
 
38
//#define THERM_HARD_TURBO_DROP
 
39
 
 
40
// stop panicking at ~30% power or ~1200 lm
 
41
#define THERM_FASTER_LEVEL 105
 
42
// respond to thermal changes faster
 
43
#define THERMAL_WARNING_SECONDS 3
 
44
#define THERMAL_UPDATE_SPEED 1
 
45
#define THERM_PREDICTION_STRENGTH 4
 
46
//#define THERM_RESPONSE_MAGNITUDE 128
 
47
 
 
48
// easier access to thermal config mode, for Emisar
 
49
#define USE_TENCLICK_THERMAL_CONFIG
 
50
 
 
51
#define THERM_CAL_OFFSET 5