Dining Philosophers Problem (DPP) example for the QP active object framework. Demonstrates: event-driven programming, hierarchical state machines in C++, modeling and graphical state machine design, code generation, preemptive multitasking, software tracing, power saving mode, direct event posting, publish-subscribe. More information available in the [[/users/QL/notebook|Quantum Leaps Notebook pages]]. See also [[http://www.state-machine.com|state-machine.com]].

Dependencies:   mbed qp

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bsp.h Source File

bsp.h

00001 //////////////////////////////////////////////////////////////////////////////
00002 // Product: DPP example, Board Support Package
00003 // Last Updated for Version: 4.5.02
00004 // Date of the Last Update:  Aug 09, 2012
00005 //
00006 //                    Q u a n t u m     L e a P s
00007 //                    ---------------------------
00008 //                    innovating embedded systems
00009 //
00010 // Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
00011 //
00012 // This program is open source software: you can redistribute it and/or
00013 // modify it under the terms of the GNU General Public License as published
00014 // by the Free Software Foundation, either version 2 of the License, or
00015 // (at your option) any later version.
00016 //
00017 // Alternatively, this program may be distributed and modified under the
00018 // terms of Quantum Leaps commercial licenses, which expressly supersede
00019 // the GNU General Public License and are specifically designed for
00020 // licensees interested in retaining the proprietary status of their code.
00021 //
00022 // This program is distributed in the hope that it will be useful,
00023 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00025 // GNU General Public License for more details.
00026 //
00027 // You should have received a copy of the GNU General Public License
00028 // along with this program. If not, see <http://www.gnu.org/licenses/>.
00029 //
00030 // Contact information:
00031 // Quantum Leaps Web sites: http://www.quantum-leaps.com
00032 //                          http://www.state-machine.com
00033 // e-mail:                  info@quantum-leaps.com
00034 //////////////////////////////////////////////////////////////////////////////
00035 #ifndef bsp_h
00036 #define bsp_h
00037                                                 // System clock tick rate [Hz]
00038 namespace DPP {
00039 
00040 uint32_t const BSP_TICKS_PER_SEC = static_cast<uint32_t>(50);
00041 uint32_t const BSP_SCREEN_WIDTH  = static_cast<uint32_t>(96);
00042 uint32_t const BSP_SCREEN_HEIGHT = static_cast<uint32_t>(16);
00043 
00044 void BSP_init(void);
00045 void BSP_displayPaused(uint8_t const paused);
00046 void BSP_displayPhilStat(uint8_t const n, char_t const *stat);
00047 void BSP_terminate(int16_t const result);
00048 
00049 void BSP_randomSeed(uint32_t const seed);                       // random seed
00050 uint32_t BSP_random(void);                          // pseudo-random generator
00051 
00052 }                                                             // namespace DPP
00053 
00054 #endif                                                                // bsp_h
00055 
00056