72 lines
2.2 KiB
C
Raw Normal View History

2012-08-14 18:07:04 -04:00
/*****************************************************************************
* Model: dpp.qm
2012-12-10 16:00:27 -05:00
* File: ./dpp.h
2012-08-14 18:07:04 -04:00
*
2013-09-23 14:34:35 -04:00
* This code has been generated by QM tool (see state-machine.com/qm).
* 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.
2012-08-14 18:07:04 -04:00
*****************************************************************************/
2014-04-06 11:43:13 -04:00
/*${.::dpp.h} ..............................................................*/
2012-08-14 18:07:04 -04:00
#ifndef dpp_h
#define dpp_h
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-09-23 12:08:21 -04: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
};
2016-11-30 18:14:20 -05:00
2017-02-08 20:25:14 -05:00
#if ((QP_VERSION < 580) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8)))
2016-11-30 18:14:20 -05:00
#error qpc version 5.8.0 or higher required
#endif
2014-04-06 11:43:13 -04:00
/*${Events::TableEvt} ......................................................*/
typedef struct {
2012-08-14 18:07:04 -04:00
/* protected: */
QEvt super;
/* public: */
uint8_t philoNum;
} TableEvt;
/* number of philosophers */
#define N_PHILO ((uint8_t)5)
2014-04-06 11:43:13 -04:00
/*${AOs::Philo_ctor} .......................................................*/
2012-08-14 18:07:04 -04:00
void Philo_ctor(void);
2015-12-24 14:33:20 -05:00
extern QMActive * const AO_Philo[N_PHILO];
2012-08-14 18:07:04 -04:00
2015-12-24 14:33:20 -05:00
/*${AOs::Table_ctor} .......................................................*/
void Table_ctor(void);
2013-09-23 14:34:35 -04:00
2016-11-30 18:14:20 -05:00
extern QActive * const AO_Table;
2012-08-14 18:07:04 -04:00
2013-09-23 14:34:35 -04:00
2015-12-24 14:33:20 -05:00
#ifdef qxk_h
2016-09-23 12:08:21 -04:00
void Test1_ctor(void);
extern QXThread * const XT_Test1;
void Test2_ctor(void);
extern QXThread * const XT_Test2;
2015-12-24 14:33:20 -05:00
#endif /* qxk_h */
2015-04-28 13:45:35 -04:00
#endif /* dpp_h */