Fix compatibility issue with IR remoter
This commit is contained in:
parent
f55872e09f
commit
9e625c84f1
@ -21,6 +21,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "yc059.h"
|
#include "yc059.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
inline
|
||||||
|
void yc059_ir_enable(void)
|
||||||
|
{
|
||||||
|
YC059_IR_DDR |= (1<<YC059_IR_BIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
void yc059_ir_disable(void)
|
||||||
|
{
|
||||||
|
YC059_IR_DDR &= ~(1<<YC059_IR_BIT);
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
void yc059_ir_high(void)
|
void yc059_ir_high(void)
|
||||||
{
|
{
|
||||||
@ -35,18 +47,20 @@ void yc059_ir_low(void)
|
|||||||
|
|
||||||
void yc059_init(void)
|
void yc059_init(void)
|
||||||
{
|
{
|
||||||
YC059_IR_DDR |= (1<<YC059_IR_BIT);
|
YC059_IR_DDR &= ~(1<<YC059_IR_BIT);
|
||||||
YC059_IR_PORT &= ~(1<<YC059_IR_BIT);
|
YC059_IR_PORT &= ~(1<<YC059_IR_BIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void yc059_send(uint8_t data)
|
void yc059_send(uint8_t data)
|
||||||
{
|
{
|
||||||
cli();
|
cli();
|
||||||
|
yc059_ir_enable();
|
||||||
yc059_send_header();
|
yc059_send_header();
|
||||||
yc059_send_address();
|
yc059_send_address();
|
||||||
yc059_send_byte(data);
|
yc059_send_byte(data);
|
||||||
yc059_send_byte(~data);
|
yc059_send_byte(~data);
|
||||||
yc059_send_stop();
|
yc059_send_stop();
|
||||||
|
yc059_ir_disable();
|
||||||
sei();
|
sei();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user