77 lines
2.9 KiB
C
Raw Normal View History

2019-12-31 15:55:08 -05:00
/*.$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
2018-06-25 16:56:47 -04:00
/*
2012-08-14 18:07:04 -04:00
* Model: dpp.qm
2018-06-25 16:56:47 -04:00
* File: ${.::dpp.h}
2012-08-14 18:07:04 -04:00
*
2020-07-18 17:56:40 -04:00
* This code has been generated by QM 5.0.2 <www.state-machine.com/qm/>.
2013-09-23 14:34:35 -04:00
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
2012-08-14 18:07:04 -04:00
*
2013-09-23 14:34:35 -04:00
* 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.
2018-06-25 16:56:47 -04:00
*/
2019-12-31 15:55:08 -05:00
/*.$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
2019-10-27 11:57:33 -04:00
#ifndef DPP_H
#define DPP_H
2012-08-14 18:07:04 -04:00
enum DPPSignals {
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
2015-04-28 13:45:35 -04:00
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 */
2016-11-30 18:14:20 -05:00
TEST_SIG, /* published by BSP to test the application */
2015-04-28 13:45:35 -04:00
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 */
2012-08-14 18:07:04 -04:00
};
2019-12-31 15:55:08 -05:00
/*.$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${Events::TableEvt} .....................................................*/
2014-04-06 11:43:13 -04:00
typedef struct {
2012-08-14 18:07:04 -04:00
/* protected: */
QEvt super;
/* public: */
uint8_t philoNum;
} TableEvt;
2019-12-31 15:55:08 -05:00
/*.$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
2012-08-14 18:07:04 -04:00
/* number of philosophers */
#define N_PHILO ((uint8_t)5)
2019-12-31 15:55:08 -05:00
/*.$declare${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo_ctor} ......................................................*/
2012-08-14 18:07:04 -04:00
void Philo_ctor(void);
2019-12-31 15:55:08 -05:00
/*.$enddecl${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
2012-08-14 18:07:04 -04:00
2018-06-25 16:56:47 -04:00
/* opaque pointers to the Philo AOs */
2020-07-18 17:56:40 -04:00
extern QActive * const AO_Philo[N_PHILO];
2019-12-31 15:55:08 -05:00
/*.$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
2016-11-30 18:14:20 -05:00
2019-12-31 15:55:08 -05:00
/*.$declare${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table_ctor} ......................................................*/
2012-08-14 18:07:04 -04:00
void Table_ctor(void);
2019-12-31 15:55:08 -05:00
/*.$enddecl${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
2012-08-14 18:07:04 -04:00
2018-06-25 16:56:47 -04:00
/* opaque pointer to the Table AO */
2016-11-30 18:14:20 -05:00
extern QActive * const AO_Table;
2019-12-31 15:55:08 -05:00
/*.$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
2012-08-14 18:07:04 -04:00
2019-10-27 11:57:33 -04:00
#ifdef QXK_H
2016-11-30 18:14:20 -05:00
void Test1_ctor(void);
extern QXThread * const XT_Test1;
void Test2_ctor(void);
extern QXThread * const XT_Test2;
2019-10-27 11:57:33 -04:00
#endif /* QXK_H */
2013-09-23 14:34:35 -04:00
2019-10-27 11:57:33 -04:00
#endif /* DPP_H */