58 lines
1.9 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
*****************************************************************************/
2013-09-23 14:34:35 -04:00
/* @(/3/0) .................................................................*/
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 */
DONE_SIG, /* published by Philosopher when done eating */
PAUSE_SIG, /* published by BSP to pause the application */
TERMINATE_SIG, /* published by BSP to terminate the application */
MAX_PUB_SIG, /* the last published signal */
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
MAX_SIG /* the last signal */
};
/* @(/1/0) .................................................................*/
typedef struct TableEvtTag {
/* protected: */
QEvt super;
/* public: */
uint8_t philoNum;
} TableEvt;
/* number of philosophers */
#define N_PHILO ((uint8_t)5)
2012-12-10 16:00:27 -05:00
/* @(/2/4) .................................................................*/
2012-08-14 18:07:04 -04:00
void Philo_ctor(void);
2012-12-10 16:00:27 -05:00
/* @(/2/5) .................................................................*/
2012-08-14 18:07:04 -04:00
void Table_ctor(void);
extern QActive * const AO_Philo[N_PHILO];
2013-09-23 14:34:35 -04:00
2012-08-14 18:07:04 -04:00
extern QActive * const AO_Table;
2013-09-23 14:34:35 -04:00
2012-08-14 18:07:04 -04:00
#endif /* dpp_h */