![](/media/cache/profiles/f0fcf351df4eb6786e9bb6fc4e2dee02.jpg.50x50_q85.jpg)
check program for EPSON RX-8025NB and STM M41T62 external RTC library
redirect_stdio/redirect_stdio.h@1:0fd657a82160, 2020-08-07 (annotated)
- Committer:
- kenjiArai
- Date:
- Fri Aug 07 06:23:26 2020 +0000
- Revision:
- 1:0fd657a82160
- Parent:
- 0:564965644ed2
updated library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kenjiArai | 0:564965644ed2 | 1 | /* |
kenjiArai | 0:564965644ed2 | 2 | * mbed Application program |
kenjiArai | 0:564965644ed2 | 3 | * Redirect Standard Input/Output |
kenjiArai | 0:564965644ed2 | 4 | * |
kenjiArai | 0:564965644ed2 | 5 | * Copyright (c) 2020 Kenji Arai / JH1PJL |
kenjiArai | 0:564965644ed2 | 6 | * http://www7b.biglobe.ne.jp/~kenjia/ |
kenjiArai | 0:564965644ed2 | 7 | * https://os.mbed.com/users/kenjiArai/ |
kenjiArai | 0:564965644ed2 | 8 | * Created: August 7th, 2020 |
kenjiArai | 0:564965644ed2 | 9 | * Revised: August 7th, 2020 |
kenjiArai | 0:564965644ed2 | 10 | */ |
kenjiArai | 0:564965644ed2 | 11 | |
kenjiArai | 0:564965644ed2 | 12 | extern BufferedSerial pc; |
kenjiArai | 0:564965644ed2 | 13 | |
kenjiArai | 0:564965644ed2 | 14 | FileHandle *mbed::mbed_override_console(int fd); |
kenjiArai | 0:564965644ed2 | 15 | |
kenjiArai | 0:564965644ed2 | 16 | inline uint8_t readable(void) |
kenjiArai | 0:564965644ed2 | 17 | { |
kenjiArai | 0:564965644ed2 | 18 | return pc.readable(); |
kenjiArai | 0:564965644ed2 | 19 | } |
kenjiArai | 0:564965644ed2 | 20 | |
kenjiArai | 0:564965644ed2 | 21 | inline void putc(uint8_t c) |
kenjiArai | 0:564965644ed2 | 22 | { |
kenjiArai | 0:564965644ed2 | 23 | char dt = c; |
kenjiArai | 0:564965644ed2 | 24 | pc.write(&dt, 1); |
kenjiArai | 0:564965644ed2 | 25 | } |
kenjiArai | 0:564965644ed2 | 26 | |
kenjiArai | 0:564965644ed2 | 27 | inline uint8_t getc(void) |
kenjiArai | 0:564965644ed2 | 28 | { |
kenjiArai | 0:564965644ed2 | 29 | int c = getchar(); |
kenjiArai | 0:564965644ed2 | 30 | return (uint8_t)c; |
kenjiArai | 0:564965644ed2 | 31 | } |
kenjiArai | 0:564965644ed2 | 32 | |
kenjiArai | 0:564965644ed2 | 33 | inline void puts_wo_cr(char *bf, uint32_t len) |
kenjiArai | 0:564965644ed2 | 34 | { |
kenjiArai | 0:564965644ed2 | 35 | pc.write(bf, len); |
kenjiArai | 0:564965644ed2 | 36 | } |