Revision 83e58975

View differences:

core/inc/aos_debug.h
64 64
 *
65 65
 * @param[in] c The condition to be verified to be true.
66 66
 */
67
#define aosDbgCheck(c) {                                                      \
67
#define aosDbgCheck(c) do {                                                   \
68 68
  if (!(c)) {                                                                 \
69 69
    aosDbgPrintf("%s(%u): aosDbgCheck failed", __FILE__, __LINE__);           \
70 70
    chThdExit(MSG_RESET);                                                     \
71 71
  }                                                                           \
72
}
72
} while (false)
73 73

  
74 74
/**
75 75
 * @brief   Condition assertion.
......
77 77
 *
78 78
 * @param[in] c The condition to be verified to be true.
79 79
 */
80
#define aosDbgAssert(c) {                                                     \
80
#define aosDbgAssert(c) do {                                                  \
81 81
  if (!(c)) {                                                                 \
82 82
    aosDbgPrintf("%s(%u): aosDbgAssert failed", __FILE__, __LINE__);          \
83 83
    chThdExit(MSG_RESET);                                                     \
84 84
  }                                                                           \
85
}
85
} while (false)
86 86

  
87 87
/**
88 88
 * @brief   Condition assertion.
......
91 91
 * @param[in] c The condition to be verified to be true.
92 92
 * @param[in] r A custom remark string.
93 93
 */
94
#define aosDbgAssertMsg(c, fmt, ...) {                                        \
94
#define aosDbgAssertMsg(c, fmt, ...) do {                                     \
95 95
  if (!(c)) {                                                                 \
96 96
    aosDbgPrintf(fmt, ##__VA_ARGS__);                                         \
97 97
    chThdExit(MSG_RESET);                                                     \
98 98
  }                                                                           \
99
}
99
} while (false)
100 100

  
101 101
#else /* (AMIROOS_CFG_DBG == true) */
102 102

  
103
#define aosDbgPrintf(fmt, ...) {                          \
104
  (void)(fmt);                                            \
105
}
103
#define aosDbgPrintf(fmt, ...)                                                \
104
  (void)(fmt)
106 105

  
107
#define aosDbgCheck(c) {                                  \
108
  (void)(c);                                              \
109
  }
106
#define aosDbgCheck(c)                                                        \
107
  (void)(c)
110 108

  
111
#define aosDbgAssert(c) {                                 \
112
  (void)(c);                                              \
113
}
109
#define aosDbgAssert(c)                                                       \
110
  (void)(c)
114 111

  
115
#define aosDbgAssertMsg(c, r) {                           \
116
  (void)(c);                                              \
117
  (void)(r);                                              \
118
}
112
#define aosDbgAssertMsg(c, r)                                                 \
113
  (void)(c);                                                                  \
114
  (void)(r)
119 115

  
120 116
#endif /* (AMIROOS_CFG_DBG == true) */
121 117

  
core/src/aos_system.c
192 192

  
193 193
  // print the specified character n times
194 194
  for (unsigned int i = 0; i < n; ++i) {
195
    streamPut(stream, c);
195
    streamPut(stream, (uint8_t)c);
196 196
  }
197 197
  streamPut(stream, '\n');
198 198

  
......
222 222
  va_list ap;
223 223

  
224 224
  va_start(ap, fmt);
225
  n += chprintf(stream, name);
225
  n += (unsigned int)chprintf(stream, name);
226 226
  while (n < namewidth) {
227 227
    streamPut(stream, ' ');
228 228
    ++n;
229 229
  }
230
  n += chvprintf(stream, fmt, ap);
230
  n += (unsigned int)chvprintf(stream, fmt, ap);
231 231
  va_end(ap);
232 232

  
233 233
  streamPut(stream, '\n');
......
458 458
        chprintf(stream, "unknown option '%s' or invalid value '%s'\n", argv[2], argv[3]);
459 459
        return AOS_INVALIDARGUMENTS;
460 460
      }
461
      dt.tm_wday = aosTimeDayOfWeekFromDate(dt.tm_mday, dt.tm_mon+1, dt.tm_year+1900) % 7;
461
      dt.tm_wday = aosTimeDayOfWeekFromDate((uint16_t)dt.tm_mday, (uint8_t)dt.tm_mon+1, (uint16_t)dt.tm_year+1900) % DAYS_PER_WEEK;
462 462
      aosSysSetDateTime(&dt);
463 463

  
464 464
      // read and print new date and time
......
535 535
  chprintf(stream, "%10u milliseconds\n", (uint16_t)(uptime % MICROSECONDS_PER_SECOND / MICROSECONDS_PER_MILLISECOND));
536 536
  chprintf(stream, "%10u microseconds\n", (uint16_t)(uptime % MICROSECONDS_PER_MILLISECOND / MICROSECONDS_PER_MICROSECOND));
537 537
#if (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)
538
  chprintf(stream, "SSSP synchronization offset: %.3fus per %uus\n", _syssyncskew, AMIROOS_CFG_SSSP_SYSSYNCPERIOD);
538
  chprintf(stream, "SSSP synchronization offset: %.3fus per %uus\n", (double)_syssyncskew, AMIROOS_CFG_SSSP_SYSSYNCPERIOD);
539 539
#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */
540 540
  _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
541 541

  
......
547 547
#if (AMIROOS_CFG_DBG == true)
548 548
  chprintf(stream, "\tthread stack size:      %u bytes\n", aosThdGetStacksize(aos.shell.thread));
549 549
#if (CH_DBG_FILL_THREADS == TRUE)
550
  chprintf(stream, "\tstack peak utilization: %u bytes (%.2f%%)\n", aosThdGetStackPeakUtilization(aos.shell.thread), (float)(aosThdGetStackPeakUtilization(aos.shell.thread)) / (float)(aosThdGetStacksize(aos.shell.thread)) * 100.0f);
550
  chprintf(stream, "\tstack peak utilization: %u bytes (%.2f%%)\n", aosThdGetStackPeakUtilization(aos.shell.thread), (double)((float)(aosThdGetStackPeakUtilization(aos.shell.thread)) / (float)(aosThdGetStacksize(aos.shell.thread)) * 100.0f));
551 551
#endif /* (CH_DBG_FILL_THREADS == TRUE) */
552 552
#endif /* (AMIROOS_CFG_DBG == true) */
553 553
  _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
......
877 877
/**
878 878
 * @brief   Starts the system and all system threads.
879 879
 */
880
inline void aosSysStart(void)
880
void aosSysStart(void)
881 881
{
882 882
#if (AMIROOS_CFG_SSSP_ENABLE == true)
883 883
  // update the system SSSP stage
......
971 971
 *
972 972
 * @param[out] ut   The system uptime.
973 973
 */
974
inline void aosSysGetUptimeX(aos_timestamp_t* ut)
974
void aosSysGetUptimeX(aos_timestamp_t* ut)
975 975
{
976 976
  aosDbgCheck(ut != NULL);
977 977

  
modules/LightRing_1-2/board.h
67 67
#define BOARD_BREAKOUT_UWBv10       1
68 68

  
69 69
/*
70
 * Configuration macro to define which type of sensor ring is attached.
70
 * Configuration macro to define which breakout module is attached.
71 71
 */
72 72
#if !defined(BOARD_BREAKOUT_MODULE) || defined(__DOXYGEN__)
73
#define BOARD_BREAKOUT_MODULE       BOARD_BREAKOUT_UWBv10
73
#define BOARD_BREAKOUT_MODULE       BOARD_BREAKOUT_NONE
74 74
#endif
75 75

  
76 76
/*

Also available in: Unified diff