This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIRbaby.diff
83 lines (79 loc) · 2.56 KB
/
IRbaby.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff --git a/platformio.ini b/platformio.ini
index a038506..347072f 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -1,13 +1,4 @@
-# 871 KB sketch, 4 KB eeprom, 128 KB fs, 16 KB reserved, no space for ota
[common]
-board_1m = esp01
-ldscript_1m = eagle.flash.1m192.ld
-
-# 1019 KB sketch, 4 KB eeprom, 256 KB fs, 16 KB reserved, 772 KB empty/ota
-board_2m = esp_wroom_02
-ldscript_2m = eagle.flash.2m256.ld
-
-# 1019 KB sketch, 4 KB eeprom, 1000 KB fs, 16 KB reserved, 2052 KB empty/ota
board_4m = esp12e
ldscript_4m = eagle.flash.4m1m.ld
@@ -30,11 +21,3 @@ lib_deps=
[env:esp8266-4m-base]
board = ${common.board_4m}
board_build.ldscript = ${common.ldscript_4m}
-
-[env:esp8266-2m-base]
-board = ${common.board_2m}
-board_build.ldscript = ${common.ldscript_2m}
-
-[env:esp8266-1m-base]
-board = ${common.board_1m}
-board_build.ldscript = ${common.ldscript_1m}
\ No newline at end of file
diff --git a/src/IRbabyIR.cpp b/src/IRbabyIR.cpp
index c57789b..35e376e 100644
--- a/src/IRbabyIR.cpp
+++ b/src/IRbabyIR.cpp
@@ -61,7 +61,10 @@ bool sendIR(String file_name)
INFOLN();
cache.readBytes((char *)data_buffer, cache.size());
ir_recv->disableIRIn();
+ pinMode(14, OUTPUT);
+ digitalWrite(14, LOW);
ir_send->sendRaw(data_buffer, length, 38);
+ pinMode(14, INPUT);
ir_recv->enableIRIn();
free(data_buffer);
cache.close();
@@ -95,7 +98,10 @@ void sendStatus(String file, t_remote_ac_status status)
DEBUGF("data_length = %d\n", data_length);
ir_recv->disableIRIn();
+ pinMode(14, OUTPUT);
+ digitalWrite(14, LOW);
ir_send->sendRaw(user_data, data_length, 38);
+ pinMode(14, INPUT);
ir_recv->enableIRIn();
ir_close();
free(user_data);
@@ -192,7 +198,10 @@ bool sendKey(String file_name, int key)
Serial.println();
}
ir_recv->disableIRIn();
+ pinMode(14, OUTPUT);
+ digitalWrite(14, LOW);
ir_send->sendRaw(user_data, data_length, 38);
+ pinMode(14,INPUT);
ir_recv->enableIRIn();
ir_close();
free(user_data);
diff --git a/src/defines.h b/src/defines.h
index abc5c70..651b80e 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -62,8 +62,8 @@ typedef unsigned char uint8_t;
#define R_433 12
/* IR pin */
-#define T_IR 14
-#define R_IR 12
+#define T_IR 13
+#define R_IR 14
/* Sensor Pin*/
#define SENSOR_PIN 0