Revision dada2194

View differences:

core/inc/aos_types.h
28 28
#define _AMIROOS_TYPES_H_
29 29

  
30 30
/**
31
 * @brief   Converts a GPIO pad number to a unique event flag.
32
 */
33
#define AOS_IOEVENT_FLAG(pad)                   ((eventflags_t)1 << pad)
34

  
35
/**
31 36
 * @brief   Error codes used in AMiRo-OS.
32 37
 */
33 38
typedef enum {
core/src/aos_system.c
645 645
  aosDbgCheck((args != NULL) && (*((iopadid_t*)args) < sizeof(eventflags_t) * 8));
646 646

  
647 647
  chSysLockFromISR();
648
  chEvtBroadcastFlagsI(&aos.events.io, (eventflags_t)1 << *((iopadid_t*)args));
648
  chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(*((iopadid_t*)args)));
649 649
  chSysUnlockFromISR();
650 650

  
651 651
  return;
......
689 689
    }
690 690
  }
691 691
  // broadcast event
692
  chEvtBroadcastFlagsI(&aos.events.io, (eventflags_t)1 << *((iopadid_t*)args));
692
  chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(*((iopadid_t*)args)));
693 693
  chSysUnlockFromISR();
694 694

  
695 695
  return;
modules/DiWheelDrive_1-1/module.h
243 243
/**
244 244
 * @brief   Event flag to be set on a SYS_SYNC interrupt.
245 245
 */
246
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          ((eventflags_t)1 << GPIOC_SYS_INT_N)
246
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(GPIOC_SYS_INT_N)
247 247

  
248 248
/**
249 249
 * @brief   Event flag to be set on a SYS_WARMRST interrupt.
250 250
 */
251
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       ((eventflags_t)1 << GPIOD_SYS_WARMRST_N)
251
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       AOS_IOEVENT_FLAG(GPIOD_SYS_WARMRST_N)
252 252

  
253 253
/**
254 254
 * @brief   Event flag to be set on a PATH_DCSTAT interrupt.
255 255
 */
256
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT       ((eventflags_t)1 << GPIOC_PATH_DCEN)
256
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT       AOS_IOEVENT_FLAG(GPIOC_PATH_DCEN)
257 257

  
258 258
/**
259 259
 * @brief   Event flag to be set on a COMPASS_DRDY interrupt.
260 260
 */
261
#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY      ((eventflags_t)1 << GPIOB_COMPASS_DRDY)
261
#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY      AOS_IOEVENT_FLAG(GPIOB_COMPASS_DRDY)
262 262

  
263 263
/**
264 264
 * @brief   Event flag to be set on a SYS_PD interrupt.
265 265
 */
266
#define MODULE_OS_IOEVENTFLAGS_SYSPD            ((eventflags_t)1 << GPIOC_SYS_PD_N)
266
#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
267 267

  
268 268
/**
269 269
 * @brief   Event flag to be set on a SYS_REG_EN interrupt.
270 270
 */
271
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN         ((eventflags_t)1 << GPIOC_SYS_REG_EN)
271
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN         AOS_IOEVENT_FLAG(GPIOC_SYS_REG_EN)
272 272

  
273 273
/**
274 274
 * @brief   Event flag to be set on a IR_INT interrupt.
275 275
 */
276
#define MODULE_OS_IOEVENTFLAGS_IRINT            ((eventflags_t)1 << GPIOB_IR_INT)
276
#define MODULE_OS_IOEVENTFLAGS_IRINT            AOS_IOEVENT_FLAG(GPIOB_IR_INT)
277 277

  
278 278
/**
279 279
 * @brief   Event flag to be set on a GYRO_DRDY interrupt.
280 280
 */
281
#define MODULE_OS_IOEVENTFLAGS_GYRODRDY         ((eventflags_t)1 << GPIOB_GYRO_DRDY)
281
#define MODULE_OS_IOEVENTFLAGS_GYRODRDY         AOS_IOEVENT_FLAG(GPIOB_GYRO_DRDY)
282 282

  
283 283
/**
284 284
 * @brief   Event flag to be set on a SYS_UART_UP interrupt.
285 285
 */
286
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        ((eventflags_t)1 << GPIOB_SYS_UART_UP)
286
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(GPIOB_SYS_UART_UP)
287 287

  
288 288
/**
289 289
 * @brief   Event flag to be set on a ACCEL_INT interrupt.
290 290
 */
291
#define MODULE_OS_IOEVENTFLAGS_ACCELINT         ((eventflags_t)1 << GPIOB_ACCEL_INT_N)
291
#define MODULE_OS_IOEVENTFLAGS_ACCELINT         AOS_IOEVENT_FLAG(GPIOB_ACCEL_INT_N)
292 292

  
293 293
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
294 294
/**
modules/LightRing_1-0/module.h
158 158
/**
159 159
 * @brief   Event flag to be set on a LASER_OC interrupt.
160 160
 */
161
#define MODULE_OS_IOEVENTFLAGS_LASEROC          ((eventflags_t)1 << GPIOB_LASER_OC_N)
161
#define MODULE_OS_IOEVENTFLAGS_LASEROC          AOS_IOEVENT_FLAG(GPIOB_LASER_OC_N)
162 162

  
163 163
/**
164 164
 * @brief   Event flag to be set on a SYS_UART_DN interrupt.
165 165
 */
166
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        ((eventflags_t)1 << GPIOB_SYS_UART_DN)
166
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        AOS_IOEVENT_FLAG(GPIOB_SYS_UART_DN)
167 167

  
168 168
/**
169 169
 * @brief   Event flag to be set on a WL_GDO2 interrupt.
170 170
 */
171
#define MODULE_OS_IOEVENTFLAGS_WLGDO2           ((eventflags_t)1 << GPIOB_WL_GDO2)
171
#define MODULE_OS_IOEVENTFLAGS_WLGDO2           AOS_IOEVENT_FLAG(GPIOB_WL_GDO2)
172 172

  
173 173
/**
174 174
 * @brief   Event flag to be set on a WL_GDO0 interrupt.
175 175
 */
176
#define MODULE_OS_IOEVENTFLAGS_WLGDO0           ((eventflags_t)1 << GPIOB_WL_GDO0)
176
#define MODULE_OS_IOEVENTFLAGS_WLGDO0           AOS_IOEVENT_FLAG(GPIOB_WL_GDO0)
177 177

  
178 178
/**
179 179
 * @brief   Event flag to be set on a SYS_PD interrupt.
180 180
 */
181
#define MODULE_OS_IOEVENTFLAGS_SYSPD            ((eventflags_t)1 << GPIOC_SYS_PD_N)
181
#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
182 182

  
183 183
/**
184 184
 * @brief   Event flag to be set on a SYS_SYNC interrupt.
185 185
 */
186
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          ((eventflags_t)1 << GPIOD_SYS_INT_N)
186
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(GPIOD_SYS_INT_N)
187 187

  
188 188
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
189 189
/**
modules/PowerManagement_1-1/module.h
317 317
/**
318 318
 * @brief   Event flag to be set on a IR_INT1 / CHARGE_STAT1A interrupt.
319 319
 */
320
#define MODULE_OS_IOEVENTFLAGS_IRINT1           ((eventflags_t)1 << GPIOB_IR_INT1_N)
320
#define MODULE_OS_IOEVENTFLAGS_IRINT1           AOS_IOEVENT_FLAG(GPIOB_IR_INT1_N)
321 321

  
322 322
/**
323 323
 * @brief   Event flag to be set on a GAUGE_BATLOW1 interrupt.
324 324
 */
325
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW1     ((eventflags_t)1 << GPIOC_GAUGE_BATLOW1)
325
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW1     AOS_IOEVENT_FLAG(GPIOC_GAUGE_BATLOW1)
326 326

  
327 327
/**
328 328
 * @brief   Event flag to be set on a GAUGE_BATGD1 interrupt.
329 329
 */
330
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD1      ((eventflags_t)1 << GPIOC_GAUGE_BATGD1_N)
330
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD1      AOS_IOEVENT_FLAG(GPIOC_GAUGE_BATGD1_N)
331 331

  
332 332
/**
333 333
 * @brief   Event flag to be set on a SYS_UART_DN interrupt.
334 334
 */
335
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        ((eventflags_t)1 << GPIOB_SYS_UART_DN)
335
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        AOS_IOEVENT_FLAG(GPIOB_SYS_UART_DN)
336 336

  
337 337
/**
338 338
 * @brief   Event flag to be set on a IR_INT2 / CHARGE_STAT2A interrupt.
339 339
 */
340
#define MODULE_OS_IOEVENTFLAGS_IRINT2           ((eventflags_t)1 << GPIOC_IR_INT2_N)
340
#define MODULE_OS_IOEVENTFLAGS_IRINT2           AOS_IOEVENT_FLAG(GPIOC_IR_INT2_N)
341 341

  
342 342
/**
343 343
 * @brief   Event flag to be set on a TOUCH_INT interrupt.
344 344
 */
345
#define MODULE_OS_IOEVENTFLAGS_TOUCHINT         ((eventflags_t)1 << GPIOC_TOUCH_INT_N)
345
#define MODULE_OS_IOEVENTFLAGS_TOUCHINT         AOS_IOEVENT_FLAG(GPIOC_TOUCH_INT_N)
346 346

  
347 347
/**
348 348
 * @brief   Event flag to be set on a GAUGE_BATLOW2 interrupt.
349 349
 */
350
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW2     ((eventflags_t)1 << GPIOB_GAUGE_BATLOW2)
350
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW2     AOS_IOEVENT_FLAG(GPIOB_GAUGE_BATLOW2)
351 351

  
352 352
/**
353 353
 * @brief   Event flag to be set on a GAUGE_BATGD2 interrupt.
354 354
 */
355
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD2      ((eventflags_t)1 << GPIOB_GAUGE_BATGD2_N)
355
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD2      AOS_IOEVENT_FLAG(GPIOB_GAUGE_BATGD2_N)
356 356

  
357 357
/**
358 358
 * @brief   Event flag to be set on a PATH_DC interrupt.
359 359
 */
360
#define MODULE_OS_IOEVENTFLAGS_PATHDC           ((eventflags_t)1 << GPIOC_PATH_DC)
360
#define MODULE_OS_IOEVENTFLAGS_PATHDC           AOS_IOEVENT_FLAG(GPIOC_PATH_DC)
361 361

  
362 362
/**
363 363
 * @brief   Event flag to be set on a SYS_SPI_DIR interrupt.
364 364
 */
365
#define MODULE_OS_IOEVENTFLAGS_SYSSPIDIR        ((eventflags_t)1 << GPIOC_SYS_SPI_DIR)
365
#define MODULE_OS_IOEVENTFLAGS_SYSSPIDIR        AOS_IOEVENT_FLAG(GPIOC_SYS_SPI_DIR)
366 366

  
367 367
/**
368 368
 * @brief   Event flag to be set on a SYS_SYNC interrupt.
369 369
 */
370
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          ((eventflags_t)1 << GPIOC_SYS_INT_N)
370
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(GPIOC_SYS_INT_N)
371 371

  
372 372
/**
373 373
 * @brief   Event flag to be set on a SYS_PD interrupt.
374 374
 */
375
#define MODULE_OS_IOEVENTFLAGS_SYSPD            ((eventflags_t)1 << GPIOC_SYS_PD_N)
375
#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
376 376

  
377 377
/**
378 378
 * @brief   Event flag to be set on a SYS_WARMRST interrupt.
379 379
 */
380
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       ((eventflags_t)1 << GPIOC_SYS_WARMRST_N)
380
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       AOS_IOEVENT_FLAG(GPIOC_SYS_WARMRST_N)
381 381

  
382 382
/**
383 383
 * @brief   Event flag to be set on a SYS_UART_UP interrupt.
384 384
 */
385
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        ((eventflags_t)1 << GPIOB_SYS_UART_UP)
385
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(GPIOB_SYS_UART_UP)
386 386

  
387 387
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
388 388
/**
modules/STM32F4Discovery/module.h
143 143
/**
144 144
 * @brief   Event flag to be set on a USER_BUTTON interrupt.
145 145
 */
146
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       ((eventflags_t)1 << GPIOA_BUTTON)
146
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(GPIOA_BUTTON)
147 147

  
148 148
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
149 149
/**

Also available in: Unified diff