~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/cfg-ff-pl47.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
// Fireflies PL47 config options for Anduril
2
 
#include "hwdef-FF_PL47.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 "0421"
 
7
#include "hwdef-ff-pl47.h"
 
8
// ATTINY: 85
3
9
 
4
10
// the button lights up
5
11
#define USE_INDICATOR_LED
8
14
#undef USE_INDICATOR_LED_WHILE_RAMPING
9
15
#endif
10
16
//#define USE_INDICATOR_LED_WHILE_RAMPING
11
 
// enable blinking indicator LED while off?
12
 
#define TICK_DURING_STANDBY
13
17
 
14
 
// If TICK_DURING_STANDBY is enabled...
15
18
// off mode: high (2)
16
19
// lockout: blinking (3)
17
20
#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
21
24
// Fireflies wants to skip aux LED mode 1 (low)
22
25
#define INDICATOR_LED_SKIP_LOW
23
26
 
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
 
27
 
 
28
#define RAMP_SIZE 150
31
29
 
32
30
// driver is a FET + 3x7135, ~400 lm at highest regulated level
33
31
// ramp copied from Emisar D4S ramp
37
35
#define HALFSPEED_LEVEL 13
38
36
#define QUARTERSPEED_LEVEL 6
39
37
 
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
 
 
46
38
// ceiling is level 120/150
 
39
#define RAMP_SMOOTH_FLOOR 1
47
40
#define RAMP_SMOOTH_CEIL 120
48
41
 
49
42
// 10, 28, 46, 65, 83, 101, 120  (83 is highest regulated)
50
43
#define RAMP_DISCRETE_FLOOR 10
51
 
#define RAMP_DISCRETE_CEIL 120
 
44
#define RAMP_DISCRETE_CEIL  120
52
45
#define RAMP_DISCRETE_STEPS 7
53
46
 
 
47
// safe limit ~25% power / ~1000 lm
 
48
// 10 34 59 [83] 108
 
49
#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR
 
50
#define SIMPLE_UI_CEIL 108
 
51
#define SIMPLE_UI_STEPS 5
 
52
 
54
53
// ~25 lm to ~300 lm
55
 
#define MUGGLE_FLOOR 30
56
 
#define MUGGLE_CEILING MAX_1x7135
 
54
//#define SIMPLE_UI_FLOOR 30
 
55
//#define SIMPLE_UI_CEIL  MAX_1x7135
57
56
// ~50 lm to ~500 lm
58
 
//#define MUGGLE_FLOOR 40
59
 
//#define MUGGLE_CEILING 90
 
57
//#define SIMPLE_UI_FLOOR 40
 
58
//#define SIMPLE_UI_CEIL  90
60
59
 
 
60
// thermal regulation parameters
 
61
#ifdef MIN_THERM_STEPDOWN
 
62
#undef MIN_THERM_STEPDOWN  // this should be lower, because 3x7135 instead of 1x7135
 
63
#endif
 
64
#define MIN_THERM_STEPDOWN 60  // lowest value it'll step down to
61
65
// regulate down faster when the FET is active, slower otherwise
62
66
#define THERM_FASTER_LEVEL 135  // throttle back faster when high
63
67
 
 
68
#ifndef BLINK_AT_RAMP_CEIL
 
69
#define BLINK_AT_RAMP_CEIL
 
70
#endif
 
71
 
64
72
// don't do this
65
73
#undef BLINK_AT_RAMP_MIDDLE
66
 
#undef BLINK_AT_RAMP_CEILING
67
 
 
 
74
 
 
75
#define USE_SMOOTH_STEPS
 
76
 
 
77
// too big, turn off extra features
 
78
#undef USE_SOS_MODE
 
79
#undef USE_TACTICAL_MODE