~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/ramp-mode.h

  • Committer: Gabriel Hart
  • Date: 2021-09-19 15:15:57 UTC
  • mfrom: (579.1.44 anduril2)
  • Revision ID: gabe@ghart.com-20210919151557-bb9jlz1r807rre79
Merge TK changes thru rev 623 (2021-09-17)

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
#ifndef RAMP_STYLE
76
76
#define RAMP_STYLE 0  // smooth default
77
77
#endif
 
78
#ifndef DEFAULT_RAMP_SPEED
 
79
#define DEFAULT_RAMP_SPEED 1  // WDT ticks per "frame", must be 1 or more
 
80
#endif
78
81
#ifndef RAMP_SMOOTH_FLOOR
79
82
  #define RAMP_SMOOTH_FLOOR 1
80
83
#endif
124
127
#endif
125
128
#endif
126
129
 
127
 
#if defined(USE_MANUAL_MEMORY) && defined(USE_MANUAL_MEMORY_TIMER)
128
 
uint8_t manual_memory_timer_config_state(Event event, uint16_t arg);
 
130
#if defined(USE_MANUAL_MEMORY_TIMER) || defined(USE_RAMP_AFTER_MOON_CONFIG) || defined(USE_2C_STYLE_CONFIG) || defined(USE_AUTO_SUNSET)
 
131
#define USE_RAMP_EXTRAS_CONFIG
 
132
#endif
 
133
#ifdef USE_RAMP_EXTRAS_CONFIG
 
134
uint8_t ramp_extras_config_state(Event event, uint16_t arg);
129
135
#endif
130
136
 
131
137
// calculate the nearest ramp level which would be valid at the moment
160
166
#endif
161
167
#endif
162
168
#ifdef USE_SIMPLE_UI
163
 
// whether to enable the simplified interface or not
164
 
uint8_t simple_ui_active = SIMPLE_UI_ACTIVE;
 
169
    // whether to enable the simplified interface or not
 
170
    uint8_t simple_ui_active = SIMPLE_UI_ACTIVE;
 
171
    #ifdef USE_2C_STYLE_CONFIG
 
172
        #ifndef DEFAULT_2C_STYLE_SIMPLE
 
173
        #define DEFAULT_2C_STYLE_SIMPLE 0
 
174
        #endif
 
175
        uint8_t ramp_2c_style_simple = DEFAULT_2C_STYLE_SIMPLE;  // 0 = no turbo, 1 = A1 style, 2 = A2 style
 
176
    #endif
165
177
#endif
166
178
// smooth vs discrete ramping
167
179
uint8_t ramp_style = RAMP_STYLE;  // 0 = smooth, 1 = discrete
 
180
#ifdef USE_2C_STYLE_CONFIG
 
181
#ifndef DEFAULT_2C_STYLE
 
182
#define DEFAULT_2C_STYLE 2
 
183
#endif
 
184
uint8_t ramp_2c_style = DEFAULT_2C_STYLE;  // 1 = A1 style, 2 = A2 style
 
185
#ifdef USE_2C_MAX_TURBO
 
186
#error Cannot use USE_2C_MAX_TURBO and USE_2C_STYLE_CONFIG at the same time.
 
187
#endif
 
188
#endif
 
189
 
 
190
#ifdef USE_RAMP_SPEED_CONFIG
 
191
#define ramp_speed (ramp_stepss[0])
 
192
#endif
 
193
#ifdef USE_RAMP_AFTER_MOON_CONFIG
 
194
#ifndef DEFAULT_DONT_RAMP_AFTER_MOON
 
195
#define DEFAULT_DONT_RAMP_AFTER_MOON 0
 
196
#endif
 
197
uint8_t dont_ramp_after_moon = DEFAULT_DONT_RAMP_AFTER_MOON;
 
198
#endif
168
199
// current values, regardless of style
169
200
uint8_t ramp_floor = RAMP_SMOOTH_FLOOR;
170
201
uint8_t ramp_ceil = RAMP_SMOOTH_CEIL;
184
215
    #endif
185
216
    };
186
217
uint8_t ramp_stepss[] = {
187
 
    0,
 
218
    DEFAULT_RAMP_SPEED,
188
219
    RAMP_DISCRETE_STEPS,
189
220
    #ifdef USE_SIMPLE_UI
190
221
    SIMPLE_UI_STEPS,