Integrating the ublox LISA C200 modem

Fork of SprintUSBModemHTTPClientTest by Donatien Garnier

Committer:
sam_grove
Date:
Thu Sep 26 00:44:20 2013 -0500
Revision:
5:3f93dd1d4cb3
Exported program and replaced contents of the repo with the source
to build and debug using keil mdk. Libs NOT upto date are lwip, lwip-sys
and socket. these have newer versions under mbed_official but were starting
from a know working point

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 5:3f93dd1d4cb3 1 /*----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 2 * RL-ARM - RTX
sam_grove 5:3f93dd1d4cb3 3 *----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 4 * Name: RTX_Conf_CM.C
sam_grove 5:3f93dd1d4cb3 5 * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M
sam_grove 5:3f93dd1d4cb3 6 * Rev.: V4.60
sam_grove 5:3f93dd1d4cb3 7 *----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 8 *
sam_grove 5:3f93dd1d4cb3 9 * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
sam_grove 5:3f93dd1d4cb3 10 * All rights reserved.
sam_grove 5:3f93dd1d4cb3 11 * Redistribution and use in source and binary forms, with or without
sam_grove 5:3f93dd1d4cb3 12 * modification, are permitted provided that the following conditions are met:
sam_grove 5:3f93dd1d4cb3 13 * - Redistributions of source code must retain the above copyright
sam_grove 5:3f93dd1d4cb3 14 * notice, this list of conditions and the following disclaimer.
sam_grove 5:3f93dd1d4cb3 15 * - Redistributions in binary form must reproduce the above copyright
sam_grove 5:3f93dd1d4cb3 16 * notice, this list of conditions and the following disclaimer in the
sam_grove 5:3f93dd1d4cb3 17 * documentation and/or other materials provided with the distribution.
sam_grove 5:3f93dd1d4cb3 18 * - Neither the name of ARM nor the names of its contributors may be used
sam_grove 5:3f93dd1d4cb3 19 * to endorse or promote products derived from this software without
sam_grove 5:3f93dd1d4cb3 20 * specific prior written permission.
sam_grove 5:3f93dd1d4cb3 21 *
sam_grove 5:3f93dd1d4cb3 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
sam_grove 5:3f93dd1d4cb3 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sam_grove 5:3f93dd1d4cb3 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sam_grove 5:3f93dd1d4cb3 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
sam_grove 5:3f93dd1d4cb3 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
sam_grove 5:3f93dd1d4cb3 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
sam_grove 5:3f93dd1d4cb3 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
sam_grove 5:3f93dd1d4cb3 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
sam_grove 5:3f93dd1d4cb3 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
sam_grove 5:3f93dd1d4cb3 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
sam_grove 5:3f93dd1d4cb3 32 * POSSIBILITY OF SUCH DAMAGE.
sam_grove 5:3f93dd1d4cb3 33 *---------------------------------------------------------------------------*/
sam_grove 5:3f93dd1d4cb3 34
sam_grove 5:3f93dd1d4cb3 35 #include "cmsis_os.h"
sam_grove 5:3f93dd1d4cb3 36
sam_grove 5:3f93dd1d4cb3 37
sam_grove 5:3f93dd1d4cb3 38 /*----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 39 * RTX User configuration part BEGIN
sam_grove 5:3f93dd1d4cb3 40 *---------------------------------------------------------------------------*/
sam_grove 5:3f93dd1d4cb3 41
sam_grove 5:3f93dd1d4cb3 42 //-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
sam_grove 5:3f93dd1d4cb3 43 //
sam_grove 5:3f93dd1d4cb3 44 // <h>Thread Configuration
sam_grove 5:3f93dd1d4cb3 45 // =======================
sam_grove 5:3f93dd1d4cb3 46 //
sam_grove 5:3f93dd1d4cb3 47 // <o>Number of concurrent running threads <0-250>
sam_grove 5:3f93dd1d4cb3 48 // <i> Defines max. number of threads that will run at the same time.
sam_grove 5:3f93dd1d4cb3 49 // counting "main", but not counting "osTimerThread"
sam_grove 5:3f93dd1d4cb3 50 // <i> Default: 6
sam_grove 5:3f93dd1d4cb3 51 #ifndef OS_TASKCNT
sam_grove 5:3f93dd1d4cb3 52 # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC1347)
sam_grove 5:3f93dd1d4cb3 53 # define OS_TASKCNT 14
sam_grove 5:3f93dd1d4cb3 54 # elif defined(TARGET_LPC11U24) || (TARGET_LPC1114) || (TARGET_LPC812) || defined(TARGET_KL25Z)
sam_grove 5:3f93dd1d4cb3 55 # define OS_TASKCNT 6
sam_grove 5:3f93dd1d4cb3 56 # endif
sam_grove 5:3f93dd1d4cb3 57 #endif
sam_grove 5:3f93dd1d4cb3 58
sam_grove 5:3f93dd1d4cb3 59 // <o>Scheduler (+ interrupts) stack size [bytes] <64-4096:8><#/4>
sam_grove 5:3f93dd1d4cb3 60 #ifndef OS_SCHEDULERSTKSIZE
sam_grove 5:3f93dd1d4cb3 61 # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC1347)
sam_grove 5:3f93dd1d4cb3 62 # define OS_SCHEDULERSTKSIZE 256
sam_grove 5:3f93dd1d4cb3 63 # elif defined(TARGET_LPC11U24) || (TARGET_LPC1114) || (TARGET_LPC812) || defined(TARGET_KL25Z)
sam_grove 5:3f93dd1d4cb3 64 # define OS_SCHEDULERSTKSIZE 128
sam_grove 5:3f93dd1d4cb3 65 # endif
sam_grove 5:3f93dd1d4cb3 66 #endif
sam_grove 5:3f93dd1d4cb3 67
sam_grove 5:3f93dd1d4cb3 68 // <o>Idle stack size [bytes] <64-4096:8><#/4>
sam_grove 5:3f93dd1d4cb3 69 // <i> Defines default stack size for the Idle thread.
sam_grove 5:3f93dd1d4cb3 70 #ifndef OS_IDLESTKSIZE
sam_grove 5:3f93dd1d4cb3 71 #define OS_IDLESTKSIZE 128
sam_grove 5:3f93dd1d4cb3 72 #endif
sam_grove 5:3f93dd1d4cb3 73
sam_grove 5:3f93dd1d4cb3 74 // <o>Timer Thread stack size [bytes] <64-4096:8><#/4>
sam_grove 5:3f93dd1d4cb3 75 // <i> Defines stack size for Timer thread.
sam_grove 5:3f93dd1d4cb3 76 // <i> Default: 200
sam_grove 5:3f93dd1d4cb3 77 #ifndef OS_TIMERSTKSZ
sam_grove 5:3f93dd1d4cb3 78 #define OS_TIMERSTKSZ WORDS_STACK_SIZE
sam_grove 5:3f93dd1d4cb3 79 #endif
sam_grove 5:3f93dd1d4cb3 80
sam_grove 5:3f93dd1d4cb3 81 // <q>Check for stack overflow
sam_grove 5:3f93dd1d4cb3 82 // <i> Includes the stack checking code for stack overflow.
sam_grove 5:3f93dd1d4cb3 83 // <i> Note that additional code reduces the Kernel performance.
sam_grove 5:3f93dd1d4cb3 84 #ifndef OS_STKCHECK
sam_grove 5:3f93dd1d4cb3 85 #define OS_STKCHECK 1
sam_grove 5:3f93dd1d4cb3 86 #endif
sam_grove 5:3f93dd1d4cb3 87
sam_grove 5:3f93dd1d4cb3 88 // <o>Processor mode for thread execution
sam_grove 5:3f93dd1d4cb3 89 // <0=> Unprivileged mode
sam_grove 5:3f93dd1d4cb3 90 // <1=> Privileged mode
sam_grove 5:3f93dd1d4cb3 91 // <i> Default: Privileged mode
sam_grove 5:3f93dd1d4cb3 92 #ifndef OS_RUNPRIV
sam_grove 5:3f93dd1d4cb3 93 #define OS_RUNPRIV 1
sam_grove 5:3f93dd1d4cb3 94 #endif
sam_grove 5:3f93dd1d4cb3 95
sam_grove 5:3f93dd1d4cb3 96 // </h>
sam_grove 5:3f93dd1d4cb3 97 // <h>SysTick Timer Configuration
sam_grove 5:3f93dd1d4cb3 98 // ==============================
sam_grove 5:3f93dd1d4cb3 99 //
sam_grove 5:3f93dd1d4cb3 100 // <o>Timer clock value [Hz] <1-1000000000>
sam_grove 5:3f93dd1d4cb3 101 // <i> Defines the timer clock value.
sam_grove 5:3f93dd1d4cb3 102 // <i> Default: 6000000 (6MHz)
sam_grove 5:3f93dd1d4cb3 103 #ifndef OS_CLOCK
sam_grove 5:3f93dd1d4cb3 104 # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
sam_grove 5:3f93dd1d4cb3 105 # define OS_CLOCK 96000000
sam_grove 5:3f93dd1d4cb3 106
sam_grove 5:3f93dd1d4cb3 107 # elif defined(TARGET_LPC1347)
sam_grove 5:3f93dd1d4cb3 108 # define OS_CLOCK 72000000
sam_grove 5:3f93dd1d4cb3 109
sam_grove 5:3f93dd1d4cb3 110 # elif defined(TARGET_LPC11U24) || (TARGET_LPC1114) || defined(TARGET_KL25Z)
sam_grove 5:3f93dd1d4cb3 111 # define OS_CLOCK 48000000
sam_grove 5:3f93dd1d4cb3 112 #
sam_grove 5:3f93dd1d4cb3 113 # elif defined(TARGET_LPC812)
sam_grove 5:3f93dd1d4cb3 114 # define OS_CLOCK 36000000
sam_grove 5:3f93dd1d4cb3 115 #
sam_grove 5:3f93dd1d4cb3 116 # elif defined(TARGET_LPC4088)
sam_grove 5:3f93dd1d4cb3 117 # define OS_CLOCK 120000000
sam_grove 5:3f93dd1d4cb3 118 # endif
sam_grove 5:3f93dd1d4cb3 119 #endif
sam_grove 5:3f93dd1d4cb3 120
sam_grove 5:3f93dd1d4cb3 121 // <o>Timer tick value [us] <1-1000000>
sam_grove 5:3f93dd1d4cb3 122 // <i> Defines the timer tick value.
sam_grove 5:3f93dd1d4cb3 123 // <i> Default: 1000 (1ms)
sam_grove 5:3f93dd1d4cb3 124 #ifndef OS_TICK
sam_grove 5:3f93dd1d4cb3 125 #define OS_TICK 1000
sam_grove 5:3f93dd1d4cb3 126 #endif
sam_grove 5:3f93dd1d4cb3 127
sam_grove 5:3f93dd1d4cb3 128 // </h>
sam_grove 5:3f93dd1d4cb3 129
sam_grove 5:3f93dd1d4cb3 130 // <h>System Configuration
sam_grove 5:3f93dd1d4cb3 131 // =======================
sam_grove 5:3f93dd1d4cb3 132 //
sam_grove 5:3f93dd1d4cb3 133 // <e>Round-Robin Thread switching
sam_grove 5:3f93dd1d4cb3 134 // ===============================
sam_grove 5:3f93dd1d4cb3 135 //
sam_grove 5:3f93dd1d4cb3 136 // <i> Enables Round-Robin Thread switching.
sam_grove 5:3f93dd1d4cb3 137 #ifndef OS_ROBIN
sam_grove 5:3f93dd1d4cb3 138 #define OS_ROBIN 1
sam_grove 5:3f93dd1d4cb3 139 #endif
sam_grove 5:3f93dd1d4cb3 140
sam_grove 5:3f93dd1d4cb3 141 // <o>Round-Robin Timeout [ticks] <1-1000>
sam_grove 5:3f93dd1d4cb3 142 // <i> Defines how long a thread will execute before a thread switch.
sam_grove 5:3f93dd1d4cb3 143 // <i> Default: 5
sam_grove 5:3f93dd1d4cb3 144 #ifndef OS_ROBINTOUT
sam_grove 5:3f93dd1d4cb3 145 #define OS_ROBINTOUT 5
sam_grove 5:3f93dd1d4cb3 146 #endif
sam_grove 5:3f93dd1d4cb3 147
sam_grove 5:3f93dd1d4cb3 148 // </e>
sam_grove 5:3f93dd1d4cb3 149
sam_grove 5:3f93dd1d4cb3 150 // <e>User Timers
sam_grove 5:3f93dd1d4cb3 151 // ==============
sam_grove 5:3f93dd1d4cb3 152 // <i> Enables user Timers
sam_grove 5:3f93dd1d4cb3 153 #ifndef OS_TIMERS
sam_grove 5:3f93dd1d4cb3 154 #define OS_TIMERS 1
sam_grove 5:3f93dd1d4cb3 155 #endif
sam_grove 5:3f93dd1d4cb3 156
sam_grove 5:3f93dd1d4cb3 157 // <o>Timer Thread Priority
sam_grove 5:3f93dd1d4cb3 158 // <1=> Low
sam_grove 5:3f93dd1d4cb3 159 // <2=> Below Normal
sam_grove 5:3f93dd1d4cb3 160 // <3=> Normal
sam_grove 5:3f93dd1d4cb3 161 // <4=> Above Normal
sam_grove 5:3f93dd1d4cb3 162 // <5=> High
sam_grove 5:3f93dd1d4cb3 163 // <6=> Realtime (highest)
sam_grove 5:3f93dd1d4cb3 164 // <i> Defines priority for Timer Thread
sam_grove 5:3f93dd1d4cb3 165 // <i> Default: High
sam_grove 5:3f93dd1d4cb3 166 #ifndef OS_TIMERPRIO
sam_grove 5:3f93dd1d4cb3 167 #define OS_TIMERPRIO 5
sam_grove 5:3f93dd1d4cb3 168 #endif
sam_grove 5:3f93dd1d4cb3 169
sam_grove 5:3f93dd1d4cb3 170 // <o>Timer Callback Queue size <1-32>
sam_grove 5:3f93dd1d4cb3 171 // <i> Number of concurrent active timer callback functions.
sam_grove 5:3f93dd1d4cb3 172 // <i> Default: 4
sam_grove 5:3f93dd1d4cb3 173 #ifndef OS_TIMERCBQSZ
sam_grove 5:3f93dd1d4cb3 174 #define OS_TIMERCBQS 4
sam_grove 5:3f93dd1d4cb3 175 #endif
sam_grove 5:3f93dd1d4cb3 176
sam_grove 5:3f93dd1d4cb3 177 // </e>
sam_grove 5:3f93dd1d4cb3 178
sam_grove 5:3f93dd1d4cb3 179 // <o>ISR FIFO Queue size<4=> 4 entries <8=> 8 entries
sam_grove 5:3f93dd1d4cb3 180 // <12=> 12 entries <16=> 16 entries
sam_grove 5:3f93dd1d4cb3 181 // <24=> 24 entries <32=> 32 entries
sam_grove 5:3f93dd1d4cb3 182 // <48=> 48 entries <64=> 64 entries
sam_grove 5:3f93dd1d4cb3 183 // <96=> 96 entries
sam_grove 5:3f93dd1d4cb3 184 // <i> ISR functions store requests to this buffer,
sam_grove 5:3f93dd1d4cb3 185 // <i> when they are called from the interrupt handler.
sam_grove 5:3f93dd1d4cb3 186 // <i> Default: 16 entries
sam_grove 5:3f93dd1d4cb3 187 #ifndef OS_FIFOSZ
sam_grove 5:3f93dd1d4cb3 188 #define OS_FIFOSZ 16
sam_grove 5:3f93dd1d4cb3 189 #endif
sam_grove 5:3f93dd1d4cb3 190
sam_grove 5:3f93dd1d4cb3 191 // </h>
sam_grove 5:3f93dd1d4cb3 192
sam_grove 5:3f93dd1d4cb3 193 //------------- <<< end of configuration section >>> -----------------------
sam_grove 5:3f93dd1d4cb3 194
sam_grove 5:3f93dd1d4cb3 195 // Standard library system mutexes
sam_grove 5:3f93dd1d4cb3 196 // ===============================
sam_grove 5:3f93dd1d4cb3 197 // Define max. number system mutexes that are used to protect
sam_grove 5:3f93dd1d4cb3 198 // the arm standard runtime library. For microlib they are not used.
sam_grove 5:3f93dd1d4cb3 199 #ifndef OS_MUTEXCNT
sam_grove 5:3f93dd1d4cb3 200 #define OS_MUTEXCNT 12
sam_grove 5:3f93dd1d4cb3 201 #endif
sam_grove 5:3f93dd1d4cb3 202
sam_grove 5:3f93dd1d4cb3 203 /*----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 204 * RTX User configuration part END
sam_grove 5:3f93dd1d4cb3 205 *---------------------------------------------------------------------------*/
sam_grove 5:3f93dd1d4cb3 206
sam_grove 5:3f93dd1d4cb3 207 #define OS_TRV ((uint32_t)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1)
sam_grove 5:3f93dd1d4cb3 208
sam_grove 5:3f93dd1d4cb3 209
sam_grove 5:3f93dd1d4cb3 210 /*----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 211 * OS Idle daemon
sam_grove 5:3f93dd1d4cb3 212 *---------------------------------------------------------------------------*/
sam_grove 5:3f93dd1d4cb3 213 void os_idle_demon (void) {
sam_grove 5:3f93dd1d4cb3 214 /* The idle demon is a system thread, running when no other thread is */
sam_grove 5:3f93dd1d4cb3 215 /* ready to run. */
sam_grove 5:3f93dd1d4cb3 216
sam_grove 5:3f93dd1d4cb3 217 /* Sleep: ideally, we should put the chip to sleep.
sam_grove 5:3f93dd1d4cb3 218 Unfortunately, this usually requires disconnecting the interface chip (debugger).
sam_grove 5:3f93dd1d4cb3 219 This can be done, but it would break the local file system.
sam_grove 5:3f93dd1d4cb3 220 */
sam_grove 5:3f93dd1d4cb3 221 for (;;) {
sam_grove 5:3f93dd1d4cb3 222 // sleep();
sam_grove 5:3f93dd1d4cb3 223 }
sam_grove 5:3f93dd1d4cb3 224 }
sam_grove 5:3f93dd1d4cb3 225
sam_grove 5:3f93dd1d4cb3 226 /*----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 227 * RTX Errors
sam_grove 5:3f93dd1d4cb3 228 *---------------------------------------------------------------------------*/
sam_grove 5:3f93dd1d4cb3 229 extern void mbed_die(void);
sam_grove 5:3f93dd1d4cb3 230
sam_grove 5:3f93dd1d4cb3 231 void os_error (uint32_t err_code) {
sam_grove 5:3f93dd1d4cb3 232 /* This function is called when a runtime error is detected. Parameter */
sam_grove 5:3f93dd1d4cb3 233 /* 'err_code' holds the runtime error code (defined in RTX_Conf.h). */
sam_grove 5:3f93dd1d4cb3 234 mbed_die();
sam_grove 5:3f93dd1d4cb3 235 }
sam_grove 5:3f93dd1d4cb3 236
sam_grove 5:3f93dd1d4cb3 237 void sysThreadError(osStatus status) {
sam_grove 5:3f93dd1d4cb3 238 if (status != osOK) {
sam_grove 5:3f93dd1d4cb3 239 mbed_die();
sam_grove 5:3f93dd1d4cb3 240 }
sam_grove 5:3f93dd1d4cb3 241 }
sam_grove 5:3f93dd1d4cb3 242
sam_grove 5:3f93dd1d4cb3 243 /*----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 244 * RTX Configuration Functions
sam_grove 5:3f93dd1d4cb3 245 *---------------------------------------------------------------------------*/
sam_grove 5:3f93dd1d4cb3 246
sam_grove 5:3f93dd1d4cb3 247 #include "RTX_CM_lib.h"
sam_grove 5:3f93dd1d4cb3 248
sam_grove 5:3f93dd1d4cb3 249 /*----------------------------------------------------------------------------
sam_grove 5:3f93dd1d4cb3 250 * end of file
sam_grove 5:3f93dd1d4cb3 251 *---------------------------------------------------------------------------*/