⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 retarget.c

📁 这个是我将UCOS移植到LPC系列的基本模版,大家可以下载下来参考下,和ZLG的完全不一样,并不是采用软中断实现任务切换,更加稳定.如果有问题可以rayeryanglei@126.com
💻 C
字号:
/******************************************************************************/
/* RETARGET.C: 'Retarget' layer for target-dependent low level functions      */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools.                    */
/* Copyright (c) 2005 Keil Software. All rights reserved.                     */
/* This software may only be used under the terms of a valid, current,        */
/* end user licence from KEIL for a compatible version of KEIL software       */
/* development tools. Nothing else gives you the right to use this software.  */
/******************************************************************************/

#include <stdio.h>
#include <time.h>
#include <rt_misc.h>

#pragma import(__use_no_semihosting_swi)

/*
extern int  sendchar(int ch);  // in Serial.c 
extern int  getkey(void);      // in Serial.c 
extern long timeval;           // in Time.c   


struct __FILE { int handle; };// Add whatever you need here 
FILE __stdout;
FILE __stdin;


int fputc(int ch, FILE *f) {
  return (sendchar(ch));
}

int fgetc(FILE *f) {
  return (sendchar(getkey()));
}


int ferror(FILE *f) {
  // Your implementation of ferror 
  return EOF;
}


void _ttywrch(int ch) {
  sendchar (ch);
}
*/
void _sys_exit(int return_code) {  //从库函数退出时调用
  while (1);    // endless loop 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -