Revision 512abac1

View differences:

modules/DiWheelDrive_1-1/aosconf.h
130 130

  
131 131
/**
132 132
 * @brief   Shell thread priority.
133
 * @details Thread priorities are specified as an integer value.
134
 *          Predefined ranges are:
135
 *            lowest  ┌ THD_LOWPRIO_MIN
136
 *                    │ ...
137
 *                    └ THD_LOWPRIO_MAX
138
 *                    ┌ THD_NORMALPRIO_MIN
139
 *                    │ ...
140
 *                    └ THD_NORMALPRIO_MAX
141
 *                    ┌ THD_HIGHPRIO_MIN
142
 *                    │ ...
143
 *                    └ THD_HIGHPRIO_MAX
144
 *                    ┌ THD_RTPRIO_MIN
145
 *                    │ ...
146
 *            highest └ THD_RTPRIO_MAX
133 147
 */
134 148
#if !defined(OS_CFG_SHELL_THREADPRIO)
135
  #define AMIROOS_CFG_SHELL_THREADPRIO          THD_NORMALPRIO_MIN
149
  #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
136 150
#else
137 151
  #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
138 152
#endif
modules/LightRing_1-0/aosconf.h
130 130

  
131 131
/**
132 132
 * @brief   Shell thread priority.
133
 * @details Thread priorities are specified as an integer value.
134
 *          Predefined ranges are:
135
 *            lowest  ┌ THD_LOWPRIO_MIN
136
 *                    │ ...
137
 *                    └ THD_LOWPRIO_MAX
138
 *                    ┌ THD_NORMALPRIO_MIN
139
 *                    │ ...
140
 *                    └ THD_NORMALPRIO_MAX
141
 *                    ┌ THD_HIGHPRIO_MIN
142
 *                    │ ...
143
 *                    └ THD_HIGHPRIO_MAX
144
 *                    ┌ THD_RTPRIO_MIN
145
 *                    │ ...
146
 *            highest └ THD_RTPRIO_MAX
133 147
 */
134 148
#if !defined(OS_CFG_SHELL_THREADPRIO)
135
  #define AMIROOS_CFG_SHELL_THREADPRIO          THD_NORMALPRIO_MIN
149
  #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
136 150
#else
137 151
  #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
138 152
#endif
modules/PowerManagement_1-1/aosconf.h
130 130

  
131 131
/**
132 132
 * @brief   Shell thread priority.
133
 * @details Thread priorities are specified as an integer value.
134
 *          Predefined ranges are:
135
 *            lowest  ┌ THD_LOWPRIO_MIN
136
 *                    │ ...
137
 *                    └ THD_LOWPRIO_MAX
138
 *                    ┌ THD_NORMALPRIO_MIN
139
 *                    │ ...
140
 *                    └ THD_NORMALPRIO_MAX
141
 *                    ┌ THD_HIGHPRIO_MIN
142
 *                    │ ...
143
 *                    └ THD_HIGHPRIO_MAX
144
 *                    ┌ THD_RTPRIO_MIN
145
 *                    │ ...
146
 *            highest └ THD_RTPRIO_MAX
133 147
 */
134 148
#if !defined(OS_CFG_SHELL_THREADPRIO)
135
  #define AMIROOS_CFG_SHELL_THREADPRIO          THD_NORMALPRIO_MIN
149
  #define AMIROOS_CFG_SHELL_THREADPRIO          AOS_THD_NORMALPRIO_MIN
136 150
#else
137 151
  #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
138 152
#endif
os/core/inc/aos_thread.h
25 25
/**
26 26
 * @brief   Minimum thread priority.
27 27
 */
28
#define THD_LOWPRIO_MIN     ((tprio_t)  (LOWPRIO))
28
#define AOS_THD_LOWPRIO_MIN     ((tprio_t)(LOWPRIO))
29 29

  
30 30
/**
31 31
 * @brief   Maximum priority for background threads.
32 32
 */
33
#define THD_LOWPRIO_MAX     ((tprio_t)  (LOWPRIO + ((NORMALPRIO - LOWPRIO) / 2)))
33
#define AOS_THD_LOWPRIO_MAX     ((tprio_t)(LOWPRIO + ((NORMALPRIO - LOWPRIO) / 2)))
34 34

  
35 35
/**
36 36
 * @brief   Minimum priority for normal/standard threads.
37 37
 */
38
#define THD_NORMALPRIO_MIN  ((tprio_t)  (THD_LOWPRIO_MAX + 1))
38
#define AOS_THD_NORMALPRIO_MIN  ((tprio_t)(AOS_THD_LOWPRIO_MAX + 1))
39 39

  
40 40
/**
41 41
 * @brief   Maximum priority for normal/standard threads.
42 42
 */
43
#define THD_NORMALPRIO_MAX  ((tprio_t)  (NORMALPRIO))
43
#define AOS_THD_NORMALPRIO_MAX  ((tprio_t)(NORMALPRIO))
44 44

  
45 45
/**
46 46
 * @brief   Minimum priority for important threads.
47 47
 */
48
#define THD_HIGHPRIO_MIN    ((tprio_t)  (NORMALPRIO + 1))
48
#define AOS_THD_HIGHPRIO_MIN    ((tprio_t)(NORMALPRIO + 1))
49 49

  
50 50
/**
51 51
 * @brief   Maximum priority for important threads.
52 52
 */
53
#define THD_HIGHPRIO_MAX    ((tprio_t)  (NORMALPRIO + ((HIGHPRIO - NORMALPRIO) / 2)))
53
#define AOS_THD_HIGHPRIO_MAX    ((tprio_t)(NORMALPRIO + ((HIGHPRIO - NORMALPRIO) / 2)))
54 54

  
55 55
/**
56 56
 * @brief   Minimum priority for real-time threads.
57 57
 */
58
#define THD_RTPRIO_MIN      ((tprio_t)  (THD_HIGHPRIO_MAX + 1))
58
#define AOS_THD_RTPRIO_MIN      ((tprio_t)(AOS_THD_HIGHPRIO_MAX + 1))
59 59

  
60 60
/**
61 61
 * @brief   Maximum priority for real-time threads.
62 62
 */
63
#define THD_RTPRIO_MAX      ((tprio_t)  (HIGHPRIO - 1))
63
#define AOS_THD_RTPRIO_MAX      ((tprio_t)(HIGHPRIO - 1))
64 64

  
65 65
/**
66 66
 * @brief   Priority for the system control thread.
67 67
 */
68
#define THD_CTRLPRIO     ((tprio_t)  (HIGHPRIO))
68
#define AOS_THD_CTRLPRIO     ((tprio_t)(HIGHPRIO))
69 69

  
70 70
/**
71 71
 * @brief   Maximum timeframe that can be slept in system ticks.
72 72
 */
73
#define THD_MAX_SLEEP_ST    TIME_MAXIMUM
73
#define AOS_THD_MAX_SLEEP_ST    TIME_MAXIMUM
74 74

  
75 75
/**
76 76
 * @brief   Maximum timeframe that can be slept in seconds.
77 77
 */
78
#define THD_MAX_SLEEP_S     (ST2S(THD_MAX_SLEEP_ST) - 1)
78
#define AOS_THD_MAX_SLEEP_S     (ST2S(AOS_THD_MAX_SLEEP_ST) - 1)
79 79

  
80 80
/**
81 81
 * @brief   Maximum timeframe that can be slept in milliseconds.
82 82
 */
83
#define THD_MAX_SLEEP_MS    (ST2MS(THD_MAX_SLEEP_ST) - 1)
83
#define AOS_THD_MAX_SLEEP_MS    (ST2MS(AOS_THD_MAX_SLEEP_ST) - 1)
84 84

  
85 85
/**
86 86
 * @brief   Maximum timeframe that can be slept in microseconds.
87 87
 */
