mirror of
https://github.com/QuantumLeaps/qpc.git
synced 2025-02-04 07:13:16 +08:00
Added "QUIT" (QP Unit Internal Testing); refined AO encapsulation in examples: workstation/dpp and arm-cm/game
63 lines
2.2 KiB
C
63 lines
2.2 KiB
C
/*.$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
|
/*
|
|
* Model: dpp.qm
|
|
* File: ${.::dpp.h}
|
|
*
|
|
* This code has been generated by QM 5.1.0 <www.state-machine.com/qm/>.
|
|
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
|
*
|
|
* This program is open source software: you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as published
|
|
* by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
* for more details.
|
|
*/
|
|
/*.$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
|
#ifndef DPP_H
|
|
#define DPP_H
|
|
|
|
enum DPPSignals {
|
|
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
|
|
DONE_SIG, /* published by Philosopher when done eating */
|
|
PAUSE_SIG, /* published by BSP to pause serving forks */
|
|
SERVE_SIG, /* published by BSP to serve re-start serving forks */
|
|
TEST_SIG, /* published by BSP to test the application */
|
|
MAX_PUB_SIG, /* the last published signal */
|
|
|
|
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
|
|
TIMEOUT_SIG, /* used by Philosophers for time events */
|
|
MAX_SIG /* the last signal */
|
|
};
|
|
|
|
/* number of philosophers */
|
|
#define N_PHILO ((uint8_t)5)
|
|
|
|
/*.$declare${Shared} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
|
/*.${Shared::TableEvt} .....................................................*/
|
|
typedef struct {
|
|
/* protected: */
|
|
QEvt super;
|
|
|
|
/* public: */
|
|
uint8_t philoNum;
|
|
} TableEvt;
|
|
extern QActive * const AO_Philo[N_PHILO];
|
|
extern QActive * const AO_Table;
|
|
/*.${Shared::Philo_ctor_call} ..............................................*/
|
|
void Philo_ctor_call(void);
|
|
/*.${Shared::Table_ctor_call} ..............................................*/
|
|
void Table_ctor_call(void);
|
|
/*.$enddecl${Shared} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
|
|
|
#ifdef QXK_H
|
|
void Test1_ctor(void);
|
|
extern QXThread * const XT_Test1;
|
|
void Test2_ctor(void);
|
|
extern QXThread * const XT_Test2;
|
|
#endif /* QXK_H */
|
|
|
|
#endif /* DPP_H */
|