EM_platform.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * \file EM_platform.c
  3. *
  4. *
  5. */
  6. /*
  7. * Copyright (C) 2013. Mindtree Limited.
  8. * All rights reserved.
  9. */
  10. /* --------------------------------------------- Header File Inclusion */
  11. #include "EM_platform.h"
  12. #include "uart.h"
  13. #pragma import(__use_no_semihosting_swi)
  14. /* --------------------------------------------- Global Definitions */
  15. /* --------------------------------------------- Static Global Variables */
  16. struct __FILE { int handle; /* whatever required */ };
  17. FILE __stdout;
  18. FILE __stdin;
  19. /* --------------------------------------------- External Global Variables */
  20. /* --------------------------------------------- Exported Global Variables */
  21. /* --------------------------------------------- Function */
  22. void EM_enter_sleep_pl(void)
  23. {
  24. }
  25. void EM_exit_sleep_pl(void)
  26. {
  27. }
  28. int fputc(int c, FILE *f) {
  29. return hal_uart_send_buff((uint8_t *)&c, 1);
  30. }
  31. int fgetc(FILE *f) {
  32. return 0;
  33. }
  34. int ferror(FILE *f) {
  35. /* Your implementation of ferror */
  36. return EOF;
  37. }
  38. void _ttywrch(int c) {
  39. hal_uart_send_buff((uint8_t *)&c, 1);
  40. }
  41. void _sys_exit(int return_code) {
  42. label: goto label; /* endless loop */
  43. }