nr_micro_shell_config.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /**
  2. * @file nr_micro_shell_config.h
  3. * @author Ji Youzhou
  4. * @version V0.1
  5. * @date 28 Oct 2019
  6. * @brief [brief]
  7. * *****************************************************************************
  8. * @attention
  9. *
  10. * MIT License
  11. *
  12. * Copyright (C) 2019 Ji Youzhou. or its affiliates. All Rights Reserved.
  13. *
  14. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15. * of this software and associated documentation files (the "Software"), to deal
  16. * in the Software without restriction, including without limitation the rights
  17. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18. * copies of the Software, and to permit persons to whom the Software is
  19. * furnished to do so, subject to the following conditions:
  20. *
  21. * The above copyright notice and this permission notice shall be included in all
  22. * copies or substantial portions of the Software.
  23. *
  24. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  27. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  29. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. /* Define to prevent recursive inclusion -------------------------------------*/
  33. #ifndef __nr_micro_shell_config_h
  34. #define __nr_micro_shell_config_h
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. #define NR_MICRO_SHELL_SIMULATOR
  40. /* Includes ------------------------------------------------------------------*/
  41. #ifndef NR_MICRO_SHELL_SIMULATOR
  42. #include <rtconfig.h>
  43. #include <rtthread.h>
  44. #endif
  45. #ifdef PKG_USING_NR_MICRO_SHELL
  46. /* use nr_micro_shell in rt_thread. */
  47. #define USING_RT_THREAD
  48. /* ANSI command line buffer size. */
  49. #define NR_ANSI_LINE_SIZE RT_NR_SHELL_LINE_SIZE
  50. /* Maximum user name length. */
  51. #define NR_SHELL_USER_NAME_MAX_LENGTH RT_NR_SHELL_USER_NAME_MAX_LENGTH
  52. /* Maximum command name length. */
  53. #define NR_SHELL_CMD_NAME_MAX_LENGTH RT_NR_SHELL_CMD_NAME_MAX_LENGTH
  54. /* Command line buffer size. */
  55. #define NR_SHELL_CMD_LINE_MAX_LENGTH NR_ANSI_LINE_SIZE
  56. /* The maximum number of parameters in the command. */
  57. #define NR_SHELL_CMD_PARAS_MAX_NUM RT_NR_SHELL_CMD_PARAS_MAX_NUM
  58. /* Command stores the most history commands (the maximum number here refers to the maximum number of commands that can be stored. When the history command line cache is full, it will automatically release the earliest command record) */
  59. #define NR_SHELL_MAX_CMD_HISTORY_NUM RT_NR_SHELL_MAX_CMD_HISTORY_NUM
  60. /* History command cache length */
  61. #define NR_SHELL_CMD_HISTORY_BUF_LENGTH RT_NR_SHELL_CMD_HISTORY_BUF_LENGTH
  62. #define NR_SHELL_USER_NAME RT_NR_SHELL_USER_NAME
  63. /*
  64. The end of line.
  65. 0: \n
  66. 1: \r
  67. 2: \r\n
  68. */
  69. #define NR_SHELL_END_OF_LINE RT_NR_SHELL_END_OF_LINE
  70. /* Weather the terminal support all ANSI codes. */
  71. #define NR_SHLL_FULL_ANSI 1
  72. /* Show logo or not. */
  73. #ifdef RT_NR_SHELL_SHOW_LOG
  74. #define NR_SHELL_SHOW_LOG
  75. #endif
  76. /* Use NR_SHELL_CMD_EXPORT() or not */
  77. #define NR_SHELL_USING_EXPORT_CMD
  78. /* If you use RTOS, you may need to do some special processing for printf(). */
  79. #define shell_printf(fmt, args...) rt_kprintf(fmt, ##args)
  80. #define ansi_show_char(x) rt_kprintf("%c", x)
  81. #endif
  82. #ifndef PKG_USING_NR_MICRO_SHELL
  83. /* ANSI command line buffer size. */
  84. #define NR_ANSI_LINE_SIZE 100
  85. /* Maximum user name length. */
  86. #define NR_SHELL_USER_NAME_MAX_LENGTH 30
  87. /* Maximum command name length. */
  88. #define NR_SHELL_CMD_NAME_MAX_LENGTH 10
  89. /* Command line buffer size. */
  90. #define NR_SHELL_CMD_LINE_MAX_LENGTH NR_ANSI_LINE_SIZE
  91. /* The maximum number of parameters in the command. */
  92. #define NR_SHELL_CMD_PARAS_MAX_NUM 10
  93. /* Command stores the most history commands (the maximum number here refers to the maximum number of commands that can be stored. When the history command line cache is full, it will automatically release the earliest command record) */
  94. #define NR_SHELL_MAX_CMD_HISTORY_NUM 3
  95. /* History command cache length */
  96. #define NR_SHELL_CMD_HISTORY_BUF_LENGTH 253
  97. /* The user's name. */
  98. #define NR_SHELL_USER_NAME "luatos@root:"
  99. /*
  100. 0: \n
  101. 1: \r
  102. 2: \r\n
  103. */
  104. #define NR_SHELL_END_OF_LINE 0
  105. /* Weather the terminal support all ANSI codes. */
  106. #define NR_SHLL_FULL_ANSI 1
  107. /* Show logo or not. */
  108. // #define NR_SHELL_SHOW_LOG
  109. // /* Use NR_SHELL_CMD_EXPORT() or not */
  110. // #define NR_SHELL_USING_EXPORT_CMD
  111. /* If you use RTOS, you may need to do some special processing for printf(). */
  112. #define shell_printf(fmt, args...) printf(fmt, ##args);
  113. #define ansi_show_char(x) putchar(x)
  114. #endif
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118. #endif
  119. /******************* (C) COPYRIGHT 2019 Ji Youzhou *****END OF FILE*****************/