Browse Source

Merge pull request #357 from grissiom/enhance-finsh

finsh: allow user to disable the FINSH_USING_HISTORY
Bernard Xiong 10 years ago
parent
commit
e5a1a9f553
1 changed files with 11 additions and 1 deletions
  1. 11 1
      components/finsh/shell.h

+ 11 - 1
components/finsh/shell.h

@@ -33,7 +33,17 @@
 #include <rtthread.h>
 #include <rtthread.h>
 #include "finsh.h"
 #include "finsh.h"
 
 
-#define FINSH_USING_HISTORY
+/* For historical reasons, users don't define FINSH_USING_HISTORY in rtconfig.h
+ * but expect the history feature. So you sould define FINSH_USING_HISTORY to 0
+ * to disable it from the rtconfig.h. */
+#ifdef FINSH_USING_HISTORY
+#    if FINSH_USING_HISTORY == 0
+#        undef FINSH_USING_HISTORY
+#    endif
+#else
+#    define FINSH_USING_HISTORY
+#endif
+
 #ifndef FINSH_THREAD_PRIORITY
 #ifndef FINSH_THREAD_PRIORITY
 #define FINSH_THREAD_PRIORITY 20
 #define FINSH_THREAD_PRIORITY 20
 #endif
 #endif