Unify TRIGGER logic on TVBG flow
This commit is contained in:
parent
dad8dac03e
commit
317e2f8656
|
@ -456,10 +456,9 @@ void tvbgone_setup() {
|
||||||
|
|
||||||
void tvbgone_loop()
|
void tvbgone_loop()
|
||||||
{
|
{
|
||||||
if (digitalRead(TRIGGER) == BUTTON_PRESSED)
|
if (digitalRead(M5_BUTTON_HOME) == LOW) {
|
||||||
{
|
|
||||||
delay_ten_us(40000);
|
delay_ten_us(40000);
|
||||||
while (digitalRead(TRIGGER) == BUTTON_PRESSED) {
|
while (digitalRead(M5_BUTTON_HOME) == LOW) {
|
||||||
delay_ten_us(500);
|
delay_ten_us(500);
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
|
@ -577,9 +576,9 @@ void sendAllCodes()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// TODO Replace TRIGGER with better button defs
|
|
||||||
if (digitalRead(TRIGGER) == BUTTON_PRESSED){
|
if (digitalRead(M5_BUTTON_HOME) == LOW){
|
||||||
while (digitalRead(TRIGGER) == BUTTON_PRESSED) {
|
while (digitalRead(M5_BUTTON_HOME) == LOW) {
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
endingEarly = true;
|
endingEarly = true;
|
||||||
|
|
4
tvbg.h
4
tvbg.h
|
@ -14,8 +14,6 @@ By Anton Grimpelhuber (anton.grimpelhuber@gmail.com)
|
||||||
// What pins do what
|
// What pins do what
|
||||||
#define LED 10 //LED indicator pin (built-in LED)
|
#define LED 10 //LED indicator pin (built-in LED)
|
||||||
#define IRLED 9 //the IR sender LED / D5 on wemos D1 mini
|
#define IRLED 9 //the IR sender LED / D5 on wemos D1 mini
|
||||||
#define TRIGGER 37 //the button pin / D6 on wemos D1 mini
|
|
||||||
#define REGIONSWITCH 39 //HIGH (1) = NA, LOW (0) = EU; Pin 5 / D1 (REGIONSWITCH) is HIGH (via in input pullup resistor) for North America, or you (the user) must wire it to ground to set the codes for Europe.
|
|
||||||
|
|
||||||
// Lets us calculate the size of the NA/EU databases
|
// Lets us calculate the size of the NA/EU databases
|
||||||
#define NUM_ELEM(x) (sizeof (x) / sizeof (*(x)));
|
#define NUM_ELEM(x) (sizeof (x) / sizeof (*(x)));
|
||||||
|
@ -77,8 +75,6 @@ uint8_t read_bits(uint8_t count)
|
||||||
}
|
}
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
#define BUTTON_PRESSED LOW
|
|
||||||
#define BUTTON_RELEASED HIGH
|
|
||||||
uint16_t ontime, offtime;
|
uint16_t ontime, offtime;
|
||||||
uint8_t i, num_codes;
|
uint8_t i, num_codes;
|
||||||
uint8_t region;
|
uint8_t region;
|
||||||
|
|
Loading…
Reference in New Issue