Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | /*---------------------------------------------------------------------------- |
2 | * Name: Retarget.c |
||
3 | * Purpose: 'Retarget' layer for target-dependent low level functions |
||
4 | * Note(s): |
||
5 | *---------------------------------------------------------------------------- |
||
6 | * This file is part of the uVision/ARM development tools. |
||
7 | * This software may only be used under the terms of a valid, current, |
||
8 | * end user licence from KEIL for a compatible version of KEIL software |
||
9 | * development tools. Nothing else gives you the right to use this software. |
||
10 | * |
||
11 | * This software is supplied "AS IS" without warranties of any kind. |
||
12 | * |
||
13 | * Copyright (c) 2011 Keil - An ARM Company. All rights reserved. |
||
14 | *----------------------------------------------------------------------------*/ |
||
15 | |||
16 | #include <stdio.h> |
||
17 | #include <rt_misc.h> |
||
18 | #include "Serial.h" |
||
19 | |||
20 | #pragma import(__use_no_semihosting_swi) |
||
21 | |||
22 | |||
23 | |||
24 | struct __FILE { int handle; /* Add whatever you need here */ }; |
||
25 | FILE __stdout; |
||
26 | FILE __stdin; |
||
27 | |||
28 | |||
29 | int fputc(int c, FILE *f) { |
||
30 | return (SER_PutChar(c)); |
||
31 | } |
||
32 | |||
33 | |||
34 | int fgetc(FILE *f) { |
||
35 | return (SER_GetChar()); |
||
36 | } |
||
37 | |||
38 | |||
39 | int ferror(FILE *f) { |
||
40 | /* Your implementation of ferror */ |
||
41 | return EOF; |
||
42 | } |
||
43 | |||
44 | |||
45 | void _ttywrch(int c) { |
||
46 | SER_PutChar(c); |
||
47 | } |
||
48 | |||
49 | |||
50 | void _sys_exit(int return_code) { |
||
51 | label: goto label; /* endless loop */ |
||
52 | } |