Revision 47e89ebf core/src/aos_system.c
core/src/aos_system.c | ||
---|---|---|
84 | 84 |
/* |
85 | 85 |
* forward declarations |
86 | 86 |
*/ |
87 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
|
|
87 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
|
88 | 88 |
static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv[]); |
89 | 89 |
static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]); |
90 | 90 |
static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* argv[]); |
91 | 91 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
92 | 92 |
static int _shellcmd_kerneltestcb(BaseSequentialStream* stream, int argc, char* argv[]); |
93 | 93 |
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */ |
94 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
|
|
94 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */ |
|
95 | 95 |
|
96 | 96 |
/** |
97 | 97 |
* @brief Timer to accumulate system uptime. |
... | ... | |
128 | 128 |
|
129 | 129 |
#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */ |
130 | 130 |
|
131 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
|
|
131 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
|
132 | 132 |
/** |
133 | 133 |
* @brief Shell thread working area. |
134 | 134 |
*/ |
... | ... | |
157 | 157 |
/** |
158 | 158 |
* @brief Shell command to shutdown the system. |
159 | 159 |
*/ |
160 |
#if (AMIROOS_CFG_SSSP_ENABLE == true) |
|
160 |
#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
|
|
161 | 161 |
static AOS_SHELL_COMMAND(_shellcmd_shutdown, "system:shutdown", _shellcmd_shutdowncb); |
162 | 162 |
#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */ |
163 | 163 |
static AOS_SHELL_COMMAND(_shellcmd_shutdown, "module:shutdown", _shellcmd_shutdowncb); |
164 | 164 |
#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */ |
165 | 165 |
|
166 | 166 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
167 |
|
|
167 | 168 |
/** |
168 | 169 |
* @brief Shell kommand to run a test of the ChibiOS/RT kernel. |
169 | 170 |
*/ |
170 | 171 |
static AOS_SHELL_COMMAND(_shellcmd_kerneltest, "kernel:test", _shellcmd_kerneltestcb); |
172 |
|
|
171 | 173 |
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */ |
172 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
|
|
174 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */ |
|
173 | 175 |
|
174 | 176 |
/******************************************************************************/ |
175 | 177 |
/* LOCAL FUNCTIONS */ |
... | ... | |
331 | 333 |
return; |
332 | 334 |
} |
333 | 335 |
|
334 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
|
|
336 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
|
335 | 337 |
/** |
336 | 338 |
* @brief Callback function for the system:config shell command. |
337 | 339 |
* |
... | ... | |
647 | 649 |
|
648 | 650 |
return retval; |
649 | 651 |
} |
652 |
|
|
650 | 653 |
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */ |
651 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
|
|
654 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */ |
|
652 | 655 |
|
653 | 656 |
// suppress warning in case no interrupt GPIOs are defined |
654 | 657 |
#pragma GCC diagnostic push |
... | ... | |
782 | 785 |
* |
783 | 786 |
* @param[in] shellPrompt String to be printed as prompt of the system shell. |
784 | 787 |
*/ |
785 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
|
786 | 788 |
void aosSysInit(const char* shellPrompt) |
787 |
#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */ |
|
788 |
void aosSysInit(void) |
|
789 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */ |
|
790 | 789 |
{ |
791 | 790 |
/* set control thread to maximum priority */ |
792 | 791 |
chThdSetPriority(AOS_THD_CTRLPRIO); |
... | ... | |
845 | 844 |
#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */ |
846 | 845 |
#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */ |
847 | 846 |
|
848 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
|
|
847 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) |
|
849 | 848 |
/* init shell */ |
850 | 849 |
aosShellInit(&aos.shell, |
851 | 850 |
&aos.events.os, |
... | ... | |
861 | 860 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) |
862 | 861 |
aosShellAddCommand(&aos.shell, &_shellcmd_kerneltest); |
863 | 862 |
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */ |
864 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
|
|
863 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */ |
|
865 | 864 |
|
866 | 865 |
return; |
867 | 866 |
} |
... | ... | |
893 | 892 |
_printSystemInfo((BaseSequentialStream*)&aos.iostream); |
894 | 893 |
aosprintf("\n"); |
895 | 894 |
|
896 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
|
|
895 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) |
|
897 | 896 |
// start system shell thread |
898 | 897 |
#if (CH_CFG_USE_THREADHIERARCHY == TRUE) |
899 | 898 |
aos.shell.thread = chThdCreateStatic(_shell_wa, sizeof(_shell_wa), AMIROOS_CFG_SHELL_THREADPRIO, aosShellThread, &aos.shell, &ch.mainthread); |
900 | 899 |
#else /* (CH_CFG_USE_THREADHIERARCHY == TRUE) */ |
901 | 900 |
aos.shell.thread = chThdCreateStatic(_shell_wa, sizeof(_shell_wa), AMIROOS_CFG_SHELL_THREADPRIO, aosShellThread, &aos.shell); |
902 | 901 |
#endif /* (CH_CFG_USE_THREADHIERARCHY == TRUE) */ |
903 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
|
|
902 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */ |
|
904 | 903 |
|
905 | 904 |
return; |
906 | 905 |
} |
Also available in: Unified diff