~toykeeper/flashlight-firmware/trunk

« back to all changes in this revision

Viewing changes to Flintrock/bistro-hd/configs/config_dual-switch-noinit-TA-HD.h

  • Committer: Selene Scriven
  • Date: 2014-07-22 23:45:40 UTC
  • Revision ID: ubuntu@toykeeper.net-20140722234540-7jkvx6or9mow8dze
Moved my sources into ToyKeeper/ directory to keep things a little cleaner.
By default, I'll put my personal firmware there to indicate it might not be
as useful for general-purpose use, it's just something I made.
(can move or copy some again later if they end up being interesting to others)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef config_bistro_H
2
 
#define config_bistro_H
3
 
/*
4
 
 *  Firmware configuration header. 
5
 
 *
6
 
 * Bistro configuration file for dual switch TA-based triple driver, (C) Flintrock (FR).
7
 
 * USES voltage divider and OTC.
8
 
 * 
9
 
 * To work with tk-bistro and other compatible software.
10
 
 *
11
 
 * This program is free software: you can redistribute it and/or modify
12
 
 * it under the terms of the GNU General Public License as published by
13
 
 * the Free Software Foundation, either version 3 of the License, or
14
 
 * (at your option) any later version.
15
 
 *
16
 
 * This program is distributed in the hope that it will be useful,
17
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 
 * GNU General Public License for more details.
20
 
 *
21
 
 * You should have received a copy of the GNU General Public License
22
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 
 *
24
 
 */
25
 
 
26
 
 
27
 
/*
28
 
 * =========================================================================
29
 
 * Settings to modify per driver
30
 
 */
31
 
 
32
 
/////////////// Choose a layout////////////////
33
 
 
34
 
//#define FET_7135_LAYOUT  //FET+1
35
 
#define TRIPLEDOWN_LAYOUT  //TA triple
36
 
//#define NANJG105D_LAYOUT      // biscotti/convoy/nanjg105D
37
 
//#define BLFA6_LAYOUT      // BLFA6, FET+1, OTC and star3
38
 
//#define NANJG_LAYOUT  // specify an I/O pin layout
39
 
//#define QUADRUPLEDOWN_LAYOUT                     // Yes, that right :)
40
 
//#define CUSTOM_LAYOUT  // go define it for however you want to wire your driver.
41
 
//**** You can now easily customize layouts in fr-tk-attiny.h :
42
 
 
43
 
// choose the file that defines your modegruops (so we can easily keep more)
44
 
#define MODEGROUPS_H "modegroups/modegroups-TA-triple-v1.3plus.h"
45
 
//#define MODEGROUPS_H "modegroups/modegroups-biscotti.h"
46
 
//#define MODEGROUPS_H "modegroups/modegroups-BLFA6.h"
47
 
 
48
 
/*************************  Misc utility configs*************************************/
49
 
//#define VOLTAGE_CAL  // builds a driver that just blinks ADC reading, set the VOLTAGE mode below.
50
 
//#define STRIPPED // use for debugging, strips many features to make more space for debug compiler options or testing functions.
51
 
                   // customize it below
52
 
//#define OTSM_debug //may require STRIPPED to fit. //Will blink out number of wakes (see SLEEP_TIME_EXPONENT) on short clicks, before entering mode.
53
 
 
54
 
/************************************OFF-TIME CONFIGS**********************************/
55
 
//USE redundancy to make noinit off memory safer (if used at all) redundancy 4 requires 38 bytes.
56
 
// This is only used if OTC and OTSM are not used and you have a clicking switch.
57
 
#define USE_SAFE_PRESSES // enable
58
 
// redundancy 4 requires 38 bytes.
59
 
// redundancy level. Default is 4, but 3 could save some space, 2 has lower than 1 in 255 chance of failure:
60
 
                     // 3 has maybe 1 in 2,800 odds (based observations that 1's twice as probable as 0's)
61
 
                                         // 4 should have 1 in 69,000 odds of failure.
62
 
                                         // Failure rate is most likely per chip, not per click, but could be a little of both.
63
 
#define N_SAFE_BYTES 4
64
 
 
65
 
//#define OFFTIM3      // Use short/med/long off-time presses instead of just short/long
66
 
 
67
 
 
68
 
//#define USE_OTC // use off time cap. 
69
 
 
70
 
// Off-time sleep mode by -FR, thanks to flashy Mike and Mike C for early feasibility test with similar methods.
71
 
//#define USE_OTSM  // USE OTSM.  Pin must be defined in the layout too.
72
 
 
73
 
//#define OTSM_USES_OTC // use OTC cap for extra power on OTSM (sets it output high to charge up)
74
 
#define POWERSAVE // Also works without OTSM to reduce moon-mode drain. 
75
 
             // Squeeze out a bit more off-time by saving power during
76
 
             // shutoff detection (so at all times).  Implements ms resolution (could be less) idle sleeps in place of delay.
77
 
             // Seems to add at 0.5s of sleep at 3.1V 30uF cap, starting with only 0.75 that matters.  
78
 
                         // But at higher voltages, it's still only 0.5s additional, not multiplicative.
79
 
             // Also adds about 12 bytes that could be used for about two more mode groups instead :P
80
 
 
81
 
 
82
 
