mirror of
https://github.com/wled/WLED.git
synced 2025-07-26 20:26:34 +00:00
Switch rewrite.
This commit is contained in:
parent
0cdab52418
commit
70cf6546ca
@ -38,7 +38,6 @@ bool isButtonPressed(uint8_t i)
|
|||||||
if (digitalRead(btnPin[i]) == LOW) return true;
|
if (digitalRead(btnPin[i]) == LOW) return true;
|
||||||
break;
|
break;
|
||||||
case BTN_TYPE_PUSH_ACT_HIGH:
|
case BTN_TYPE_PUSH_ACT_HIGH:
|
||||||
case BTN_TYPE_SWITCH_ACT_HIGH:
|
|
||||||
case BTN_TYPE_PIR_SENSOR:
|
case BTN_TYPE_PIR_SENSOR:
|
||||||
if (digitalRead(btnPin[i]) == HIGH) return true;
|
if (digitalRead(btnPin[i]) == HIGH) return true;
|
||||||
break;
|
break;
|
||||||
@ -182,7 +181,7 @@ void handleButton()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//button is not momentary, but switch. This is only suitable on pins whose on-boot state does not matter (NOT gpio0)
|
//button is not momentary, but switch. This is only suitable on pins whose on-boot state does not matter (NOT gpio0)
|
||||||
if (buttonType[b] == BTN_TYPE_SWITCH || buttonType[b] == BTN_TYPE_SWITCH_ACT_HIGH || buttonType[b] == BTN_TYPE_PIR_SENSOR) {
|
if (buttonType[b] == BTN_TYPE_SWITCH || buttonType[b] == BTN_TYPE_PIR_SENSOR) {
|
||||||
handleSwitch(b); continue;
|
handleSwitch(b); continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,11 +158,10 @@
|
|||||||
#define BTN_TYPE_PUSH 2
|
#define BTN_TYPE_PUSH 2
|
||||||
#define BTN_TYPE_PUSH_ACT_HIGH 3
|
#define BTN_TYPE_PUSH_ACT_HIGH 3
|
||||||
#define BTN_TYPE_SWITCH 4
|
#define BTN_TYPE_SWITCH 4
|
||||||
#define BTN_TYPE_SWITCH_ACT_HIGH 5
|
#define BTN_TYPE_PIR_SENSOR 5
|
||||||
#define BTN_TYPE_TOUCH 6
|
#define BTN_TYPE_TOUCH 6
|
||||||
#define BTN_TYPE_ANALOG 7
|
#define BTN_TYPE_ANALOG 7
|
||||||
#define BTN_TYPE_ANALOG_INVERTED 8
|
#define BTN_TYPE_ANALOG_INVERTED 8
|
||||||
#define BTN_TYPE_PIR_SENSOR 9
|
|
||||||
|
|
||||||
//Ethernet board types
|
//Ethernet board types
|
||||||
#define WLED_NUM_ETH_TYPES 5
|
#define WLED_NUM_ETH_TYPES 5
|
||||||
|
@ -304,12 +304,11 @@ Reverse (rotated 180°): <input type="checkbox" name="CV${i}">
|
|||||||
c += `<option value="0" ${t==0?"selected":""}>Disabled</option>`;
|
c += `<option value="0" ${t==0?"selected":""}>Disabled</option>`;
|
||||||
c += `<option value="2" ${t==2?"selected":""}>Pushbutton</option>`;
|
c += `<option value="2" ${t==2?"selected":""}>Pushbutton</option>`;
|
||||||
c += `<option value="3" ${t==3?"selected":""}>Push inverted</option>`;
|
c += `<option value="3" ${t==3?"selected":""}>Push inverted</option>`;
|
||||||
c += `<option value="4" ${t==4?"selected":""}>Switch (low)</option>`;
|
c += `<option value="4" ${t==4?"selected":""}>Switch</option>`;
|
||||||
c += `<option value="5" ${t==5?"selected":""}>Switch (high)</option>`;
|
c += `<option value="5" ${t==5?"selected":""}>PIR sensor</option>`;
|
||||||
c += `<option value="6" ${t==6?"selected":""}>Touch</option>`;
|
c += `<option value="6" ${t==6?"selected":""}>Touch</option>`;
|
||||||
c += `<option value="7" ${t==7?"selected":""}>Analog</option>`;
|
c += `<option value="7" ${t==7?"selected":""}>Analog</option>`;
|
||||||
c += `<option value="8" ${t==8?"selected":""}>Analog inverted</option>`;
|
c += `<option value="8" ${t==8?"selected":""}>Analog inverted</option>`;
|
||||||
c += `<option value="9" ${t==9?"selected":""}>PIR sensor</option>`;
|
|
||||||
c += `</select>`;
|
c += `</select>`;
|
||||||
c += `<span style="cursor: pointer;" onclick="off('${bt}')"> ×</span><br>`;
|
c += `<span style="cursor: pointer;" onclick="off('${bt}')"> ×</span><br>`;
|
||||||
gId("btns").innerHTML = c;
|
gId("btns").innerHTML = c;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2106024
|
#define VERSION 2106031
|
||||||
|
|
||||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||||
//#define WLED_USE_MY_CONFIG
|
//#define WLED_USE_MY_CONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user