Skip to content

Commit

Permalink
Merge pull request #36 from bmorcelli/main
Browse files Browse the repository at this point in the history
Fix TvBgone
  • Loading branch information
pr3y authored Jun 6, 2024
2 parents f5bfe8c + 20b77fb commit ab453a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/TV-B-Gone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ By Anton Grimpelhuber ([email protected])
#define DEBUGP(x) if (DEBUG == 1) { x ; }

// Shortcut to insert single, non-optimized-out nop
#define NOP __asm__ __volatile__ ("nop")
#define NOPP __asm__ __volatile__ ("nop")

// Not used any more on esp8266, so don't bother
// Tweak this if neccessary to change timing
Expand Down Expand Up @@ -81,10 +81,10 @@ void delay_ten_us(uint16_t us) {
uint8_t timer;
while (us != 0) {
for (timer = 0; timer <= DELAY_CNT; timer++) {
NOP;
NOP;
NOPP;
NOPP;
}
NOP;
NOPP;
us--;
}
}
Expand Down Expand Up @@ -143,8 +143,8 @@ void StartTvBGone() {
offtime = powerCode->times[ti]; // read word 1 - ontime
ontime = powerCode->times[ti + 1]; // read word 2 - offtime

rawData[k*2] = ontime * 10;
rawData[(k*2)+1] = offtime * 10;
rawData[k*2] = offtime * 10;
rawData[(k*2)+1] = ontime * 10;
}
progressHandler(i, num_codes);
irsend.sendRaw(rawData, (numpairs*2) , freq);
Expand Down
4 changes: 3 additions & 1 deletion src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ int gsetIrTxPin(bool set){
if(set) {
options = {
{"Default", [&]() { result = LED; }},
{"M5 IR Mod", [&]() { result = GROVE_SDA; }},
#ifndef CARDPUTER
{"G26", [&]() { result=26; }},
{"G25", [&]() { result=25; }},
Expand Down Expand Up @@ -332,6 +333,7 @@ int gsetIrRxPin(bool set){
if(result>36) result = GROVE_SCL;
if(set) {
options = {
{"M5 IR Mod", [&]() { result = GROVE_SCL; }},
#ifndef CARDPUTER
{"G26", [&]() { result=26; }},
{"G25", [&]() { result=25; }},
Expand Down Expand Up @@ -408,4 +410,4 @@ int gsetRfRxPin(bool set){
returnToMenu=true;
RfRx = result;
return result;
}
}

0 comments on commit ab453a7

Please sign in to comment.