My enhancements to the WiShield tree #3

Open
wants to merge 17 commits into
from

Conversation

Projects
None yet
3 participants

CapnBry commented Aug 21, 2011

I started these enhancements 9 months ago before the WiShield became unavailable. I've ported them from my svn tree to git.

-- Merges all the WEP / WPA into one variable, called security_data. This saves on code space and the user can only use one at a time anyway
-- Adds WPA / WPA2 Precalc as a security type. This is a 32 byte precalculated key so the g2100 doesn't have to do it on every boot. Reduces startup time from 35 seconds to 6 seconds.
-- Reduces RAM (~150 bytes) and PROGMEM (~300 bytes) by optimizing some functions and removing the runtime verbose flag. You can still compile with verbose but not change it at runtime.
-- Take back some of that RAM I freed by increasing the UIP buffer size by 100 bytes. Increases throughput by 29%.

CapnBry added some commits Aug 21, 2011

@CapnBry CapnBry Pull server httpGET from progmem, saves 6 bytes of RAM
If user code is also using strncmp_P() this could save 28 additional byes of code space from the elimination of linking strncmp()
965ed56
@CapnBry CapnBry Convert to UNIX line endings like the rest of the source is 6df03e8
@CapnBry CapnBry Use the global var ssid_len instead of cmd->ssid_len, saves 2 bytes 0a9b8a4
@CapnBry CapnBry Remove verbose flag from WiServer class and wrap the old code with #i…
…fdef DEBUG. Old DEBUG code moved to DEBUG_VERBOSE.

Saves (bytes): 260 code, 132 data, 1 bss = 392 PROGMEM, 133 RAM
7f035e1
@CapnBry CapnBry A little better comment for the DEBUG / DEBUG_VERBOSE defines 3d0bfc0
@CapnBry CapnBry Change processLine to use strncpy. Technically this adds 2 bytes to t…
…he code size due to linking strncpy() but I want to use that function later and it will come free then.
fbdeb03
@CapnBry CapnBry Remember those savings for using strncpy I mentioned? Convert memset/…
…memcpy/memcpy_P to use strncpy/strncpy_P. Saves 90 bytes of code.

Also removed security_passphrase_len because it is only used in one place, saves 1 byte of RAM but means one less thing in the WiFi config block
6033937
@CapnBry CapnBry Remove security_passphrase_len from all the examples 5c5be6a
@CapnBry CapnBry More EOL conversion to UNIX 3726cc4
@CapnBry CapnBry Remove UIP_WEP_KEY_DEFAULT and only support one WEP key. There's no n…
…eed to waste the space of storing four compiled-in keys when only one can be used.
beff4c2
@CapnBry CapnBry Consolidate wep_keys and security_passphrase into one variable. Saves…
… some code space if you had both defined. This is prep for adding precalculated WPA keys.
8a661a9
@CapnBry CapnBry Add support for precalculated WPA keys d8ef789
@CapnBry CapnBry ssid_len should be local to g2100.c because it is calculated, not sup…
…plied
145f772
@CapnBry CapnBry Update examples to new default security_data d6d88ac
@CapnBry CapnBry There is no enableVerboseMode() any longer, compile with DEBUG / DEBU…
…G_VERBOSE defined
5a738a4
@CapnBry CapnBry Increase the UIP buffer size from 400 -> 500 bytes.
This is a 29% throughput increase and it shouldn't cause any overflow because I reduced the RAM usage by 133 in the DEBUG commit alone (7f035e1)
8a1a9e3

Wow, I'm really excited about the precalc feature!

@jtouch jtouch Ported to Arduino 1.0 compiler.
Includes support for size_t print functions (not void) and changed program code suffix (.pde to .ino).
23f701c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment