📄 hello.c
字号:
/*
File: Hello.c
To prompt the user for name and respond.
*/
#include <intrinsics.h>
#include <stdio.h>
#include "lpc2294.h"
#include "serial.h"
char name[20];
int main (void)
{
// System initialization, this will map the exception vectors.
LPC2294SystemInit();
//Set up UART
LPC2294InitUART0();
// First disable interrupts.
__disable_interrupt();
// Setup interrupt controller.
LPC2294InitVIC();
LPC2294InitUART0Interrupt(byteReceived, txBufEmpty);
// Enable interrupts.
__enable_interrupt();
// Loop forever.
for(;;)
{
printf("Hello, May I have your name\?\n\r>");
scanline((char*)&name);
printf("\nHello %s. Welcome to IAR Systems.\n\n\n\r", name);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -