Revision 2dd2e257

View differences:

core/inc/aos_confcheck.h
114 114
    #error "AMIROOS_CFG_SHELL_MAXARGS not defined in aosconf.h"
115 115
  #endif
116 116

  
117
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
117
#else /* AMIROOS_CFG_SHELL_ENABLE == false */
118

  
119
  #if (AMIROOS_CFG_TESTS_ENABLE == true)
120
    #pragma message "AMiRo-OS shell enabled implicitely via AMIROOS_CFG_TESTS_ENABLE"
121
  #endif
122

  
123
#endif /* AMIROOS_CFG_SHELL_ENABLE */
118 124

  
119 125
#endif /* _AMIROOS_CONFCHECK_H_ */
120 126

  
core/inc/aos_shell.h
28 28
#define _AMIROOS_SHELL_H_
29 29

  
30 30
#include <aosconf.h>
31
#if (AMIROOS_CFG_SHELL_ENABLE == true)
31
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
32 32
#include <hal.h>
33 33
#include <aos_types.h>
34 34
#include <aos_debug.h>
......
371 371
}
372 372
#endif
373 373

  
374
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
374
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
375 375

  
376 376
#endif /* _AMIROOS_SHELL_H_ */
377 377

  
core/inc/aos_system.h
167 167
    event_source_t os;
168 168
  } events;
169 169

  
170
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
170
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
171 171
  /**
172 172
   * @brief   Pointer to the shell object.
173 173
   */
......
191 191
#ifdef __cplusplus
192 192
extern "C" {
193 193
#endif
194
#if (AMIROOS_CFG_SHELL_ENABLE == true)
194
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
195 195
  void aosSysInit(const char* shellPrompt);
196 196
#else
197 197
  void aosSysInit(void);
core/src/aos_main.cpp
108 108
 */
109 109
static AosIOChannel _stdiochannel;
110 110

  
111
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
111
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
112 112
/**
113 113
 * @brief   I/O shell channel for the programmer interface.
114 114
 */
115 115
static AosShellChannel _stdshellchannel;
116
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
116
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)*/
117 117
#endif /* defined(MODULE_HAL_PROGIF) */
118 118

  
119 119
/*
......
922 922
#endif
923 923

  
924 924
  // AMiRo-OS and custom OS additions (if any)
925
#if (AMIROOS_CFG_SHELL_ENABLE == true)
925
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
926 926
  aosSysInit(moduleShellPrompt);
927 927
#else
928 928
  aosSysInit();
......
992 992
  aosIOChannelInit(&_stdiochannel, (BaseAsynchronousChannel*)&MODULE_HAL_PROGIF);
993 993
  aosIOChannelOutputEnable(&_stdiochannel);
994 994
  aosIOStreamAddChannel(&aos.iostream, &_stdiochannel);
995
#if (AMIROOS_CFG_SHELL_ENABLE == true)
995
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
996 996
  aosShellChannelInit(&_stdshellchannel, (BaseAsynchronousChannel*)&MODULE_HAL_PROGIF);
997 997
  aosShellChannelInputEnable(&_stdshellchannel);
998 998
  aosShellChannelOutputEnable(&_stdshellchannel);
core/src/aos_shell.c
27 27

  
28 28
#include <aos_shell.h>
29 29

  
30
#if (AMIROOS_CFG_SHELL_ENABLE == true)
30
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
31 31
#include <aos_debug.h>
32 32
#include <aos_time.h>
33 33
#include <aos_system.h>
......
1551 1551
  // no chSysUnlock() required since the thread has been terminated an all waiting threads have been woken up
1552 1552
}
1553 1553

  
1554
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
1554
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)*/
1555 1555

  
1556 1556
/** @} */
core/src/aos_system.c
55 55

  
56 56
/* forward declarations */
57 57
static void _printSystemInfo(BaseSequentialStream* stream);
58
#if (AMIROOS_CFG_SHELL_ENABLE == true)
58
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
59 59
static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv[]);
60 60
static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]);
61 61
static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* argv[]);
62 62
#if (AMIROOS_CFG_TESTS_ENABLE == true)
63 63
static int _shellcmd_kerneltestcb(BaseSequentialStream* stream, int argc, char* argv[]);
64 64
#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
65
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
65
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
66 66

  
67 67
/**
68 68
 * @brief   Timer to accumulate system uptime.
......
103 103
#define SYSTEM_SYSSYNCSKEW_LPFACTOR   (0.1f / AOS_SYSTEM_TIME_RESOLUTION)
104 104
#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */
105 105

  
106
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
106
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
107 107
/**
108 108
 * @brief   Shell thread working area.
109 109
 */
......
149 149
  /* callback */ _shellcmd_shutdowncb,
150 150
  /* next     */ NULL,
151 151
};
152
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
153 152

  
154 153
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
155 154
/**
......
161 160
  /* next     */ NULL,
162 161
};
163 162
#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
163
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
164 164

  
165 165
/**
166 166
 * @brief   Global system object.
......
315 315
  return;
316 316
}
317 317

  
318
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
318
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
319 319
/**
320 320
 * @brief   Callback function for the system:config shell command.
321 321
 *
......
517 517
#endif /* AMIROOS_CFG_SSSP_MASTER != true && AMIROOS_CFG_PROFILE == true */
518 518
  _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
519 519

  
520
#if (AMIROOS_CFG_SHELL_ENABLE == true)
521 520
  // print shell info
522 521
  chprintf(stream, "System shell information:\n");
523 522
  chprintf(stream, "\tnumber of commands:      %u\n", aosShellCountCommands(&aos.shell));
......
530 529
#endif /* CH_DBG_FILL_THREADS == TRUE */
531 530
#endif /* AMIROOS_CFG_DBG == true */
532 531
  _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
533
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
534 532

  
535 533
  return AOS_OK;
536 534
}
......
630 628
  return retval;
631 629
}
632 630
#endif /* AMIROOS_CFG_TESTS_ENABLE == true */
633
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
631
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
634 632

  
635 633
// suppress warning in case no interrupt GPIOs are defined
636 634
#pragma GCC diagnostic push
......
760 758
 *
761 759
 * @param[in] shellPrompt   String to be printed as prompt of the system shell.
762 760
 */
763
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
761
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
764 762
void aosSysInit(const char* shellPrompt)
765 763
#else
766 764
void aosSysInit(void)
......
827 825
  MODULE_INIT_INTERRUPTS();
828 826
#endif
829 827

  
830
#if (AMIROOS_CFG_SHELL_ENABLE == true)
828
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
831 829
  /* init shell */
832 830
  aosShellInit(&aos.shell,
833 831
               &aos.events.os,
......
843 841
#if (AMIROOS_CFG_TESTS_ENABLE == true)
844 842
  aosShellAddCommand(&aos.shell, &_shellcmd_kerneltest);
845 843
#endif
846
#endif /* AMIROOS_CFG_SHELL_ENABLE == true */
844
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
847 845

  
848 846
  return;
849 847
}
......
875 873
  _printSystemInfo((BaseSequentialStream*)&aos.iostream);
876 874
  aosprintf("\n");
877 875

  
878
#if (AMIROOS_CFG_SHELL_ENABLE == true)
876
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
879 877
  // start system shell thread
880 878
#if (CH_CFG_USE_THREADHIERARCHY == TRUE)
881 879
  aos.shell.thread = chThdCreateStatic(_shell_wa, sizeof(_shell_wa), AMIROOS_CFG_SHELL_THREADPRIO, aosShellThread, &aos.shell, &ch.mainthread);
......
1056 1054
 */
1057 1055
void aosSysStop(void)
1058 1056
{
1059
#if (AMIROOS_CFG_SHELL_ENABLE == true)
1057
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
1060 1058
  chThdWait(aos.shell.thread);
1061 1059
#endif
1062 1060

  
modules/DiWheelDrive_1-1/aosconf.h
62 62

  
63 63
/**
64 64
 * @brief   Flag to enable/disable unit tests.
65
 * @note    Setting this flag will implicitely enable the shell.
65 66
 */
66 67
#if !defined(OS_CFG_TESTS_ENABLE)
67 68
  #define AMIROOS_CFG_TESTS_ENABLE              true
......
178 179
/**
179 180
 * @brief   Shell enable flag.
180 181
 */
181
#if !defined(OS_CFG_SHELL_ENABLE) && (AMIROOS_CFG_TESTS_ENABLE != true)
182
  #define AMIROOS_CFG_SHELL_ENABLE              true
183
#elif (AMIROOS_CFG_TESTS_ENABLE == true)
182
#if !defined(OS_CFG_SHELL_ENABLE)
184 183
  #define AMIROOS_CFG_SHELL_ENABLE              true
185 184
#else
186 185
  #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
modules/DiWheelDrive_1-1/module.c
354 354
 */
355 355
/*===========================================================================*/
356 356

  
357
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
357
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
358 358
ROMCONST char* moduleShellPrompt = "DiWheelDrive";
359 359
#endif
360 360

  
modules/DiWheelDrive_1-1/module.h
290 290
 */
291 291
#define MODULE_OS_IOEVENTFLAGS_ACCELINT         AOS_IOEVENT_FLAG(GPIOB_ACCEL_INT_N)
292 292

  
293
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
293
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
294 294
/**
295 295
 * @brief   Shell prompt text.
296 296
 */
modules/LightRing_1-0/aosconf.h
62 62

  
63 63
/**
64 64
 * @brief   Flag to enable/disable unit tests.
65
 * @note    Setting this flag will implicitely enable the shell.
65 66
 */
66 67
#if !defined(OS_CFG_TESTS_ENABLE)
67 68
  #define AMIROOS_CFG_TESTS_ENABLE              true
......
178 179
/**
179 180
 * @brief   Shell enable flag.
180 181
 */
181
#if !defined(OS_CFG_SHELL_ENABLE) && (AMIROOS_CFG_TESTS_ENABLE != true)
182
  #define AMIROOS_CFG_SHELL_ENABLE              true
183
#elif (AMIROOS_CFG_TESTS_ENABLE == true)
182
#if !defined(OS_CFG_SHELL_ENABLE)
184 183
  #define AMIROOS_CFG_SHELL_ENABLE              true
185 184
#else
186 185
  #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
modules/LightRing_1-0/module.c
232 232
 */
233 233
/*===========================================================================*/
234 234

  
235
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
235
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
236 236
ROMCONST char* moduleShellPrompt = "LightRing";
237 237
#endif
238 238

  
modules/LightRing_1-0/module.h
185 185
 */
186 186
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(GPIOD_SYS_INT_N)
187 187

  
188
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
188
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
189 189
/**
190 190
 * @brief   Shell prompt text.
191 191
 */
modules/PowerManagement_1-1/aosconf.h
62 62

  
63 63
/**
64 64
 * @brief   Flag to enable/disable unit tests.
65
 * @note    Setting this flag will implicitely enable the shell.
65 66
 */
66 67
#if !defined(OS_CFG_TESTS_ENABLE)
67 68
  #define AMIROOS_CFG_TESTS_ENABLE              true
......
178 179
/**
179 180
 * @brief   Shell enable flag.
180 181
 */
181
#if !defined(OS_CFG_SHELL_ENABLE) && (AMIROOS_CFG_TESTS_ENABLE != true)
182
  #define AMIROOS_CFG_SHELL_ENABLE              true
183
#elif (AMIROOS_CFG_TESTS_ENABLE == true)
182
#if !defined(OS_CFG_SHELL_ENABLE)
184 183
  #define AMIROOS_CFG_SHELL_ENABLE              true
185 184
#else
186 185
  #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
modules/PowerManagement_1-1/module.c
548 548
 */
549 549
/*===========================================================================*/
550 550

  
551
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
551
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
552 552
ROMCONST char* moduleShellPrompt = "PowerManagement";
553 553
#endif
554 554

  
modules/PowerManagement_1-1/module.h
384 384
 */
385 385
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(GPIOB_SYS_UART_UP)
386 386

  
387
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
387
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
388 388
/**
389 389
 * @brief   Shell prompt text.
390 390
 */
modules/STM32F4Discovery/aosconf.h
62 62

  
63 63
/**
64 64
 * @brief   Flag to enable/disable unit tests.
65
 * @note    Setting this flag will implicitely enable the shell.
65 66
 */
66 67
#if !defined(OS_CFG_TESTS_ENABLE)
67 68
  #define AMIROOS_CFG_TESTS_ENABLE              true
......
178 179
/**
179 180
 * @brief   Shell enable flag.
180 181
 */
181
#if !defined(OS_CFG_SHELL_ENABLE) && (AMIROOS_CFG_TESTS_ENABLE != true)
182
  #define AMIROOS_CFG_SHELL_ENABLE              true
183
#elif (AMIROOS_CFG_TESTS_ENABLE == true)
182
#if !defined(OS_CFG_SHELL_ENABLE)
184 183
  #define AMIROOS_CFG_SHELL_ENABLE              true
185 184
#else
186 185
  #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
modules/STM32F4Discovery/module.c
149 149
 */
150 150
/*===========================================================================*/
151 151

  
152
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
152
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
153 153
ROMCONST char* moduleShellPrompt = "STM32F407Discovery";
154 154
#endif
155 155

  
modules/STM32F4Discovery/module.h
134 134
 */
135 135
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(GPIOA_BUTTON)
136 136

  
137
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
137
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
138 138
/**
139 139
 * @brief   Shell prompt text.
140 140
 */

Also available in: Unified diff