Added stopping condition, moved some defines to header.
Merge branch 'master' of https://github.com/dw19375/contikiV