ArchMax_CC3000_NTP

Dependencies:   NTPClient3 NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed

Committer:
JackB
Date:
Sat Oct 17 23:31:20 2015 +0000
Revision:
0:0e8d73b27253
None

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JackB 0:0e8d73b27253 1 /* mbed Microcontroller Library
JackB 0:0e8d73b27253 2 * Copyright (c) 2006-2013 ARM Limited
JackB 0:0e8d73b27253 3 *
JackB 0:0e8d73b27253 4 * Licensed under the Apache License, Version 2.0 (the "License");
JackB 0:0e8d73b27253 5 * you may not use this file except in compliance with the License.
JackB 0:0e8d73b27253 6 * You may obtain a copy of the License at
JackB 0:0e8d73b27253 7 *
JackB 0:0e8d73b27253 8 * http://www.apache.org/licenses/LICENSE-2.0
JackB 0:0e8d73b27253 9 *
JackB 0:0e8d73b27253 10 * Unless required by applicable law or agreed to in writing, software
JackB 0:0e8d73b27253 11 * distributed under the License is distributed on an "AS IS" BASIS,
JackB 0:0e8d73b27253 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
JackB 0:0e8d73b27253 13 * See the License for the specific language governing permissions and
JackB 0:0e8d73b27253 14 * limitations under the License.
JackB 0:0e8d73b27253 15 */
JackB 0:0e8d73b27253 16 #include "main.h"
JackB 0:0e8d73b27253 17 #include "mbed.h"
JackB 0:0e8d73b27253 18
JackB 0:0e8d73b27253 19 #if (MY_BOARD == WIGO)
JackB 0:0e8d73b27253 20
JackB 0:0e8d73b27253 21 #include "NVIC_set_all_priorities.h"
JackB 0:0e8d73b27253 22
JackB 0:0e8d73b27253 23 /**
JackB 0:0e8d73b27253 24 * \brief Wi-Go initialization
JackB 0:0e8d73b27253 25 * \param none
JackB 0:0e8d73b27253 26 * \return none
JackB 0:0e8d73b27253 27 */
JackB 0:0e8d73b27253 28 void init() {
JackB 0:0e8d73b27253 29 // DigitalOut PWR_EN1(PTB2);
JackB 0:0e8d73b27253 30 // DigitalOut PWR_EN2(PTB3);
JackB 0:0e8d73b27253 31
JackB 0:0e8d73b27253 32 // Wi-Go set current to 500mA since we're turning on the Wi-Fi
JackB 0:0e8d73b27253 33 // PWR_EN1 = 0;
JackB 0:0e8d73b27253 34 // PWR_EN2 = 1;
JackB 0:0e8d73b27253 35
JackB 0:0e8d73b27253 36 NVIC_set_all_irq_priorities(3);
JackB 0:0e8d73b27253 37 // NVIC_SetPriority(SPI0_IRQn, 0x0); // Wi-Fi SPI interrupt must be higher priority than SysTick
JackB 0:0e8d73b27253 38 // NVIC_SetPriority(PORTA_IRQn, 0x1);
JackB 0:0e8d73b27253 39 NVIC_SetPriority(SysTick_IRQn, 0x2); // SysTick set to lower priority than Wi-Fi SPI bus interrupt
JackB 0:0e8d73b27253 40 // PORTA->PCR[16] |=PORT_PCR_ISF_MASK;
JackB 0:0e8d73b27253 41 // PORTA->ISFR |= (1 << 16);
JackB 0:0e8d73b27253 42 }
JackB 0:0e8d73b27253 43
JackB 0:0e8d73b27253 44 #elif (MY_BOARD == WIFI_DIPCORTEX)
JackB 0:0e8d73b27253 45
JackB 0:0e8d73b27253 46 /**
JackB 0:0e8d73b27253 47 * \brief Wifi DipCortex initialization
JackB 0:0e8d73b27253 48 * \param none
JackB 0:0e8d73b27253 49 * \return none
JackB 0:0e8d73b27253 50 */
JackB 0:0e8d73b27253 51 void init() {
JackB 0:0e8d73b27253 52 NVIC_SetPriority(SSP1_IRQn, 0x0);
JackB 0:0e8d73b27253 53 NVIC_SetPriority(PIN_INT0_IRQn, 0x1);
JackB 0:0e8d73b27253 54
JackB 0:0e8d73b27253 55 // SysTick set to lower priority than Wi-Fi SPI bus interrupt
JackB 0:0e8d73b27253 56 NVIC_SetPriority(SysTick_IRQn, 0x2);
JackB 0:0e8d73b27253 57 }
JackB 0:0e8d73b27253 58
JackB 0:0e8d73b27253 59 #else
JackB 0:0e8d73b27253 60
JackB 0:0e8d73b27253 61 /**
JackB 0:0e8d73b27253 62 * \brief Place here init routine for your board
JackB 0:0e8d73b27253 63 * \param none
JackB 0:0e8d73b27253 64 * \return none
JackB 0:0e8d73b27253 65 */
JackB 0:0e8d73b27253 66 void init() {
JackB 0:0e8d73b27253 67
JackB 0:0e8d73b27253 68 }
JackB 0:0e8d73b27253 69
JackB 0:0e8d73b27253 70 #endif