// Traditionally Cap values defined in tk-calibration
83
 
// But wake times in OTSM are not a calibration, just a configuration, so they go here.
84
 
// Times are in decimal seconds.  short (med) wakes are <, not = to wake_time_short(med)
85
 
#define SLEEP_TIME_EXPONENT 4   // OTSM clicky sleep will be increments of 16ms*2^STE  
86
 
                               // so 0 is 16, 1 is 32, 2 is 64, 3 is 128, 4 is 0.25s, 5 is 0.5s etc.
87
 
// To allow long click times use 4. For 1/8s resolution, use 3.
88
 
#define wake_time_short 0.5   // 0.5s : Short press is up to 0.5 s
89
 
#define wake_time_med   1.5   // this is limited by cap performance, but setting it high won't hurt 
90
 
                              // Since anything beyond the cap capacity will be read as long anyway.
91
 
                                                          // It's also the long-press off-threshold for e-switch operation.
92
 
 
93
 
/*****************************END OTSM CONGIGS*********************************/
94
 
 
95
 
#define USE_ESWITCH  // pin must be defined in the layout too.
96
 
  #define USE_ESWITCH_LOCKOUT_TOGGLE  // enables menu to turn off eswitch, experimental, maybe be removed.
97
 
 
98
 
  #define DUAL_SWITCH_NOINIT // clicking switch on dual switch light uses noinit to measure long/short presses.
99
 
                             //No OTSM or OTC.
100
 
 
101
 
//  #define DUMB_CLICK   //Power switch on dual-switch light doesn't change the mode.
102
 
                       //Better not use it with USE_ESWITCH_LOCKOUT_TOGGLE
103
 
 
104
 
/**********************VOLTAGE CONFIG****************************************/
105
 
 
106
 
#define VOLTAGE_MON         // Comment out to disable LVP
107
 
//You should leave one (but only one) of the next two uncommented.  
108
 
#define READ_VOLTAGE_FROM_VCC  // inverted "internal" Vcc voltage monitoring
109
 
                               // Works well for 1S lights without worrying about resistor values.
110
 
//#define READ_VOLTAGE_FROM_DIVIDER  // classic voltage reading
111
 
//#define REFERENCE_DIVIDER_READS_TO_VCC // default is 1.1V, but this is needed for divider reading with OTSM on the voltage pin.
112
 
                                         // This should normally be used with an LDO.  For 1S (non-LDO or 5.0VLDO) just avoid the problem with READ_VOLTAGE_FROM_VCC.
113
 
 
114
 
/***** Choose a battery indicator style (if enabled in modegroups)*******/
115
 
//#define BATTCHECK_4bars  // up to 4 blinks
116
 
//#define BATTCHECK_8bars  // up to 8 blinks
117
 
#define BATTCHECK_VpT  // Volts + tenths
118
 
 
119
 
/******thermal protection:  ***/
120
 
#define TEMPERATURE_MON          // You can set starting temperature in the "maxtemp" setting in config options first boot options.
121
 
  #define USE_TEMP_CAL    // include a TEMP_CAL mode in the menu.  
122
 
  #define TEMP_STEP_DOWN //Requires TEMPERATURE_MON, Use step-down and tap-up instead of oscillate
123
 
    #define MINIMUM_TURBO_TIME  10 //Turbo will never run less than this long. Requires TEMP_STEP_DOWN
124
 
 
125
 
/*******Mode features***********/
126
 
#define USE_MUGGLE_MODE  // compile in use of muggle mode
127
 
#define USE_REVERSE_MODES  // compile in use of reverse modes
128
 
#define USE_MOON  // compile in moon mode control
129
 
 
130
 
// Options for first bootup/default:
131
 
 
132
 
#define USE_FIRSTBOOT //Enables reset menu option, only costs a couple of bytes.
133
 
 
134
 
#define INIT_MODEGROUP      11       // which mode group will be default, mode groups below start at zero, select the mode group you want and subtract one from the number to get it by defualt here
135
 
#define INIT_ENABLE_MOON    1       // Should we add moon to the set of modes?
136
 
#define INIT_REVERSE_MODES  0       // flip the mode order?
137
 
#define INIT_MEMORY         0       // mode memory, or not
138
 
#define INIT_OFFTIM3        1       // enable medium-press by default?
139
 
#define INIT_MUGGLE_MODE    0       // simple mode designed for mugglesotsm
140
 
#define INIT_LOCKSWITCH     0       // 0 => E-swtich enabled, 1 => locked.
141
 
#define INIT_MAXTEMP       88       // maximum temperature
142
 
 
143
 
#define BLINK_SPEED         750
144
 
 
145
 
 
146
 
 
147
 
 
148
 
#ifdef STRIPPED  // define what you want to remove in stripped mode
149
 
#undef TEMPERATURE_MON
150
 
#undef VOLTAGE_MON
151
 
#define NO_STROBES  // don't use strobes (not automatically stripped from modes though, result can be undefined) 
152
 
#undef USE_BATTCHECK
153
 
#endif
154
 
 
155
 
 
156
 
/**********************************************************************************
157
 
**********************END OF CONFIGURATION*****************************************
158
 
***********************************************************************************/
159
 
 
160
 
 
161
 
#endif
 
 
b'\\ No newline at end of file'