📄 vsmain.c
字号:
/*****************************************************************************
* IAR visualSTATE Main Loop Source File
*
* The file contains an implementation for a main loop using the visualSTATE
* basic API.
*
* The code uses a simple queue for storing events. The functions for inter-
* facing to the queue are described in the sample code file
* simpleEventHandler.h.
*****************************************************************************/
/* *** include directives *** */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "device.h"
#include "deviceSetup.h"
#include "putchar_232.h"
#include "putchar_485.h"
/* *** variable definitions *** */
/* *** function definitions *** */
void uart_comm(void);
int __low_level_init(void)
{
/* Insert your low-level initializations here */
WDTCTL = WDTPW + WDTHOLD; // Disable the Watchdog
return (1); // Flag to initialize the data segment
/*==================================*/
/* Choose if segment initialization */
/* should be done or not. */
/* Return: 0 to omit seg_init */
/* 1 to run seg_init */
/*==================================*/
}
void main(void)
{
InitDevice();
RS232Init();
RS485Init();
rs232_send_string_232("maoWubin!");
/* Do forever: */
for(;;)
{
//检查缓冲区是否有数据接收到
if(RS232RXBufferCount_232())
{
char tmp;
tmp = RS232GetChar_232();
putchar_232(tmp);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -