diff options
| author | bzztbomb <skinny@knowhere.net> | 2011-04-05 19:57:16 -0700 |
|---|---|---|
| committer | bzztbomb <skinny@knowhere.net> | 2011-04-05 19:57:16 -0700 |
| commit | 73e16950d73578900d54f3470b57402a9e908c30 (patch) | |
| tree | 4e24dd9b04bd432139c3ed61866459ac77e4024a /Libraries/WiShield/WiShield.cpp | |
| parent | 6827a350052baf3999cfa336411f5ec89bb9e769 (diff) | |
Public firmware release.
Diffstat (limited to 'Libraries/WiShield/WiShield.cpp')
| -rw-r--r-- | Libraries/WiShield/WiShield.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/Libraries/WiShield/WiShield.cpp b/Libraries/WiShield/WiShield.cpp index 2e61afa..4488a67 100644 --- a/Libraries/WiShield/WiShield.cpp +++ b/Libraries/WiShield/WiShield.cpp @@ -41,12 +41,13 @@ extern "C" { #include "spi.h" void stack_init(void); void stack_process(void); + void stack_send_udp(void); } #include "WProgram.h" #include "WiShield.h" -void WiShield::init() +void WiShield::init(int async) { zg_init(); @@ -61,11 +62,26 @@ void WiShield::init() PCMSK0 |= (1<<PCINT0); #endif - while(zg_get_conn_state() != 1) { - zg_drv_process(); - } + if (async == 0) + { + while(zg_get_conn_state() != 1) { + zg_drv_process(); + } - stack_init(); + stack_init(); + } +} + +int WiShield::continueInit() +{ + if (zg_get_conn_state() != 1) + { + zg_drv_process(); + return 0; + } else { + stack_init(); + return 1; + } } void WiShield::run() @@ -74,6 +90,12 @@ void WiShield::run() zg_drv_process(); } +void WiShield::sendUdp() +{ + stack_send_udp(); + zg_drv_process(); +} + #if defined USE_DIG8_INTR && !defined APP_WISERVER // PCINT0 interrupt vector ISR(PCINT0_vect) |
