📄 irxmit.c
字号:
//****************************************************************************
//
// IRXMIT.C - Transmits characters via the IR port.
//
// Copyright (c) 1998-2001 Cirrus Logic, Inc.
//
//****************************************************************************
#include "lib7312.h"
#include <stdio.h>
//****************************************************************************
//
// This program and transmit a string of characters via the IR port. When
// a '-' character is read, it is transmitted and then the program exits.
//
//****************************************************************************
void
entry(void)
{
char cBuf[256] = "This is a test of IRDA transmit. - hope it works";
int iIdx;
//
// Enable the IR port at 9600 baud.
//
IREnable(9600);
//
// Repeat forever (the exit condition is within the loop).
//
while(1)
{
//
// Loop through each character of the buffer.
//
for(iIdx = 0; cBuf[iIdx]; iIdx++)
{
//
// Send this character via the IR port.
//
IRSendChar(cBuf[iIdx]);
//
// If this character is a '-', then stop transmitting characters.
//
if(cBuf[iIdx] == '-')
{
break;
}
}
//
// If the last character we transmitted was a '-', then break out of
// the while loop.
//
if(cBuf[iIdx] == '-')
{
break;
}
}
//
// Disable the IR port.
//
IRDisable();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -