dpp.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  2. /*
  3. * Model: dpp.qm
  4. * File: ${.::dpp.h}
  5. *
  6. * This code has been generated by QM 5.2.5 <www.state-machine.com/qm>.
  7. * DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
  8. *
  9. * SPDX-License-Identifier: GPL-3.0-or-later
  10. *
  11. * This generated code is open source software: you can redistribute it under
  12. * the terms of the GNU General Public License as published by the Free
  13. * Software Foundation.
  14. *
  15. * This code is distributed in the hope that it will be useful, but WITHOUT
  16. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  18. * more details.
  19. *
  20. * NOTE:
  21. * Alternatively, this generated code may be distributed under the terms
  22. * of Quantum Leaps commercial licenses, which expressly supersede the GNU
  23. * General Public License and are specifically designed for licensees
  24. * interested in retaining the proprietary status of their code.
  25. *
  26. * Contact information:
  27. * <www.state-machine.com/licensing>
  28. * <info@state-machine.com>
  29. */
  30. /*$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
  31. #ifndef DPP_H
  32. #define DPP_H
  33. enum DPPSignals {
  34. EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
  35. DONE_SIG, /* published by Philosopher when done eating */
  36. PAUSE_SIG, /* published by BSP to pause serving forks */
  37. SERVE_SIG, /* published by BSP to serve re-start serving forks */
  38. TEST_SIG, /* published by BSP to test the application */
  39. MAX_PUB_SIG, /* the last published signal */
  40. HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
  41. TIMEOUT_SIG, /* used by Philosophers for time events */
  42. MAX_SIG /* the last signal */
  43. };
  44. /*$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  45. /*${Events::TableEvt} ......................................................*/
  46. typedef struct {
  47. /* protected: */
  48. QEvt super;
  49. /* public: */
  50. uint8_t philoNum;
  51. } TableEvt;
  52. /*$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
  53. /* number of philosophers */
  54. #define N_PHILO ((uint8_t)5)
  55. /*$declare${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  56. /*${AOs::Philo_ctor} .......................................................*/
  57. void Philo_ctor(void);
  58. /*$enddecl${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
  59. /*$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  60. /*${AOs::AO_Philo[N_PHILO]} ................................................*/
  61. /* opaque pointers to the Philo AOs */
  62. extern QActive * const AO_Philo[N_PHILO];
  63. /*$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
  64. /*$declare${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  65. /*${AOs::Table_ctor} .......................................................*/
  66. void Table_ctor(void);
  67. /*$enddecl${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
  68. /*$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  69. /*${AOs::AO_Table} .........................................................*/
  70. /* opaque pointer to the Table AO */
  71. extern QActive * const AO_Table;
  72. /*$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
  73. #ifdef QXK_H_
  74. void Test1_ctor(void);
  75. extern QXThread * const XT_Test1;
  76. void Test2_ctor(void);
  77. extern QXThread * const XT_Test2;
  78. #endif /* QXK_H_ */
  79. #endif /* DPP_H */