うおーるぼっとをWiiリモコンでコントロールする新しいプログラムです。 以前のものより、Wiiリモコンが早く繋がる様になりました。 It is a program which controls A with the Wii remote. ※ A Bluetooth dongle and a Wii remote control are needed.

Dependencies:   USBHost mbed FATFileSystem mbed-rtos

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RTX_Conf_CM.c Source File

RTX_Conf_CM.c

00001 /*----------------------------------------------------------------------------
00002  *      RL-ARM - RTX
00003  *----------------------------------------------------------------------------
00004  *      Name:    RTX_Conf_CM.C
00005  *      Purpose: Configuration of CMSIS RTX Kernel for Cortex-M
00006  *      Rev.:    V4.60
00007  *----------------------------------------------------------------------------
00008  *
00009  * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
00010  * All rights reserved.
00011  * Redistribution and use in source and binary forms, with or without
00012  * modification, are permitted provided that the following conditions are met:
00013  *  - Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  *  - Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in the
00017  *    documentation and/or other materials provided with the distribution.
00018  *  - Neither the name of ARM  nor the names of its contributors may be used 
00019  *    to endorse or promote products derived from this software without 
00020  *    specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00023  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
00024  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00025  * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
00026  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00027  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
00028  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00029  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
00030  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
00031  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  * POSSIBILITY OF SUCH DAMAGE.
00033  *---------------------------------------------------------------------------*/
00034 
00035 #include "cmsis_os.h"
00036 
00037 
00038 /*----------------------------------------------------------------------------
00039  *      RTX User configuration part BEGIN
00040  *---------------------------------------------------------------------------*/
00041 
00042 //-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
00043 //
00044 // <h>Thread Configuration
00045 // =======================
00046 //
00047 //   <o>Number of concurrent running threads <0-250>
00048 //   <i> Defines max. number of threads that will run at the same time.
00049 //       counting "main", but not counting "osTimerThread"
00050 //   <i> Default: 6
00051 #ifndef OS_TASKCNT
00052 #  if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
00053 #    define OS_TASKCNT         14
00054 #  elif defined(TARGET_LPC11U24)
00055 #    define OS_TASKCNT         6
00056 #  endif
00057 #endif
00058 
00059 //   <o>Scheduler (+ interrupts) stack size [bytes] <64-4096:8><#/4>
00060 #ifndef OS_SCHEDULERSTKSIZE
00061 #  if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
00062 #      define OS_SCHEDULERSTKSIZE    256
00063 #  elif defined(TARGET_LPC11U24)
00064 #      define OS_SCHEDULERSTKSIZE    128
00065 #  endif
00066 #endif
00067 
00068 //   <o>Idle stack size [bytes] <64-4096:8><#/4>
00069 //   <i> Defines default stack size for the Idle thread.
00070 #ifndef OS_IDLESTKSIZE
00071  #define OS_IDLESTKSIZE         128
00072 #endif
00073 
00074 //   <o>Timer Thread stack size [bytes] <64-4096:8><#/4>
00075 //   <i> Defines stack size for Timer thread.
00076 //   <i> Default: 200
00077 #ifndef OS_TIMERSTKSZ
00078  #define OS_TIMERSTKSZ  WORDS_STACK_SIZE
00079 #endif
00080 
00081 // <q>Check for stack overflow
00082 // <i> Includes the stack checking code for stack overflow.
00083 // <i> Note that additional code reduces the Kernel performance.
00084 #ifndef OS_STKCHECK
00085  #define OS_STKCHECK    1
00086 #endif
00087 
00088 // <o>Processor mode for thread execution 
00089 //   <0=> Unprivileged mode 
00090 //   <1=> Privileged mode
00091 // <i> Default: Privileged mode
00092 #ifndef OS_RUNPRIV
00093  #define OS_RUNPRIV     1
00094 #endif
00095 
00096 // </h>
00097 // <h>SysTick Timer Configuration
00098 // ==============================
00099 //
00100 //   <o>Timer clock value [Hz] <1-1000000000>
00101 //   <i> Defines the timer clock value.
00102 //   <i> Default: 6000000  (6MHz)
00103 #ifndef OS_CLOCK
00104 #  if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
00105 #    define OS_CLOCK       96000000
00106 #  elif defined(TARGET_LPC11U24)
00107 #    define OS_CLOCK       48000000
00108 #  endif
00109 #endif
00110 
00111 //   <o>Timer tick value [us] <1-1000000>
00112 //   <i> Defines the timer tick value.
00113 //   <i> Default: 1000  (1ms)
00114 #ifndef OS_TICK
00115  #define OS_TICK        1000
00116 #endif
00117 
00118 // </h>
00119 
00120 // <h>System Configuration
00121 // =======================
00122 //
00123 // <e>Round-Robin Thread switching
00124 // ===============================
00125 //
00126 // <i> Enables Round-Robin Thread switching.
00127 #ifndef OS_ROBIN
00128  #define OS_ROBIN       1
00129 #endif
00130 
00131 //   <o>Round-Robin Timeout [ticks] <1-1000>
00132 //   <i> Defines how long a thread will execute before a thread switch.
00133 //   <i> Default: 5
00134 #ifndef OS_ROBINTOUT
00135  #define OS_ROBINTOUT   5
00136 #endif
00137 
00138 // </e>
00139 
00140 // <e>User Timers
00141 // ==============
00142 //   <i> Enables user Timers
00143 #ifndef OS_TIMERS
00144  #define OS_TIMERS      1
00145 #endif
00146 
00147 //   <o>Timer Thread Priority
00148 //                        <1=> Low
00149 //                        <2=> Below Normal
00150 //                        <3=> Normal
00151 //                        <4=> Above Normal
00152 //                        <5=> High
00153 //                        <6=> Realtime (highest)
00154 //   <i> Defines priority for Timer Thread
00155 //   <i> Default: High
00156 #ifndef OS_TIMERPRIO
00157  #define OS_TIMERPRIO   5
00158 #endif
00159 
00160 //   <o>Timer Callback Queue size <1-32>
00161 //   <i> Number of concurrent active timer callback functions.
00162 //   <i> Default: 4
00163 #ifndef OS_TIMERCBQSZ
00164  #define OS_TIMERCBQS   4
00165 #endif
00166 
00167 // </e>
00168 
00169 //   <o>ISR FIFO Queue size<4=>   4 entries  <8=>   8 entries
00170 //                         <12=> 12 entries  <16=> 16 entries
00171 //                         <24=> 24 entries  <32=> 32 entries
00172 //                         <48=> 48 entries  <64=> 64 entries
00173 //                         <96=> 96 entries
00174 //   <i> ISR functions store requests to this buffer,
00175 //   <i> when they are called from the interrupt handler.
00176 //   <i> Default: 16 entries
00177 #ifndef OS_FIFOSZ
00178  #define OS_FIFOSZ      16
00179 #endif
00180 
00181 // </h>
00182 
00183 //------------- <<< end of configuration section >>> -----------------------
00184 
00185 // Standard library system mutexes
00186 // ===============================
00187 //  Define max. number system mutexes that are used to protect 
00188 //  the arm standard runtime library. For microlib they are not used.
00189 #ifndef OS_MUTEXCNT
00190  #define OS_MUTEXCNT    12
00191 #endif
00192 
00193 /*----------------------------------------------------------------------------
00194  *      RTX User configuration part END
00195  *---------------------------------------------------------------------------*/
00196 
00197 #define OS_TRV          ((uint32_t)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1)
00198 
00199 
00200 /*----------------------------------------------------------------------------
00201  *      OS Idle daemon
00202  *---------------------------------------------------------------------------*/
00203 void os_idle_demon (void) {
00204   /* The idle demon is a system thread, running when no other thread is      */
00205   /* ready to run.                                                           */
00206   
00207   /* Sleep: ideally, we should put the chip to sleep.
00208      Unfortunately, this usually requires disconnecting the interface chip (debugger).
00209      This can be done, but it would break the local file system.
00210   */
00211   for (;;) {
00212       // sleep();
00213   }
00214 }
00215 
00216 /*----------------------------------------------------------------------------
00217  *      RTX Errors
00218  *---------------------------------------------------------------------------*/
00219 extern void mbed_die(void);
00220 
00221 void os_error (uint32_t err_code) {
00222     /* This function is called when a runtime error is detected. Parameter     */
00223     /* 'err_code' holds the runtime error code (defined in RTX_Config.h).      */
00224     mbed_die();
00225 }
00226 
00227 void sysThreadError(osStatus status) {
00228     if (status != osOK) {
00229         mbed_die();
00230     }
00231 }
00232 
00233 /*----------------------------------------------------------------------------
00234  *      RTX Configuration Functions
00235  *---------------------------------------------------------------------------*/
00236 
00237 #include "RTX_CM_lib.h"
00238 
00239 /*----------------------------------------------------------------------------
00240  * end of file
00241  *---------------------------------------------------------------------------*/