~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/cfg-blf-q8.h

  • Committer: Selene ToyKeeper
  • Date: 2023-11-04 15:09:10 UTC
  • mfrom: (483.1.175 anduril2)
  • Revision ID: bzr@toykeeper.net-20231104150910-ddd3afw4nhfvof2l
merged anduril2 branch -> fsm, with *years* of changes
(this also means this code is now Anduril 2 instead of Anduril 1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// BLF Q8 config options for Anduril
2
 
#include "hwdef-BLF_Q8.h"
 
2
// Copyright (C) 2018-2023 Selene ToyKeeper
 
3
// SPDX-License-Identifier: GPL-3.0-or-later
 
4
#pragma once
 
5
 
 
6
#define MODEL_NUMBER "0611"
 
7
#include "hwdef-blf-q8.h"
 
8
 
 
9
#define RAMP_SIZE 150
3
10
 
4
11
// the button lights up
5
12
#define USE_INDICATOR_LED
6
13
// the button is visible while main LEDs are on
7
14
#define USE_INDICATOR_LED_WHILE_RAMPING
8
 
// enable blinking indicator LED while off
9
 
#define TICK_DURING_STANDBY
10
 
#define STANDBY_TICK_SPEED 3  // every 0.128 s
11
 
#define USE_FANCIER_BLINKING_INDICATOR
12
15
// off mode: high (2)
13
16
// lockout: blinking (3)
14
17
#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
17
20
// ../../bin/level_calc.py 1 65 7135 1 0.8 150
18
21
// ... mixed with this:
19
22
// ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500
20
 
#define RAMP_LENGTH 150
21
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
22
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
 
23
26
#define MAX_1x7135 65
 
27
#define DEFAULT_LEVEL 65
24
28
#define HALFSPEED_LEVEL 14
25
29
#define QUARTERSPEED_LEVEL 5
26
30
 
 
31
#define RAMP_SMOOTH_FLOOR 1
 
32
#define RAMP_SMOOTH_CEIL 120
 
33
// 10 28 46 [65] 83 101 120
 
34
#define RAMP_DISCRETE_FLOOR 10
 
35
#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
 
36
#define RAMP_DISCRETE_STEPS 7
 
37
 
 
38
// at Sofirn's request, use max (150) for the Simple UI ceiling
 
39
#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR
 
40
#define SIMPLE_UI_CEIL 150
 
41
#define SIMPLE_UI_STEPS 5
 
42
 
 
43
// also at Sofirn's request, enable 2 click turbo (Anduril 1 style)
 
44
#define DEFAULT_2C_STYLE 1
 
45
 
 
46
// enable SOS in the blinkies group
 
47
#define USE_SOS_MODE
 
48
#define USE_SOS_MODE_IN_BLINKY_GROUP
 
49
 
 
50
// Allow 3C in Simple UI for switching between smooth and stepped ramping
 
51
#define USE_SIMPLE_UI_RAMPING_TOGGLE
 
52
#define USE_EXTENDED_SIMPLE_UI
 
53
 
27
54
// stop panicking at ~75% power or ~3000 lm, this light has high thermal mass
28
55
#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10)  // throttle back faster when high
29
56
 
 
57
// don't blink mid-ramp
 
58
#ifdef BLINK_AT_RAMP_MIDDLE
 
59
#undef BLINK_AT_RAMP_MIDDLE
 
60
#endif
 
61
 
 
62
#define USE_SMOOTH_STEPS
 
63
 
 
64
// too big, remove stuff to make room
 
65
#undef USE_SOS_MODE
 
66
//#undef USE_RAMP_AFTER_MOON_CONFIG
 
67
//#undef USE_RAMP_SPEED_CONFIG
 
68
//#undef USE_VOLTAGE_CORRECTION
 
69
//#undef USE_2C_STYLE_CONFIG
 
70
//#undef USE_TACTICAL_STROBE_MODE
 
71
#undef USE_TACTICAL_MODE