88
#define THD_MAX_SLEEP_US    (ST2US(THD_MAX_SLEEP_ST) - 1)
88
#define AOS_THD_MAX_SLEEP_US    (ST2US(AOS_THD_MAX_SLEEP_ST) - 1)
89 89

  
90 90
#ifdef __cplusplus
91 91
extern "C" {
os/core/inc/aos_timer.h
25 25
/**
26 26
 * @brief   Maximum timer interval that can be set in system ticks.
27 27
 */
28
#define TIMER_MAX_INTERVAL_ST         TIME_MAXIMUM
28
#define AOS_TIMER_MAX_INTERVAL_ST     TIME_MAXIMUM
29 29

  
30 30
/**
31 31
 * @brief   Maximum timer interval that can be set in seconds.
32 32
 */
33
#define TIMER_MAX_INTERVAL_S          (ST2S(TIMER_MAX_INTERVAL_ST) - 1)
33
#define AOS_TIMER_MAX_INTERVAL_S      (ST2S(AOS_TIMER_MAX_INTERVAL_ST) - 1)
34 34

  
35 35
/**
36 36
 * @brief   Maximum timer interval that can be set in milliseconds.
37 37
 */
38
#define TIMER_MAX_INTERVAL_MS         (ST2MS(TIMER_MAX_INTERVAL_ST) - 1)
38
#define AOS_TIMER_MAX_INTERVAL_MS     (ST2MS(AOS_TIMER_MAX_INTERVAL_ST) - 1)
39 39

  
40 40
/**
41 41
 * @brief   Maximum timer interval that can be set in microseconds.
42 42
 */
43
#define TIMER_MAX_INTERVAL_US         (ST2US(TIMER_MAX_INTERVAL_ST) - 1)
43
#define AOS_TIMER_MAX_INTERVAL_US     (ST2US(AOS_TIMER_MAX_INTERVAL_ST) - 1)
44 44

  
45 45
/**
46 46
 * @brief   Timer stucture.
os/core/src/aos_main.cpp
22 22
/*
23 23
 * hook to add further includes
24 24
 */
25
#if defined(AMIROOS_CFG_MAIN_EXTRA_INCLUDE)
26
AMIROOS_CFG_MAIN_EXTRA_INCLUDE
25
#if defined(AMIROOS_CFG_MAIN_EXTRA_INCLUDE_HEADER)
26
#include AMIROOS_CFG_MAIN_EXTRA_INCLUDE_HEADER
27 27
#endif
28 28

  
29 29
/**
30 30
 * @brief   Event mask to identify I/O events.
31 31
 */
32
#define IOEVENT_MASK                            EVENT_MASK(0)
32
#define _IOEVENT_MASK                           EVENT_MASK(0)
33 33

  
34 34
/**
35 35
 * @brief   Event mask to identify OS events.
36 36
 */
37
#define OSEVENT_MASK                            EVENT_MASK(1)
37
#define _OSEVENT_MASK                           EVENT_MASK(1)
38 38

  
39 39
/**
40 40
 * @brief   Listener object for I/O events.
......
172 172
#endif
173 173

  
174 174
  /* event associations */
175
  chEvtRegisterMask(&aos.events.io.source, &_eventListenerIO, IOEVENT_MASK);
176
  chEvtRegisterMask(&aos.events.os.source, &_eventListenerOS, OSEVENT_MASK);
175
  chEvtRegisterMask(&aos.events.io.source, &_eventListenerIO, _IOEVENT_MASK);
176
  chEvtRegisterMask(&aos.events.os.source, &_eventListenerOS, _OSEVENT_MASK);
177 177

  
178 178
#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5)
179 179
#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS)
......
309 309

  
310 310
    switch (eventmask) {
311 311
      // if this was an I/O event
312
      case IOEVENT_MASK:
312
      case _IOEVENT_MASK:
313 313
        // evaluate flags
314 314
        eventflags = chEvtGetAndClearFlags(&_eventListenerIO);
315 315
        // PD event
......
325 325
        break;
326 326

  
327 327
      // if this was an OS event
328
      case OSEVENT_MASK:
328
      case _OSEVENT_MASK:
329 329
        // evaluate flags
330 330
        eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
331 331
        switch (eventflags) {
os/core/src/aos_system.c
660 660
  aosDbgCheck(gpioSync != NULL);
661 661

  
662 662
  // set control thread to maximum priority
663
  chThdSetPriority(THD_CTRLPRIO);
663
  chThdSetPriority(AOS_THD_CTRLPRIO);
664 664

  
665 665
  // set local variables
666 666
  _gpioPd = gpioPd;
os/core/src/aos_thread.c
33 33
  aosSysGetUptimeX(&uptime);
34 34

  
35 35
  // while the remaining time is too long, it must be split into multiple sleeps
36
  while ( (*t > uptime) && ((*t - uptime) > THD_MAX_SLEEP_US) ) {
37
    chThdSleepS(US2ST(THD_MAX_SLEEP_US));
36
  while ( (*t > uptime) && ((*t - uptime) > AOS_THD_MAX_SLEEP_US) ) {
37
    chThdSleepS(US2ST(AOS_THD_MAX_SLEEP_US));
38 38
    aosSysGetUptimeX(&uptime);
39 39
  }
40 40

  
os/core/src/aos_timer.c
44 44
  // if the wakeup time is more than TIME_IMMEDIATE in the future
45 45
  if ( (timer->wkuptime > uptime) && ((timer->wkuptime - uptime) > TIME_IMMEDIATE) ) {
46 46
    // split the time delta if necessary
47
    if ((timer->wkuptime - uptime) > TIMER_MAX_INTERVAL_US) {
48
      chVTSetI(&(timer->vt), US2ST(TIMER_MAX_INTERVAL_US), _intermediateCb, timer);
47
    if ((timer->wkuptime - uptime) > AOS_TIMER_MAX_INTERVAL_US) {
48
      chVTSetI(&(timer->vt), US2ST(AOS_TIMER_MAX_INTERVAL_US), _intermediateCb, timer);
49 49
    } else {
50 50
      chVTSetI(&(timer->vt), US2ST(timer->wkuptime - uptime), _fireCb, timer);
51 51
    }

Also available in: Unified diff