~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/cfg-ff-rot66.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 ROT66 (14x7135) config options for Anduril
2
 
#include "hwdef-FF_ROT66.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 "0411"
 
7
#include "hwdef-ff-rot66.h"
3
8
 
4
9
// the button lights up
5
10
#define USE_INDICATOR_LED
6
11
// the button is visible while main LEDs are on
7
12
#define USE_INDICATOR_LED_WHILE_RAMPING
8
 
// enable blinking indicator LED while off?
9
 
//#define TICK_DURING_STANDBY
10
13
 
11
 
// If TICK_DURING_STANDBY is enabled...
12
14
// off mode: high (2)
13
15
// lockout: blinking (3)
14
 
//#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
15
 
 
16
 
// ... or if TICK_DURING_STANDBY is turned off:
17
 
// off mode: high (2)
18
 
// lockout: off (0)
19
 
#define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2)
20
 
 
 
16
#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
 
17
 
 
18
#define RAMP_SIZE 150
21
19
 
22
20
// driver is a FET+N+1,
23
21
// where N=6 for the 219b version,
24
22
// or N=13 for the XP-L HI version (this version)
25
23
// calculated to get transition points at level 65 and 125
26
 
#define RAMP_LENGTH 150
27
24
// first 65 steps copied from FW3A
28
25
#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
29
26
// remaining steps from this command:
30
27
// level_calc.py ninth 3 150 7135 1 1.4 110.1 7135 15 1 1644.16 FET 1 10 4500
31
28
#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,16,17,18,19,20,21,22,23,25,26,27,29,30,32,34,35,37,39,41,43,46,48,50,53,55,58,61,64,67,70,73,77,81,84,88,92,97,101,106,110,115,120,126,131,137,143,149,156,162,169,177,184,192,200,208,217,226,235,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,0
32
29
#define PWM3_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,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,7,13,21,28,35,43,51,60,68,77,87,96,106,117,127,138,150,161,173,186,199,212,226,240,255
33
 
#define MAX_1x7135 65
34
 
#define MAX_Nx7135 125
35
 
#define HALFSPEED_LEVEL 14
36
 
#define QUARTERSPEED_LEVEL 8
 
30
#define MAX_1x7135          65
 
31
#define MAX_Nx7135          125
 
32
#define HALFSPEED_LEVEL     14
 
33
#define QUARTERSPEED_LEVEL  8
 
34
 
 
35
#define RAMP_SMOOTH_FLOOR  1
 
36
#define RAMP_SMOOTH_CEIL   MAX_Nx7135
 
37
// safe limit max regulated power
 
38
// 20 46 72 98 [125]
 
39
#define SIMPLE_UI_FLOOR  RAMP_DISCRETE_FLOOR
 
40
#define SIMPLE_UI_CEIL   MAX_Nx7135
 
41
#define SIMPLE_UI_STEPS  5
37
42
 
38
43
// regulate down faster when the FET is active, slower otherwise
39
44
#define THERM_FASTER_LEVEL 130  // throttle back faster when high
40
45
 
41
46
// don't do this
42
47
#undef BLINK_AT_RAMP_MIDDLE
43
 
#undef BLINK_AT_RAMP_CEILING
 
48
#undef BLINK_AT_RAMP_CEIL
 
49
 
 
50
// enable extra features
 
51
#define USE_SMOOTH_STEPS
 
52
 
 
53
// too big, turn off extra features
 
54
#undef USE_MOMENTARY_MODE
 
55
#undef USE_TACTICAL_MODE
 
56
#undef USE_SOS_MODE
 
57
//#undef USE_RAMP_AFTER_MOON_CONFIG
 
58
//#undef USE_RAMP_SPEED_CONFIG
 
59
//#undef USE_VOLTAGE_CORRECTION
 
60
//#undef USE_2C_STYLE_CONFIG
 
61
//#undef USE_TACTICAL_STROBE_MODE
 
62
//#ifdef USE_LOWPASS_WHILE_ASLEEP
 
63
//#undef USE_LOWPASS_WHILE_ASLEEP
 
64
//#endif
44
65