Skip to content

Commit

Permalink
Merge pull request #609 from MayLaOwn/fix/ir-read.cpp
Browse files Browse the repository at this point in the history
fix ir_read.cpp
  • Loading branch information
bmorcelli authored Dec 25, 2024
2 parents e92a3ab + 26192f9 commit ffa4c1f
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions src/modules/ir/ir_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,18 @@ void IrRead::read_signal() {

_read_signal = true;

// switch to raw mode if decoding failed
if(results.decode_type == decode_type_t::UNKNOWN ) {
Serial.println("signal decoding failed, switching to RAW mode");
//displayWarning("signal decoding failed, switching to RAW mode", true);
raw = true;
// TODO: show a dialog
// raw = yesNoDialog("decoding failed, save as RAW?");
}
// Always switches to RAW data, regardless of the decoding result
raw = true;

display_banner();

// dump signal details
if(raw) {
padprint("HEX: RAW data");
} else {
padprint("HEX: 0x");
tft.println(results.value, HEX);
}
display_btn_options();
// Dump of signal details
padprint("RAW Data Captured:");
String raw_signal = parse_raw_signal();
tft.println(raw_signal); // Shows the RAW signal on the display
Serial.println(raw_signal); // Print RAW signal to serial monitor

display_btn_options();
delay(500);
}

Expand Down Expand Up @@ -186,7 +178,7 @@ String IrRead::parse_state_signal() {
}

String IrRead::parse_raw_signal() {
// https://github.com/crankyoldgit/IRremoteESP8266/blob/master/examples/SmartIRRepeater/SmartIRRepeater.ino

rawcode = resultToRawArray(&results);
raw_data_len = getCorrectedRawLength(&results);

Expand Down

0 comments on commit ffa4c1f

Please sign in to comment.