osoutput.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
  2. Copyright (c) 2014-2017 Datalight, Inc.
  3. All Rights Reserved Worldwide.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; use version 2 of the License.
  7. This program is distributed in the hope that it will be useful,
  8. but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
  9. of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with this program; if not, write to the Free Software Foundation, Inc.,
  13. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  14. */
  15. /* Businesses and individuals that for commercial or other reasons cannot
  16. comply with the terms of the GPLv2 license may obtain a commercial license
  17. before incorporating Reliance Edge into proprietary software for
  18. distribution in any form. Visit http://www.datalight.com/reliance-edge for
  19. more information.
  20. */
  21. /** @file
  22. @brief Implements outputting a character string.
  23. */
  24. #include "hal.h"
  25. #if (HAL_USE_SDMMC == TRUE)
  26. #include "sama_sdmmc_lld.h"
  27. #if SDMMC_USE_RELEDGE_LIB == 1
  28. #include <redfs.h>
  29. #if REDCONF_OUTPUT == 1
  30. #include <redosdeviations.h>
  31. /** @brief Write a string to a user-visible output location.
  32. Write a null-terminated string to the serial port, console, terminal, or
  33. other display device, such that the text is visible to the user.
  34. @param pszString A null-terminated string.
  35. */
  36. void RedOsOutputString(
  37. const char *pszString)
  38. {
  39. if(pszString == NULL)
  40. {
  41. REDERROR();
  42. }
  43. else
  44. {
  45. uint32_t ulIdx = 0U;
  46. while(pszString[ulIdx] != '\0')
  47. {
  48. OUTPUT_CHARACTER(pszString[ulIdx]);
  49. /* Serial output often requires a \r to print newlines correctly.
  50. */
  51. if(pszString[ulIdx] == '\n')
  52. {
  53. OUTPUT_CHARACTER('\r');
  54. }
  55. ulIdx++;
  56. }
  57. }
  58. }
  59. #endif
  60. #endif
  61. #endif