Move unpack lwip ip address macro to macros module.
[bertos.git] / boards / sam3x-ek / examples / sam3x-ek_http_server / main.c
index c47424878d477f110fca8b08b8c8ee71a209295c..30054db8778db960f46190e8b1a707b15f2d81bc 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
-/* Macro to unpack the ip addres from lwip format in 4 int*/
-#define IP_ADDR_TO_INT_TUPLE(addr) \
-               (int)((addr) >>  0 & 0xff), \
-               (int)((addr) >>  8 & 0xff), \
-               (int)((addr) >> 16 & 0xff), \
-               (int)((addr) >> 24 & 0xff)
-
 /* Network interface global variables */
 static struct ip_addr ipaddr, netmask, gw;
 static struct netif netif;
@@ -592,7 +585,7 @@ int main(void)
 
        sprintf(status.local_ip, "%d.%d.%d.%d", IP_ADDR_TO_INT_TUPLE(netif.ip_addr.addr));
        sprintf(status.last_connected_ip, "%d.%d.%d.%d", IP_ADDR_TO_INT_TUPLE(0));
-       LOG_INFO("dhcp ok: ip = %s\", status.local_ip);
+       LOG_INFO("dhcp ok: ip = %s\n", status.local_ip);
 
        text_xprintf(lcd_bitmap, 14, 0, 0, "Board ip: %s", status.local_ip);
        lcd_hx8347_blitBitmap(lcd_bitmap);