Connect to SSID, get ip by dhcp, ping google.com, display statistics
Dependencies: NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed
Fork of cc3000_ping_demo by
Revision 10:b98f2d6e6da5, committed 2014-06-25
- Comitter:
- erezi
- Date:
- Wed Jun 25 06:12:22 2014 +0000
- Parent:
- 9:a0610da52eed
- Commit message:
- version_2.0
Changed in this revision
diff -r a0610da52eed -r b98f2d6e6da5 NVIC_set_all_priorities.lib --- a/NVIC_set_all_priorities.lib Tue Jun 03 08:43:07 2014 +0000 +++ b/NVIC_set_all_priorities.lib Wed Jun 25 06:12:22 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/frankvnk/code/NVIC_set_all_priorities/#01504ecd2025 +http://mbed.org/users/erezi/code/NVIC_set_all_priorities/#7ba0b126a57e
diff -r a0610da52eed -r b98f2d6e6da5 cc3000_hostdriver_mbedsocket.lib --- a/cc3000_hostdriver_mbedsocket.lib Tue Jun 03 08:43:07 2014 +0000 +++ b/cc3000_hostdriver_mbedsocket.lib Wed Jun 25 06:12:22 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/Kojto/code/cc3000_hostdriver_mbedsocket/#ca8c234997c0 +http://mbed.org/users/erezi/code/cc3000_hostdriver_mbedsocket/#e9d12b82813e
diff -r a0610da52eed -r b98f2d6e6da5 init.cpp --- a/init.cpp Tue Jun 03 08:43:07 2014 +0000 +++ b/init.cpp Wed Jun 25 06:12:22 2014 +0000 @@ -35,10 +35,10 @@ NVIC_set_all_irq_priorities(3); NVIC_SetPriority(SPI0_IRQn, 0x0); // Wi-Fi SPI interrupt must be higher priority than SysTick - NVIC_SetPriority(PORTA_IRQn, 0x1); + NVIC_SetPriority(PORTA_IRQn, 0x3); NVIC_SetPriority(SysTick_IRQn, 0x2); // SysTick set to lower priority than Wi-Fi SPI bus interrupt - PORTA->PCR[16] |=PORT_PCR_ISF_MASK; - PORTA->ISFR |= (1 << 16); + // PORTA->PCR[16] |=PORT_PCR_ISF_MASK; +// PORTA->ISFR |= (1 << 16); } #elif (MY_BOARD == WIFI_DIPCORTEX)
diff -r a0610da52eed -r b98f2d6e6da5 main.cpp --- a/main.cpp Tue Jun 03 08:43:07 2014 +0000 +++ b/main.cpp Wed Jun 25 06:12:22 2014 +0000 @@ -27,10 +27,17 @@ cc3000 wifi(p28, p27, p30, SPI(p21, p14, p37), "ssid", "key", WPA2, false); Serial pc(UART_TX, UART_RX); #elif (MY_BOARD == MBED_BOARD_EXAMPLE) -cc3000 wifi(p9, p10, p8, SPI(p5, p6, p7), "ssid", "key", WPA2, false); +//cc3000 wifi(p9, p10, p8, SPI(p5, p6, p7), "ssid", "key", WPA2, false); +//Serial pc(USBTX, USBRX); +cc3000 wifi(D3, D5, D10, SPI(SPI_MOSI, SPI_MISO, SPI_SCK), "ssid", "key", WPA2, false); Serial pc(USBTX, USBRX); + +//printf("pin selection Ok. \r\n"); + #else + + #endif /** @@ -40,10 +47,12 @@ */ int main() { init(); /* board dependent init */ - pc.baud(115200); +// pc.baud(115200); + pc.baud(9600); printf("CC3000 ping demo. \r\n"); wifi.init(); + printf("Wifi init done. \r\n"); if (wifi.connect() == -1) { printf("Failed to connect. Please verify connection details and try again. \r\n"); } else {
diff -r a0610da52eed -r b98f2d6e6da5 main.h --- a/main.h Tue Jun 03 08:43:07 2014 +0000 +++ b/main.h Wed Jun 25 06:12:22 2014 +0000 @@ -20,7 +20,10 @@ #define WIFI_DIPCORTEX 2 #define UNDEFINED 3 -#define MY_BOARD WIGO +//#define MY_BOARD WIGO +#define MY_BOARD MBED_BOARD_EXAMPLE + +#include "my_port_mapping.h" void init();
diff -r a0610da52eed -r b98f2d6e6da5 mbed.bld --- a/mbed.bld Tue Jun 03 08:43:07 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/0b3ab51c8877 \ No newline at end of file
diff -r a0610da52eed -r b98f2d6e6da5 mbed.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.lib Wed Jun 25 06:12:22 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/erezi/code/mbed/#4f9a848d74c7
diff -r a0610da52eed -r b98f2d6e6da5 my_port_mapping.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/my_port_mapping.h Wed Jun 25 06:12:22 2014 +0000 @@ -0,0 +1,1 @@ +